Changeset 12832 for branches/HeuristicLab.Problems.GrammaticalOptimization/HeuristicLab.Algorithms.MonteCarloTreeSearch/Base
- Timestamp:
- 08/03/15 00:03:18 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Problems.GrammaticalOptimization/HeuristicLab.Algorithms.MonteCarloTreeSearch/Base/TreeNode.cs
r12762 r12832 14 14 public string phrase; 15 15 public TreeNode parent; 16 public List<TreeNode>children;16 public TreeNode[] children; 17 17 public IBanditPolicyActionInfo actionInfo; 18 public int level;18 public ushort level; 19 19 20 public TreeNode(TreeNode parent, string phrase, IBanditPolicyActionInfo actionInfo, int level)20 public TreeNode(TreeNode parent, string phrase, IBanditPolicyActionInfo actionInfo, ushort level) 21 21 { 22 22 this.parent = parent; … … 34 34 return children.Select(n => n.actionInfo); 35 35 } 36 37 internal void RemoveChildren(TreeNode currentNode) 38 { 39 TreeNode[] newChildren = new TreeNode[children.Length-1]; 40 int counter = 0; 41 for (int i = 0; i < children.Length; i++) 42 { 43 if (children[i] != currentNode) 44 { 45 newChildren[counter] = children[i]; 46 counter++; 47 } 48 } 49 children = newChildren; 50 } 36 51 } 37 52 }
Note: See TracChangeset
for help on using the changeset viewer.