Changeset 7000 for branches/Benchmarking/sources/HeuristicLab.Tests/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4/FullTreeCreatorTest.cs
- Timestamp:
- 11/16/11 15:07:36 (12 years ago)
- Location:
- branches/Benchmarking
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/Benchmarking
- Property svn:mergeinfo changed
/trunk (added) merged: 6918-6919,6921-6923,6928-6930,6933,6935,6938-6939,6942,6944,6949-6954,6959,6961-6964,6974-6983,6985-6986,6993-6995,6997-6999
- Property svn:mergeinfo changed
-
branches/Benchmarking/sources
- Property svn:mergeinfo changed
/trunk/sources (added) merged: 6918-6919,6921-6923,6928-6930,6935,6938-6939,6942,6944,6949-6954,6959,6961-6964,6974-6983,6986,6993-6995,6997-6999
- Property svn:mergeinfo changed
-
branches/Benchmarking/sources/HeuristicLab.Tests
- Property svn:mergeinfo changed
/trunk/sources/HeuristicLab.Tests (added) merged: 6918-6919,6921-6923,6928,6930,6938,6944,6949,6962,6974,6994,6999
- Property svn:mergeinfo changed
-
branches/Benchmarking/sources/HeuristicLab.Tests/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4/FullTreeCreatorTest.cs
r6888 r7000 58 58 } 59 59 stopwatch.Stop(); 60 60 double msPerRandomTreeCreation = stopwatch.ElapsedMilliseconds / (double)POPULATION_SIZE; 61 int count = 0; 62 int depth = 0; 63 int maxLength = 0; 61 64 foreach (var tree in randomTrees) { 62 65 Util.IsValid(tree); 63 66 Assert.IsTrue(tree.Depth == MAX_TREE_DEPTH); 67 if (maxLength < tree.Length) 68 maxLength = tree.Length; 69 count += tree.Length; 70 depth += tree.Depth; 64 71 } 65 double msPerRandomTreeCreation = stopwatch.ElapsedMilliseconds / (double)POPULATION_SIZE;66 72 67 73 Console.WriteLine("FullTreeCreator: " + Environment.NewLine + 68 msPerRandomTreeCreation + " ms per random tree (~" + Math.Round(1000.0 / (msPerRandomTreeCreation)) + "random trees / s)" + Environment.NewLine + 69 Util.GetSizeDistributionString(randomTrees, 105, 5) + Environment.NewLine + 74 msPerRandomTreeCreation + " ms per random tree (~" + 75 Math.Round(1000.0 / (msPerRandomTreeCreation)) + "random trees / s)" + Environment.NewLine + 76 Util.GetSizeDistributionString(randomTrees, maxLength, 5) + Environment.NewLine + 70 77 Util.GetFunctionDistributionString(randomTrees) + Environment.NewLine + 71 78 Util.GetNumberOfSubtreesDistributionString(randomTrees) + Environment.NewLine + 72 Util.GetTerminalDistributionString(randomTrees) + Environment.NewLine 79 Util.GetTerminalDistributionString(randomTrees) + Environment.NewLine + 80 "Average tree depth: " + depth / POPULATION_SIZE + Environment.NewLine + 81 "Average tree length: " + count / POPULATION_SIZE + Environment.NewLine + 82 "Maximum tree length: " + maxLength + Environment.NewLine + 83 "Total nodes created: " + count + Environment.NewLine 73 84 ); 74 Assert.IsTrue(Math.Round(1000.0 / (msPerRandomTreeCreation)) > 300); // must achieve more than 500 random trees / s85 Assert.IsTrue(Math.Round(1000.0 / (msPerRandomTreeCreation)) > 300); // must achieve more than 300 random trees / s 75 86 } 76 87 }
Note: See TracChangeset
for help on using the changeset viewer.