Changeset 3369 for trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/ArchitectureAlteringOperators/SubroutineDeleter.cs
- Timestamp:
- 04/16/10 12:12:29 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/ArchitectureAlteringOperators/SubroutineDeleter.cs
r3360 r3369 68 68 69 69 // remove references to deleted function 70 foreach (var subtree in symbolicExpressionTree.Root.SubTrees ) {70 foreach (var subtree in symbolicExpressionTree.Root.SubTrees.OfType<SymbolicExpressionTreeTopLevelNode>()) { 71 71 var matchingInvokeSymbol = (from symb in subtree.Grammar.Symbols.OfType<InvokeFunction>() 72 72 where symb.FunctionName == selectedDefunBranch.FunctionName … … 99 99 int minPossibleHeight = invocationCutPoint.Parent.Grammar.GetMinExpressionDepth(selectedSymbol); 100 100 int maxHeight = Math.Max(minPossibleHeight, invocationCutPoint.ReplacedChild.GetHeight()); 101 102 replacementTree = ProbabilisticTreeCreator.PTC2(random, invocationCutPoint.Parent.Grammar, selectedSymbol, maxSize, maxHeight, 0, 0); 101 replacementTree = selectedSymbol.CreateTreeNode(); 103 102 invocationCutPoint.Parent.RemoveSubTree(invocationCutPoint.ReplacedChildIndex); 104 103 invocationCutPoint.Parent.InsertSubTree(invocationCutPoint.ReplacedChildIndex, replacementTree); 104 105 ProbabilisticTreeCreator.PTC2(random, replacementTree, maxSize, maxHeight, 0, 0); 105 106 106 107 invocationCutPoint = (from node in symbolicExpressionTree.IterateNodesPrefix()
Note: See TracChangeset
for help on using the changeset viewer.