- Timestamp:
- 04/26/10 16:16:49 (15 years ago)
- Location:
- trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/ArchitectureAlteringOperators/SubroutineDeleter.cs
r3534 r3535 102 102 int maxHeight = Math.Max(minPossibleHeight, invocationCutPoint.ReplacedChild.GetHeight()); 103 103 replacementTree = selectedSymbol.CreateTreeNode(); 104 if (replacementTree.HasLocalParameters) 105 replacementTree.ResetLocalParameters(random); 104 106 invocationCutPoint.Parent.RemoveSubTree(invocationCutPoint.ReplacedChildIndex); 105 107 invocationCutPoint.Parent.InsertSubTree(invocationCutPoint.ReplacedChildIndex, replacementTree); -
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Manipulators/OnePointShaker.cs
r3512 r3535 37 37 38 38 protected override void Manipulate(IRandom random, SymbolicExpressionTree symbolicExpressionTree, ISymbolicExpressionGrammar grammar, IntValue maxTreeSize, IntValue maxTreeHeight, out bool success) { 39 var parametricNodes = from node in symbolicExpressionTree.IterateNodesPrefix() 40 where node.HasLocalParameters 41 select node; 42 if (parametricNodes.Count() > 0) { 43 SymbolicExpressionTreeNode selectedPoint = parametricNodes.SelectRandom(random); 39 44 40 SymbolicExpressionTreeNode selectedPoint = (from node in symbolicExpressionTree.IterateNodesPrefix() 41 where node.HasLocalParameters 42 select node).SelectRandom(random); 43 44 selectedPoint.ShakeLocalParameters(random, 1.0); 45 success = true; 45 selectedPoint.ShakeLocalParameters(random, 1.0); 46 success = true; 47 } else { 48 success = false; 49 } 46 50 } 47 51 }
Note: See TracChangeset
for help on using the changeset viewer.