Changeset 5411 for trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Tests/AllArchitectureAlteringOperatorsTest.cs
- Timestamp:
- 02/03/11 13:47:16 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Tests/AllArchitectureAlteringOperatorsTest.cs
r5367 r5411 80 80 bool success = false; 81 81 op.ModifyArchitecture(random, selectedTree, grammar, maxTreeSize, maxTreeHeigth, maxDefuns, maxArgs, out success); 82 if (!success) failedEvents++; 82 if (!success) failedEvents++; // architecture manipulation might fail 83 83 Util.IsValid(selectedTree); 84 84 newTrees.Add(selectedTree); … … 93 93 bool success; 94 94 newTrees.Add(SubtreeCrossover.Cross(random, par0, par1, 0.9, MAX_TREE_SIZE, MAX_TREE_HEIGHT, out success)); 95 Assert.IsTrue(success); 95 Assert.IsTrue(success); // crossover must succeed 96 96 } 97 97 } … … 102 102 Console.WriteLine("AllArchitectureAlteringOperators: " + Environment.NewLine + 103 103 "Operations / s: ~" + Math.Round(1000.0 / (msPerOperation)) + "operations / s)" + Environment.NewLine + 104 "Failed events: " + failedEvents / (double)(POPULATION_SIZE * N_ITERATIONS) + "%" + Environment.NewLine +104 "Failed events: " + failedEvents * 100.0 / (double)(POPULATION_SIZE * N_ITERATIONS * 2.0) + "%" + Environment.NewLine + 105 105 Util.GetSizeDistributionString(trees, 200, 5) + Environment.NewLine + 106 106 Util.GetFunctionDistributionString(trees) + Environment.NewLine + … … 108 108 Util.GetTerminalDistributionString(trees) + Environment.NewLine 109 109 ); 110 111 Assert.IsTrue(failedEvents * 100.0 / (POPULATION_SIZE * N_ITERATIONS * 2.0) < 25.0); // 75% of architecture operations must succeed 112 Assert.IsTrue(Math.Round(1000.0 / (msPerOperation)) > 1000); // must achieve more than 1000 ops per second 110 113 } 111 114 }
Note: See TracChangeset
for help on using the changeset viewer.