Changeset 12098 for branches/HeuristicLab.Problems.GrammaticalOptimization/HeuristicLab.Algorithms.MonteCarloTreeSearch/Base/TreeNode.cs
- Timestamp:
- 02/27/15 21:52:10 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Problems.GrammaticalOptimization/HeuristicLab.Algorithms.MonteCarloTreeSearch/Base/TreeNode.cs
r12050 r12098 5 5 using System.Threading.Tasks; 6 6 using HeuristicLab.Algorithms.Bandits; 7 using HeuristicLab.Algorithms.Bandits.BanditPolicies; 7 8 using HeuristicLab.Problems.GrammaticalOptimization; 8 9 9 namespace HeuristicLab.Algorithms.MonteCarloTreeSearch 10 namespace HeuristicLab.Algorithms.MonteCarloTreeSearch.Base 10 11 { 11 12 public class TreeNode … … 15 16 public List<TreeNode> children; 16 17 public IBanditPolicyActionInfo actionInfo; 17 public bool expandable;18 public List<int> unvisitedNonTerminals;19 18 20 public TreeNode(TreeNode parent, string phrase , bool expandable, List<int> unvisitedNonTerminals)19 public TreeNode(TreeNode parent, string phrase) 21 20 { 21 this.parent = parent; 22 22 this.phrase = phrase; 23 this.expandable = expandable; 24 this.unvisitedNonTerminals = unvisitedNonTerminals; 23 actionInfo = new DefaultPolicyActionInfo(); 24 } 25 public bool IsLeaf() 26 { 27 return children == null || !children.Any(); 28 } 29 30 internal IEnumerable<IBanditPolicyActionInfo> GetChildActionInfos() 31 { 32 return children.Select(n => n.actionInfo); 25 33 } 26 34 }
Note: See TracChangeset
for help on using the changeset viewer.