Changeset 3873 for branches/3.2/sources/HeuristicLab.GP.Operators
- Timestamp:
- 05/31/10 08:31:29 (15 years ago)
- Location:
- branches/3.2/sources/HeuristicLab.GP.Operators/3.3/Manipulation
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.2/sources/HeuristicLab.GP.Operators/3.3/Manipulation/ChangeNodeTypeManipulation.cs
r3823 r3873 93 93 parent.InsertSubTree(selectedChildIndex, newFunctionTree); 94 94 } 95 // update size and height96 gpModel.Size = gpModel.Size - oldChildSize + newChildSize;97 gpModel.Height = gpModel.FunctionTree.GetHeight(); // must recalculate height because we can't know wether the manipulated branch was the deepest branch98 95 // check if whole tree is ok 99 96 Debug.Assert(gardener.IsValidTree(gpModel.FunctionTree)); -
branches/3.2/sources/HeuristicLab.GP.Operators/3.3/Manipulation/CutOutNodeManipulation.cs
r2222 r3873 84 84 parent.InsertSubTree(childIndex, selectedChild); 85 85 Debug.Assert(gardener.IsValidTree(gpModel.FunctionTree)); 86 // recalculate the size and height of our tree87 gpModel.Size = gpModel.FunctionTree.GetSize();88 gpModel.Height = gpModel.FunctionTree.GetHeight();89 86 // don't need to schedule initialization operations 90 87 return null; … … 101 98 parent.InsertSubTree(childIndex, newFunctionTree); 102 99 Debug.Assert(gardener.IsValidTree(gpModel.FunctionTree)); 103 // recalculate size and height104 gpModel.Size = gpModel.FunctionTree.GetSize();105 gpModel.Height = gpModel.FunctionTree.GetHeight();106 100 // schedule an initialization operation for the new function-tree 107 101 return Util.CreateInitializationOperation(TreeGardener.GetAllSubTrees(newFunctionTree), scope); -
branches/3.2/sources/HeuristicLab.GP.Operators/3.3/Manipulation/DeleteSubTreeManipulation.cs
r2222 r3873 65 65 66 66 Debug.Assert(gardener.IsValidTree(gpModel.FunctionTree)); 67 // recalculate size and height68 gpModel.Size = gpModel.FunctionTree.GetSize();69 gpModel.Height = gpModel.FunctionTree.GetHeight();70 67 // root hasn't changed so don't need to update 'FunctionTree' variable 71 68 return null; … … 77 74 parent.InsertSubTree(childIndex, newFunctionTree); 78 75 Debug.Assert(gardener.IsValidTree(gpModel.FunctionTree)); 79 // recalculate size and height80 gpModel.Size = gpModel.FunctionTree.GetSize();81 gpModel.Height = gpModel.FunctionTree.GetHeight();82 76 // return an initialization operation for the newly created tree 83 77 return Util.CreateInitializationOperation(TreeGardener.GetAllSubTrees(newFunctionTree), scope); -
branches/3.2/sources/HeuristicLab.GP.Operators/3.3/Manipulation/SubstituteSubTreeManipulation.cs
r2222 r3873 73 73 74 74 Debug.Assert(gardener.IsValidTree(gpModel.FunctionTree)); 75 // update the values of treeSize and treeHeight76 gpModel.Size = gpModel.FunctionTree.GetSize();77 gpModel.Height = gpModel.FunctionTree.GetHeight();78 75 // the root hasn't changed so we don't need to update 79 76 // return a CompositeOperation that randomly initializes all nodes of the new subtree
Note: See TracChangeset
for help on using the changeset viewer.