Changeset 324 for trunk/sources/HeuristicLab.StructureIdentification/Manipulation/CutOutNodeManipulation.cs
- Timestamp:
- 06/18/08 16:20:26 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.StructureIdentification/Manipulation/CutOutNodeManipulation.cs
r238 r324 74 74 if (root.SubTrees.Count > 0) { 75 75 root = root.SubTrees[random.Next(root.SubTrees.Count)]; 76 GetVariableValue<IntData>("TreeSize", scope, true).Data = gardener.GetTreeSize(root);77 GetVariableValue<IntData>("TreeHeight", scope, true).Data = gardener.GetTreeHeight(root);76 GetVariableValue<IntData>("TreeSize", scope, true).Data = root.Size; 77 GetVariableValue<IntData>("TreeHeight", scope, true).Data = root.Height; 78 78 // update the variable 79 79 scope.GetVariable(scope.TranslateName("FunctionTree")).Value = root; … … 85 85 IFunctionTree newTree; 86 86 newTree = gardener.CreateRandomTree(gardener.Terminals, 1, 1); 87 GetVariableValue<IntData>("TreeSize", scope, true).Data = gardener.GetTreeSize(newTree);88 GetVariableValue<IntData>("TreeHeight", scope, true).Data = gardener.GetTreeHeight(newTree);87 GetVariableValue<IntData>("TreeSize", scope, true).Data = newTree.Size; 88 GetVariableValue<IntData>("TreeHeight", scope, true).Data = newTree.Height; 89 89 // update the variable 90 90 scope.GetVariable(scope.TranslateName("FunctionTree")).Value = newTree; … … 107 107 Debug.Assert(gardener.IsValidTree(root)); 108 108 // update the size and height of our tree 109 GetVariableValue<IntData>("TreeSize", scope, true).Data = gardener.GetTreeSize(root);110 GetVariableValue<IntData>("TreeHeight", scope, true).Data = gardener.GetTreeHeight(root);109 GetVariableValue<IntData>("TreeSize", scope, true).Data = root.Size; 110 GetVariableValue<IntData>("TreeHeight", scope, true).Data = root.Height; 111 111 // don't need to schedule initialization operations 112 112 return null; … … 118 118 parent.RemoveSubTree(childIndex); 119 119 // then determine the number of nodes left over after the child has been removed! 120 int remainingNodes = gardener.GetTreeSize(root);120 int remainingNodes = root.Size; 121 121 allowedFunctions = gardener.GetAllowedSubFunctions(parent.Function, childIndex); 122 122 IFunctionTree newFunctionTree = gardener.CreateRandomTree(allowedFunctions, maxTreeSize - remainingNodes, maxTreeHeight - parentLevel); 123 123 parent.InsertSubTree(childIndex, newFunctionTree); 124 GetVariableValue<IntData>("TreeSize", scope, true).Data = gardener.GetTreeSize(root);125 GetVariableValue<IntData>("TreeHeight", scope, true).Data = gardener.GetTreeHeight(root);124 GetVariableValue<IntData>("TreeSize", scope, true).Data = root.Size; 125 GetVariableValue<IntData>("TreeHeight", scope, true).Data = root.Height; 126 126 Debug.Assert(gardener.IsValidTree(root)); 127 127 // schedule an initialization operation for the new function-tree
Note: See TracChangeset
for help on using the changeset viewer.