- Timestamp:
- 11/04/11 14:57:32 (13 years ago)
- Location:
- trunk/sources/HeuristicLab.Tests/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Tests/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4/FullTreeCreatorTest.cs
r6944 r6949 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 85 Assert.IsTrue(Math.Round(1000.0 / (msPerRandomTreeCreation)) > 300); // must achieve more than 300 random trees / s -
trunk/sources/HeuristicLab.Tests/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4/GrowTreeCreatorTest.cs
r6944 r6949 59 59 stopwatch.Stop(); 60 60 61 int count = 0; 62 int depth = 0; 63 int maxLength = 0; 61 64 foreach (var tree in randomTrees) { 62 65 Util.IsValid(tree); 66 if (maxLength < tree.Length) 67 maxLength = tree.Length; 68 count += tree.Length; 69 depth += tree.Depth; 63 70 } 71 64 72 double msPerRandomTreeCreation = stopwatch.ElapsedMilliseconds / (double)POPULATION_SIZE; 65 73 66 74 Console.WriteLine("GrowTreeCreator: " + Environment.NewLine + 67 75 msPerRandomTreeCreation + " ms per random tree (~" + Math.Round(1000.0 / (msPerRandomTreeCreation)) + "random trees / s)" + Environment.NewLine + 68 Util.GetSizeDistributionString(randomTrees, 105, 5) + Environment.NewLine +76 Util.GetSizeDistributionString(randomTrees, maxLength, 5) + Environment.NewLine + 69 77 Util.GetFunctionDistributionString(randomTrees) + Environment.NewLine + 70 78 Util.GetNumberOfSubtreesDistributionString(randomTrees) + Environment.NewLine + 71 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 "Total nodes created: " + count + Environment.NewLine 72 83 ); 73 84 Assert.IsTrue(Math.Round(1000.0 / (msPerRandomTreeCreation)) > 300); // must achieve more than 300 random trees / s -
trunk/sources/HeuristicLab.Tests/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4/ProbabilisticTreeCreaterTest.cs
r6911 r6949 60 60 stopwatch.Stop(); 61 61 62 int count = 0; 63 int depth = 0; 62 64 foreach (var tree in randomTrees) { 63 65 Util.IsValid(tree); 66 count += tree.Length; 67 depth += tree.Depth; 64 68 } 65 69 double msPerRandomTreeCreation = stopwatch.ElapsedMilliseconds / (double)POPULATION_SIZE; … … 70 74 Util.GetFunctionDistributionString(randomTrees) + Environment.NewLine + 71 75 Util.GetNumberOfSubtreesDistributionString(randomTrees) + Environment.NewLine + 72 Util.GetTerminalDistributionString(randomTrees) + Environment.NewLine 76 Util.GetTerminalDistributionString(randomTrees) + Environment.NewLine + 77 "Average tree depth: " + depth / POPULATION_SIZE + Environment.NewLine + 78 "Average tree length: " + count / POPULATION_SIZE + Environment.NewLine + 79 "Total nodes created: " + count + Environment.NewLine 73 80 ); 74 81 Assert.IsTrue(Math.Round(1000.0 / (msPerRandomTreeCreation)) > 250); // must achieve more than 250 random trees / s
Note: See TracChangeset
for help on using the changeset viewer.