Changeset 324 for trunk/sources/HeuristicLab.StructureIdentification/Manipulation/SubstituteSubTreeManipulation.cs
- Timestamp:
- 06/18/08 16:20:26 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.StructureIdentification/Manipulation/SubstituteSubTreeManipulation.cs
r238 r324 65 65 66 66 // update the variables in the scope with the new values 67 GetVariableValue<IntData>("TreeSize", scope, true).Data = gardener.GetTreeSize(newTree);68 GetVariableValue<IntData>("TreeHeight", scope, true).Data = gardener.GetTreeHeight(newTree);67 GetVariableValue<IntData>("TreeSize", scope, true).Data = newTree.Size; 68 GetVariableValue<IntData>("TreeHeight", scope, true).Data = newTree.Height; 69 69 scope.GetVariable(scope.TranslateName("FunctionTree")).Value = newTree; 70 70 … … 86 86 int parentLevel = gardener.GetBranchLevel(root, parent); 87 87 int maxSubTreeHeight = maxTreeHeight - parentLevel; 88 int maxSubTreeSize = maxTreeSize - (treeSize - gardener.GetTreeSize(parent.SubTrees[childIndex]));88 int maxSubTreeSize = maxTreeSize - (treeSize - parent.SubTrees[childIndex].Size); 89 89 90 90 // create a random function tree … … 95 95 Debug.Assert(gardener.IsValidTree(root)); 96 96 // update the values of treeSize and treeHeight 97 GetVariableValue<IntData>("TreeSize", scope, true).Data = gardener.GetTreeSize(root);98 GetVariableValue<IntData>("TreeHeight", scope, true).Data = gardener.GetTreeHeight(root);97 GetVariableValue<IntData>("TreeSize", scope, true).Data = root.Size; 98 GetVariableValue<IntData>("TreeHeight", scope, true).Data = root.Height; 99 99 // the root hasn't changed so we don't need to update 100 100 // return a CompositeOperation that randomly initializes all nodes of the new subtree
Note: See TracChangeset
for help on using the changeset viewer.