Changeset 324 for trunk/sources/HeuristicLab.StructureIdentification/Manipulation/ChangeNodeTypeManipulation.cs
- Timestamp:
- 06/18/08 16:20:26 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.StructureIdentification/Manipulation/ChangeNodeTypeManipulation.cs
r238 r324 96 96 // calculate the height and size difference and 97 97 // check if the size of the new tree is still in the allowed bounds 98 int oldChildSize = gardener.GetTreeSize(selectedChild);99 int oldChildHeight = gardener.GetTreeSize(selectedChild);100 int newChildSize = gardener.GetTreeSize(newFunctionTree);101 int newChildHeight = gardener.GetTreeHeight(newFunctionTree);98 int oldChildSize = selectedChild.Size; 99 int oldChildHeight = selectedChild.Height; 100 int newChildSize = newFunctionTree.Size; 101 int newChildHeight = newFunctionTree.Height; 102 102 if((treeHeight.Data - oldChildHeight) + newChildHeight > maxTreeHeight || 103 103 (treeSize.Data - oldChildSize) + newChildSize > maxTreeSize) { … … 118 118 // update size and height 119 119 treeSize.Data = (treeSize.Data - oldChildSize) + newChildSize; 120 treeHeight.Data = gardener.GetTreeHeight(root); // must recalculate height because we can't know wether the manipulated branch was the deepest branch120 treeHeight.Data = root.Height; // must recalculate height because we can't know wether the manipulated branch was the deepest branch 121 121 // check if whole tree is ok 122 122 Debug.Assert(gardener.IsValidTree(root));
Note: See TracChangeset
for help on using the changeset viewer.