- Timestamp:
- 03/23/11 01:09:38 (14 years ago)
- Location:
- trunk/sources
- Files:
-
- 7 edited
- 95 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources
- Property svn:mergeinfo changed
-
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3
- Property svn:ignore
-
old new 3 3 obj 4 4 HeuristicLabEncodingsSymbolicExpressionTreeEncodingPlugin.cs 5 *.vs10x
-
- Property svn:ignore
-
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Analyzers/MinAverageMaxSymbolicExpressionTreeSizeAnalyzer.cs
r5445 r5809 29 29 using HeuristicLab.Parameters; 30 30 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 31 using HeuristicLab.PluginInfrastructure; 31 32 32 33 namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Analyzers { … … 36 37 [Item("MinAverageMaxSymbolicExpressionTreeSizeAnalyzer", "An operator that tracks the min avgerage and max tree size.")] 37 38 [StorableClass] 39 [NonDiscoverableType] 38 40 public sealed class MinAverageMaxSymbolicExpressionTreeSizeAnalyzer : AlgorithmOperator, ISymbolicExpressionTreeAnalyzer { 39 41 private const string SymbolicExpressionTreeParameterName = "SymbolicExpressionTree"; -
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Analyzers/SymbolicExpressionSymbolFrequencyAnalyzer.cs
r5445 r5809 30 30 using HeuristicLab.Parameters; 31 31 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 32 using HeuristicLab.PluginInfrastructure; 32 33 33 34 namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Analyzers { … … 37 38 [Item("SymbolicExpressionSymbolFrequencyAnalyzer", "An operator that tracks frequencies of symbols.")] 38 39 [StorableClass] 40 [NonDiscoverableType] 39 41 public class SymbolicExpressionSymbolFrequencyAnalyzer : SingleSuccessorOperator, ISymbolicExpressionTreeAnalyzer { 40 42 private const string SymbolicExpressionTreeParameterName = "SymbolicExpressionTree"; -
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Analyzers/SymbolicExpressionTreeSizeCalculator.cs
r5445 r5809 26 26 using HeuristicLab.Parameters; 27 27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 28 using HeuristicLab.PluginInfrastructure; 28 29 29 30 namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Analyzers { … … 33 34 [Item("SymbolicExpressionTreeSizeCalculator", "An operator that outputs the tree size of a symbolic expression tree.")] 34 35 [StorableClass] 36 [NonDiscoverableType] 35 37 public sealed class SymbolicExpressionTreeSizeCalculator : SingleSuccessorOperator { 36 38 private const string SymbolicExpressionTreeParameterName = "SymbolicExpressionTree"; -
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Tests
- Property svn:ignore
-
old new 2 2 obj 3 3 *.user 4 *.vs10x
-
- Property svn:ignore
-
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/Tests/ProbabilisticTreeCreaterTest.cs
r5445 r5809 22 22 using System; 23 23 using System.Collections.Generic; 24 using System.Diagnostics; 24 25 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 25 26 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Creators; … … 30 31 [TestClass] 31 32 public class ProbabilisticTreeCreaterTest { 32 private const int POPULATION_SIZE = 1000 ;33 private const int POPULATION_SIZE = 10000; 33 34 private const int MAX_TREE_SIZE = 100; 34 35 private const int MAX_TREE_HEIGHT = 10; … … 53 54 var grammar = Grammars.CreateSimpleArithmeticGrammar(); 54 55 var random = new MersenneTwister(31415); 56 var stopwatch = new Stopwatch(); 57 stopwatch.Start(); 55 58 for (int i = 0; i < POPULATION_SIZE; i++) { 56 59 randomTrees.Add(ProbabilisticTreeCreator.Create(random, grammar, MAX_TREE_SIZE, MAX_TREE_HEIGHT, 0, 0)); 57 60 } 61 stopwatch.Stop(); 58 62 59 63 foreach (var tree in randomTrees) { 60 64 Util.IsValid(tree); 61 65 } 66 double msPerRandomTreeCreation = stopwatch.ElapsedMilliseconds / (double)POPULATION_SIZE; 67 62 68 Console.WriteLine("ProbabilisticTreeCreator: " + Environment.NewLine + 69 msPerRandomTreeCreation + " ms per random tree (~" + Math.Round(1000.0 / (msPerRandomTreeCreation)) + "random trees / s)" + Environment.NewLine + 63 70 Util.GetSizeDistributionString(randomTrees, 105, 5) + Environment.NewLine + 64 71 Util.GetFunctionDistributionString(randomTrees) + Environment.NewLine + … … 66 73 Util.GetTerminalDistributionString(randomTrees) + Environment.NewLine 67 74 ); 75 Assert.IsTrue(Math.Round(1000.0 / (msPerRandomTreeCreation)) > 2000); // must achieve more than 2000 random trees / s 68 76 } 69 77 … … 74 82 var grammar = Grammars.CreateArithmeticAndAdfGrammar(); 75 83 var random = new MersenneTwister(31415); 84 var stopwatch = new Stopwatch(); 85 stopwatch.Start(); 76 86 for (int i = 0; i < POPULATION_SIZE; i++) { 77 var tree = ProbabilisticTreeCreator.Create(random, grammar, MAX_TREE_SIZE, MAX_TREE_HEIGHT, 3, 3); 87 randomTrees.Add(ProbabilisticTreeCreator.Create(random, grammar, MAX_TREE_SIZE, MAX_TREE_HEIGHT, 3, 3)); 88 } 89 stopwatch.Stop(); 90 foreach (var tree in randomTrees) 78 91 Util.IsValid(tree); 79 randomTrees.Add(tree); 80 } 92 93 double msPerRandomTreeCreation = stopwatch.ElapsedMilliseconds / (double)POPULATION_SIZE; 94 81 95 Console.WriteLine("ProbabilisticTreeCreator: " + Environment.NewLine + 96 msPerRandomTreeCreation + " ms per random tree (~" + Math.Round(1000.0 / (msPerRandomTreeCreation)) + "random trees / s)" + Environment.NewLine + 82 97 Util.GetSizeDistributionString(randomTrees, 105, 5) + Environment.NewLine + 83 98 Util.GetFunctionDistributionString(randomTrees) + Environment.NewLine + … … 85 100 Util.GetTerminalDistributionString(randomTrees) + Environment.NewLine 86 101 ); 102 103 Assert.IsTrue(Math.Round(1000.0 / (msPerRandomTreeCreation)) > 2000); // must achieve more than 2000 random trees / s 87 104 } 88 105 }
Note: See TracChangeset
for help on using the changeset viewer.