Changeset 7926
- Timestamp:
- 05/29/12 16:08:52 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Tests/HeuristicLab.Problems.DataAnalysis.Symbolic-3.4/SymbolicDataAnalysisExpressionTreeInterpreterTest.cs
r7915 r7926 25 25 using System.Linq; 26 26 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 27 using HeuristicLab.Problems.DataAnalysis.Symbolic; 27 28 using HeuristicLab.Random; 28 29 using Microsoft.VisualStudio.TestTools.UnitTesting; 29 using HeuristicLab.Problems.DataAnalysis.Symbolic;30 30 namespace HeuristicLab.Problems.DataAnalysis.Symbolic_34.Tests { 31 31 … … 52 52 53 53 [TestMethod] 54 public void SymbolicDataAnalysisExpressionTreeInterpreterTypeCoherentGrammarPerformanceTest() { 55 TypeCoherentGrammarPerformanceTest(new SymbolicDataAnalysisExpressionTreeInterpreter(), 12.5e6); 56 } 57 [TestMethod] 54 58 public void SymbolicDataAnalysisExpressionTreeInterpreterFullGrammarPerformanceTest() { 55 59 FullGrammarPerformanceTest(new SymbolicDataAnalysisExpressionTreeInterpreter(), 12.5e6); … … 61 65 62 66 [TestMethod] 67 public void SymbolicDataAnalysisExpressionTreeILEmittingInterpreterTypeCoherentGrammarPerformanceTest() { 68 TypeCoherentGrammarPerformanceTest(new SymbolicDataAnalysisExpressionTreeILEmittingInterpreter(), 7.5e6); 69 } 70 [TestMethod] 63 71 public void SymbolicDataAnalysisExpressionTreeILEmittingInterpreterFullGrammarPerformanceTest() { 64 72 FullGrammarPerformanceTest(new SymbolicDataAnalysisExpressionTreeILEmittingInterpreter(), 7.5e6); … … 67 75 public void SymbolicDataAnalysisExpressionTreeILEmittingInterpreterArithmeticGrammarPerformanceTest() { 68 76 ArithmeticGrammarPerformanceTest(new SymbolicDataAnalysisExpressionTreeILEmittingInterpreter(), 7.5e6); 77 } 78 79 private void TypeCoherentGrammarPerformanceTest(ISymbolicDataAnalysisExpressionTreeInterpreter interpreter, double nodesPerSecThreshold) { 80 var twister = new MersenneTwister(31415); 81 var dataset = Util.CreateRandomDataset(twister, Rows, Columns); 82 var grammar = new TypeCoherentExpressionGrammar(); 83 grammar.ConfigureAsDefaultRegressionGrammar(); 84 grammar.MaximumFunctionArguments = 0; 85 grammar.MaximumFunctionDefinitions = 0; 86 grammar.MinimumFunctionArguments = 0; 87 grammar.MinimumFunctionDefinitions = 0; 88 var randomTrees = Util.CreateRandomTrees(twister, dataset, grammar, N, 1, 100, 0, 0); 89 foreach (ISymbolicExpressionTree tree in randomTrees) { 90 Util.InitTree(tree, twister, new List<string>(dataset.VariableNames)); 91 } 92 double nodesPerSec = Util.CalculateEvaluatedNodesPerSec(randomTrees, interpreter, dataset, 3); 93 Assert.IsTrue(nodesPerSec > nodesPerSecThreshold); // evaluated nodes per seconds must be larger than 15mNodes/sec 69 94 } 70 95
Note: See TracChangeset
for help on using the changeset viewer.