Changeset 4189 for trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Manipulators
- Timestamp:
- 08/11/10 11:06:51 (14 years ago)
- Location:
- trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Manipulators
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Manipulators/ChangeNodeTypeManipulation.cs
r4068 r4189 30 30 namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Manipulators { 31 31 [StorableClass] 32 [Item("ChangeNodeTypeManipulation", "Selects a random tree node and changes the symbol size.")]32 [Item("ChangeNodeTypeManipulation", "Selects a random tree node and changes the symbol.")] 33 33 public class ChangeNodeTypeManipulation : SymbolicExpressionTreeManipulator { 34 34 … … 38 38 39 39 protected override void Manipulate(IRandom random, SymbolicExpressionTree symbolicExpressionTree, ISymbolicExpressionGrammar grammar, IntValue maxTreeSize, IntValue maxTreeHeight, out bool success) { 40 ChangeNodeType(random, symbolicExpressionTree, grammar, maxTreeSize.Value, maxTreeHeight.Value, out success); 41 } 40 42 41 // select any node except the with a parent where the parent is not the root node) 43 public static void ChangeNodeType(IRandom random, SymbolicExpressionTree symbolicExpressionTree, ISymbolicExpressionGrammar grammar, int maxTreeSize, int maxTreeHeight, out bool success) { 44 45 // select any node as parent (except the root node) 42 46 var manipulationPoint = (from parent in symbolicExpressionTree.Root.IterateNodesPrefix().Skip(1) 43 47 from subtree in parent.SubTrees
Note: See TracChangeset
for help on using the changeset viewer.