Changeset 12840 for branches/HeuristicLab.Problems.GrammaticalOptimization/HeuristicLab.Algorithms.MonteCarloTreeSearch/MonteCarloTreeSearch.cs
- Timestamp:
- 08/08/15 19:49:05 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Problems.GrammaticalOptimization/HeuristicLab.Algorithms.MonteCarloTreeSearch/MonteCarloTreeSearch.cs
r12832 r12840 43 43 } 44 44 45 public event Action<int, int> NodeSelected;46 47 protected virtual void On NodeSelectedChanged(int value, int selections)48 { 49 Raise NodeSelectedChanged(value, selections);50 } 51 52 private void Raise NodeSelectedChanged(int value, int selections)53 { 54 var handler = NodeSelected;45 public event Action<int, int> IterationFinished; 46 47 protected virtual void OnIterationFinishedChanged(int value, int selections) 48 { 49 RaiseIterationFinishedChanged(value, selections); 50 } 51 52 private void RaiseIterationFinishedChanged(int value, int selections) 53 { 54 var handler = IterationFinished; 55 55 if (handler != null) handler(value, selections); 56 56 } … … 66 66 goodSelections++; 67 67 } 68 69 OnNodeSelectedChanged(goodSelections, selections);70 68 } 71 69 … … 88 86 currentNode.GetChildActionInfos()); 89 87 currentNode = currentNode.children[currentActionIndex]; 90 //selections++;91 //CheckSelection(currentNode, selections);88 selections++; 89 CheckSelection(currentNode, selections); 92 90 } 93 91 … … 100 98 currentNode.children[behaviourPolicy.SelectAction(random, currentNode.GetChildActionInfos()) 101 99 ]; 102 //selections++;103 //CheckSelection(currentNode, selections);100 selections++; 101 CheckSelection(currentNode, selections); 104 102 } 105 103 if (currentNode.phrase.Length <= maxLen) … … 108 106 OnSolutionEvaluated(simulatedPhrase, quality); 109 107 108 OnIterationFinishedChanged(goodSelections, selections); 110 109 Propagate(currentNode, quality); 111 110 }
Note: See TracChangeset
for help on using the changeset viewer.