Changeset 3535 for trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Manipulators
- Timestamp:
- 04/26/10 16:16:49 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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.