Changeset 12482
- Timestamp:
- 06/19/15 15:10:55 (9 years ago)
- Location:
- trunk/sources/HeuristicLab.Tests
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Tests/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4/AllArchitectureAlteringOperatorsTest.cs
r12012 r12482 61 61 // manipulate 62 62 stopwatch.Start(); 63 var selectedTree = (ISymbolicExpressionTree)trees.S electRandom(random).Clone();63 var selectedTree = (ISymbolicExpressionTree)trees.SampleRandom(random).Clone(); 64 64 var oldTree = (ISymbolicExpressionTree)selectedTree.Clone(); 65 65 bool success = false; … … 83 83 SymbolicExpressionTree par1 = null; 84 84 do { 85 par0 = (SymbolicExpressionTree)trees.S electRandom(random).Clone();86 par1 = (SymbolicExpressionTree)trees.S electRandom(random).Clone();85 par0 = (SymbolicExpressionTree)trees.SampleRandom(random).Clone(); 86 par1 = (SymbolicExpressionTree)trees.SampleRandom(random).Clone(); 87 87 } while (par0.Length > MAX_TREE_LENGTH || par1.Length > MAX_TREE_LENGTH); 88 88 var newTree = SubtreeCrossover.Cross(random, par0, par1, 0.9, MAX_TREE_LENGTH, MAX_TREE_DEPTH); -
trunk/sources/HeuristicLab.Tests/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4/SubtreeCrossoverTest.cs
r12012 r12482 50 50 for (int gCount = 0; gCount < generations; gCount++) { 51 51 for (int i = 0; i < POPULATION_SIZE; i++) { 52 var par0 = (ISymbolicExpressionTree)trees.S electRandom(random).Clone();53 var par1 = (ISymbolicExpressionTree)trees.S electRandom(random).Clone();52 var par0 = (ISymbolicExpressionTree)trees.SampleRandom(random).Clone(); 53 var par1 = (ISymbolicExpressionTree)trees.SampleRandom(random).Clone(); 54 54 SubtreeCrossover.Cross(random, par0, par1, 0.9, 100, 10); 55 55 } -
trunk/sources/HeuristicLab.Tests/HeuristicLab.Problems.DataAnalysis.Symbolic-3.4/SymbolicDataAnalysisExpressionCrossoverTest.cs
r12012 r12482 125 125 stopwatch.Start(); 126 126 for (int i = 0; i != PopulationSize; ++i) { 127 var parent0 = (ISymbolicExpressionTree)trees.S electRandom(twister).Clone();127 var parent0 = (ISymbolicExpressionTree)trees.SampleRandom(twister).Clone(); 128 128 var scopeParent0 = new Scope(); 129 129 scopeParent0.Variables.Add(new Core.Variable(crossover.ParentsParameter.ActualName, parent0)); 130 130 context.Scope.SubScopes.Add(scopeParent0); 131 131 132 var parent1 = (ISymbolicExpressionTree)trees.S electRandom(twister).Clone();132 var parent1 = (ISymbolicExpressionTree)trees.SampleRandom(twister).Clone(); 133 133 var scopeParent1 = new Scope(); 134 134 scopeParent1.Variables.Add(new Core.Variable(crossover.ParentsParameter.ActualName, parent1)); -
trunk/sources/HeuristicLab.Tests/HeuristicLab.Problems.DataAnalysis.Symbolic-3.4/Util.cs
r12012 r12482 79 79 public static double CalculateEvaluatedNodesPerSec(ISymbolicExpressionTree[] trees, ISymbolicDataAnalysisExpressionTreeInterpreter interpreter, Dataset dataset, int repetitions) { 80 80 // warm up 81 IEnumerable<int> rows = Enumerable.Range(0, dataset.Rows) ;81 IEnumerable<int> rows = Enumerable.Range(0, dataset.Rows).ToList(); 82 82 long nNodes = 0; 83 83 double c = 0;
Note: See TracChangeset
for help on using the changeset viewer.