Changeset 12438 for branches/HeuristicLab.DatasetRefactor/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/ArchitectureManipulators/ArgumentCreater.cs
- Timestamp:
- 06/12/15 15:35:16 (9 years ago)
- Location:
- branches/HeuristicLab.DatasetRefactor/sources
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.DatasetRefactor/sources
- Property svn:mergeinfo changed
/trunk/sources merged: 12262,12264,12273,12292-12293,12305,12315,12333,12358-12361,12365,12392-12393,12397-12401,12422,12424,12428-12435
- Property svn:mergeinfo changed
-
branches/HeuristicLab.DatasetRefactor/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding
- Property svn:mergeinfo changed
-
branches/HeuristicLab.DatasetRefactor/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/ArchitectureManipulators/ArgumentCreater.cs
r12031 r12438 28 28 using HeuristicLab.Parameters; 29 29 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 30 using HeuristicLab.Random; 30 31 31 32 namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding { … … 84 85 ISymbolicExpressionTree clonedTree = (ISymbolicExpressionTree)symbolicExpressionTree.Clone(); 85 86 86 var functionDefiningBranches = clonedTree.IterateNodesPrefix().OfType<DefunTreeNode>() ;87 if ( functionDefiningBranches.Count() == 0)87 var functionDefiningBranches = clonedTree.IterateNodesPrefix().OfType<DefunTreeNode>().ToList(); 88 if (!functionDefiningBranches.Any()) 88 89 // no function defining branch found => abort 89 90 return false; 90 91 91 92 // select a random function defining branch 92 var selectedDefunBranch = functionDefiningBranches.SelectRandom(random); 93 var selectedDefunBranch = functionDefiningBranches.SampleRandom(random); 94 93 95 var definedArguments = (from symbol in selectedDefunBranch.Grammar.Symbols.OfType<Argument>() 94 96 select symbol.ArgumentIndex).Distinct();
Note: See TracChangeset
for help on using the changeset viewer.