Changeset 12422 for trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/ArchitectureManipulators/SubroutineCreater.cs
- Timestamp:
- 06/10/15 11:29:34 (9 years ago)
- Location:
- trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding
-
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/ArchitectureManipulators/SubroutineCreater.cs
r12012 r12422 29 29 using HeuristicLab.Parameters; 30 30 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 31 using HeuristicLab.Random; 31 32 32 33 namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding { … … 113 114 from subtree in parent.Subtrees 114 115 select new CutPoint(parent, subtree)).ToList(); 115 if ( allCutPoints.Count() == 0)116 if (!allCutPoints.Any()) 116 117 // no cut points => abort 117 118 return false; 118 119 string newFunctionName = allowedFunctionNames.Except(functionDefiningBranches.Select(x => x.FunctionName)).First(); 119 var selectedCutPoint = allCutPoints.SelectRandom(random); 120 var selectedCutPoint = allCutPoints.SampleRandom(random); 121 120 122 // select random branches as argument cut-off points (replaced by argument terminal nodes in the function) 121 123 List<CutPoint> argumentCutPoints = SelectRandomArgumentBranches(selectedCutPoint.Child, random, ARGUMENT_CUTOFF_PROBABILITY, maxFunctionArguments);
Note: See TracChangeset
for help on using the changeset viewer.