- Timestamp:
- 07/31/13 14:47:13 (11 years ago)
- Location:
- trunk/sources
- Files:
-
- 11 edited
- 4 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding
- Property svn:mergeinfo changed
/branches/HeuristicLab.DataAnalysis.Symbolic.LinearInterpreter/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding (added) merged: 9271,9290,9732,9734,9738-9739,9758,9776,9815,9826
- Property svn:mergeinfo changed
-
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Compiler/Instruction.cs
r9456 r9828 31 31 public byte nArguments; 32 32 // an optional object value (addresses for calls, argument index for arguments) 33 public object iArg0;33 public object data; 34 34 } 35 35 } -
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Compiler/SymbolicExpressionTreeCompiler.cs
r9456 r9828 52 52 if (instr.dynamicNode.Symbol is InvokeFunction) { 53 53 var invokeNode = (InvokeFunctionTreeNode)instr.dynamicNode; 54 instr. iArg0= entryPoint[invokeNode.Symbol.FunctionName];54 instr.data = entryPoint[invokeNode.Symbol.FunctionName]; 55 55 } 56 56 } … … 68 68 if (node.Symbol is Argument) { 69 69 var argNode = (ArgumentTreeNode)node; 70 instr. iArg0= (ushort)argNode.Symbol.ArgumentIndex;70 instr.data = (ushort)argNode.Symbol.ArgumentIndex; 71 71 } 72 72 instr.dynamicNode = node; -
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4.csproj
r9649 r9828 124 124 <Compile Include="ArchitectureManipulators\SymbolicExpressionTreeArchitectureManipulator.cs" /> 125 125 <Compile Include="Compiler\Instruction.cs" /> 126 <Compile Include="Compiler\LinearInstruction.cs" /> 126 127 <Compile Include="Compiler\SymbolicExpressionTreeCompiler.cs" /> 128 <Compile Include="Compiler\SymbolicExpressionTreeLinearCompiler.cs" /> 127 129 <Compile Include="Creators\FullTreeCreator.cs"> 128 130 <SubType>Code</SubType> -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic
-
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.TimeSeriesPrognosis/3.4/SymbolicTimeSeriesPrognosisExpressionTreeInterpreter.cs
r9462 r9828 123 123 var variableTreeNode = (VariableTreeNode)instr.dynamicNode; 124 124 if (variableTreeNode.VariableName == targetVariable) 125 instr. iArg0= targetVariableCache;125 instr.data = targetVariableCache; 126 126 else 127 instr. iArg0= dataset.GetReadOnlyDoubleValues(variableTreeNode.VariableName);127 instr.data = dataset.GetReadOnlyDoubleValues(variableTreeNode.VariableName); 128 128 } else if (instr.opCode == OpCodes.LagVariable) { 129 129 var variableTreeNode = (LaggedVariableTreeNode)instr.dynamicNode; 130 130 if (variableTreeNode.VariableName == targetVariable) 131 instr. iArg0= targetVariableCache;131 instr.data = targetVariableCache; 132 132 else 133 instr. iArg0= dataset.GetReadOnlyDoubleValues(variableTreeNode.VariableName);133 instr.data = dataset.GetReadOnlyDoubleValues(variableTreeNode.VariableName); 134 134 } else if (instr.opCode == OpCodes.VariableCondition) { 135 135 var variableTreeNode = (VariableConditionTreeNode)instr.dynamicNode; 136 136 if (variableTreeNode.VariableName == targetVariable) 137 instr. iArg0= targetVariableCache;137 instr.data = targetVariableCache; 138 138 else 139 instr. iArg0= dataset.GetReadOnlyDoubleValues(variableTreeNode.VariableName);139 instr.data = dataset.GetReadOnlyDoubleValues(variableTreeNode.VariableName); 140 140 } else if (instr.opCode == OpCodes.Call) { 141 141 necessaryArgStackSize += instr.nArguments + 1; -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.csproj
r9821 r9828 147 147 <Compile Include="Interpreter\SymbolicDataAnalysisExpressionTreeILEmittingInterpreter.cs" /> 148 148 <Compile Include="Interpreter\SymbolicDataAnalysisExpressionTreeInterpreter.cs" /> 149 <Compile Include="Interpreter\SymbolicDataAnalysisExpressionTreeLinearInterpreter.cs" /> 149 150 <Compile Include="Plugin.cs" /> 150 151 <Compile Include="Formatters\SymbolicDataAnalysisExpressionLatexFormatter.cs" /> -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeILEmittingInterpreter.cs
r9456 r9828 168 168 if (instr.opCode == OpCodes.Variable) { 169 169 var variableTreeNode = (VariableTreeNode)instr.dynamicNode; 170 instr. iArg0= doubleVariableNames[variableTreeNode.VariableName];170 instr.data = doubleVariableNames[variableTreeNode.VariableName]; 171 171 } else if (instr.opCode == OpCodes.LagVariable) { 172 172 var laggedVariableTreeNode = (LaggedVariableTreeNode)instr.dynamicNode; 173 instr. iArg0= doubleVariableNames[laggedVariableTreeNode.VariableName];173 instr.data = doubleVariableNames[laggedVariableTreeNode.VariableName]; 174 174 } else if (instr.opCode == OpCodes.VariableCondition) { 175 175 var variableConditionTreeNode = (VariableConditionTreeNode)instr.dynamicNode; 176 instr. iArg0= doubleVariableNames[variableConditionTreeNode.VariableName];176 instr.data = doubleVariableNames[variableConditionTreeNode.VariableName]; 177 177 } else if (instr.opCode == OpCodes.Call) { 178 178 necessaryArgStackSize += instr.nArguments + 1; … … 566 566 VariableTreeNode varNode = (VariableTreeNode)currentInstr.dynamicNode; 567 567 il.Emit(System.Reflection.Emit.OpCodes.Ldarg_1); // load columns array 568 il.Emit(System.Reflection.Emit.OpCodes.Ldc_I4, (int)currentInstr. iArg0);568 il.Emit(System.Reflection.Emit.OpCodes.Ldc_I4, (int)currentInstr.data); 569 569 // load correct column of the current variable 570 570 il.Emit(System.Reflection.Emit.OpCodes.Ldelem_Ref); … … 600 600 LaggedVariableTreeNode varNode = (LaggedVariableTreeNode)currentInstr.dynamicNode; 601 601 il.Emit(System.Reflection.Emit.OpCodes.Ldarg_1); // load columns array 602 il.Emit(System.Reflection.Emit.OpCodes.Ldc_I4, (int)currentInstr. iArg0);602 il.Emit(System.Reflection.Emit.OpCodes.Ldc_I4, (int)currentInstr.data); 603 603 // load correct column of the current variable 604 604 il.Emit(System.Reflection.Emit.OpCodes.Ldelem_Ref); -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeInterpreter.cs
r9456 r9828 117 117 if (instr.opCode == OpCodes.Variable) { 118 118 var variableTreeNode = (VariableTreeNode)instr.dynamicNode; 119 instr. iArg0= dataset.GetReadOnlyDoubleValues(variableTreeNode.VariableName);119 instr.data = dataset.GetReadOnlyDoubleValues(variableTreeNode.VariableName); 120 120 } else if (instr.opCode == OpCodes.LagVariable) { 121 121 var laggedVariableTreeNode = (LaggedVariableTreeNode)instr.dynamicNode; 122 instr. iArg0= dataset.GetReadOnlyDoubleValues(laggedVariableTreeNode.VariableName);122 instr.data = dataset.GetReadOnlyDoubleValues(laggedVariableTreeNode.VariableName); 123 123 } else if (instr.opCode == OpCodes.VariableCondition) { 124 124 var variableConditionTreeNode = (VariableConditionTreeNode)instr.dynamicNode; 125 instr. iArg0= dataset.GetReadOnlyDoubleValues(variableConditionTreeNode.VariableName);125 instr.data = dataset.GetReadOnlyDoubleValues(variableConditionTreeNode.VariableName); 126 126 } else if (instr.opCode == OpCodes.Call) { 127 127 necessaryArgStackSize += instr.nArguments + 1; … … 132 132 133 133 134 p rotectedvirtual double Evaluate(Dataset dataset, ref int row, InterpreterState state) {134 public virtual double Evaluate(Dataset dataset, ref int row, InterpreterState state) { 135 135 Instruction currentInstr = state.NextInstruction(); 136 136 switch (currentInstr.opCode) { … … 406 406 int savedPc = state.ProgramCounter; 407 407 // set pc to start of function 408 state.ProgramCounter = (ushort)currentInstr. iArg0;408 state.ProgramCounter = (ushort)currentInstr.data; 409 409 // evaluate the function 410 410 double v = Evaluate(dataset, ref row, state); … … 418 418 } 419 419 case OpCodes.Arg: { 420 return state.GetStackFrameValue((ushort)currentInstr. iArg0);420 return state.GetStackFrameValue((ushort)currentInstr.data); 421 421 } 422 422 case OpCodes.Variable: { 423 423 if (row < 0 || row >= dataset.Rows) return double.NaN; 424 424 var variableTreeNode = (VariableTreeNode)currentInstr.dynamicNode; 425 return ((IList<double>)currentInstr. iArg0)[row] * variableTreeNode.Weight;425 return ((IList<double>)currentInstr.data)[row] * variableTreeNode.Weight; 426 426 } 427 427 case OpCodes.LagVariable: { … … 429 429 int actualRow = row + laggedVariableTreeNode.Lag; 430 430 if (actualRow < 0 || actualRow >= dataset.Rows) return double.NaN; 431 return ((IList<double>)currentInstr. iArg0)[actualRow] * laggedVariableTreeNode.Weight;431 return ((IList<double>)currentInstr.data)[actualRow] * laggedVariableTreeNode.Weight; 432 432 } 433 433 case OpCodes.Constant: { … … 441 441 if (row < 0 || row >= dataset.Rows) return double.NaN; 442 442 var variableConditionTreeNode = (VariableConditionTreeNode)currentInstr.dynamicNode; 443 double variableValue = ((IList<double>)currentInstr. iArg0)[row];443 double variableValue = ((IList<double>)currentInstr.data)[row]; 444 444 double x = variableValue - variableConditionTreeNode.Threshold; 445 445 double p = 1 / (1 + Math.Exp(-variableConditionTreeNode.Slope * x)); -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeLinearInterpreter.cs
r9826 r9828 73 73 } 74 74 75 private SymbolicDataAnalysisExpressionTreeLinearInterpreter( 76 SymbolicDataAnalysisExpressionTreeLinearInterpreter original, Cloner cloner) 75 private SymbolicDataAnalysisExpressionTreeLinearInterpreter(SymbolicDataAnalysisExpressionTreeLinearInterpreter original, Cloner cloner) 77 76 : base(original, cloner) { 78 interpreter = original.interpreter;77 interpreter = cloner.Clone(original.interpreter); 79 78 } 80 79 … … 90 89 } 91 90 92 private SymbolicDataAnalysisExpressionTreeLinearInterpreter(string name, string description)93 : base(name, description) {94 Parameters.Add(new ValueParameter<BoolValue>(CheckExpressionsWithIntervalArithmeticParameterName, "Switch that determines if the interpreter checks the validity of expressions with interval arithmetic before evaluating the expression.", new BoolValue(false)));95 Parameters.Add(new ValueParameter<IntValue>(EvaluatedSolutionsParameterName, "A counter for the total number of solutions the interpreter has evaluated", new IntValue(0)));96 interpreter = new SymbolicDataAnalysisExpressionTreeInterpreter();97 }98 99 91 [StorableHook(HookType.AfterDeserialization)] 100 92 private void AfterDeserialization() { 101 if (!Parameters.ContainsKey(EvaluatedSolutionsParameterName))102 Parameters.Add(new ValueParameter<IntValue>(EvaluatedSolutionsParameterName, "A counter for the total number of solutions the interpreter has evaluated", new IntValue(0)));103 93 if (interpreter == null) interpreter = new SymbolicDataAnalysisExpressionTreeInterpreter(); 104 94 } 105 95 106 96 #region IStatefulItem 107 108 97 public void InitializeState() { 109 98 EvaluatedSolutions.Value = 0; 110 99 } 111 100 112 public void ClearState() { 113 } 114 101 public void ClearState() { } 115 102 #endregion 116 103 -
trunk/sources/HeuristicLab.Tests/HeuristicLab.Problems.DataAnalysis.Symbolic-3.4/SymbolicDataAnalysisExpressionTreeInterpreterTest.cs
r9785 r9828 30 30 31 31 32 [TestClass ()]32 [TestClass] 33 33 public class SymbolicDataAnalysisExpressionTreeInterpreterTest { 34 34 private const int N = 1000; 35 35 private const int Rows = 1000; 36 36 private const int Columns = 50; 37 private TestContext testContextInstance; 38 39 /// <summary> 40 ///Gets or sets the test context which provides 41 ///information about and functionality for the current test run. 42 ///</summary> 43 public TestContext TestContext { 44 get { 45 return testContextInstance; 46 } 47 set { 48 testContextInstance = value; 49 } 50 } 51 52 [TestMethod] 53 [TestCategory("Problems.DataAnalysis")] 54 [TestProperty("Time", "long")] 55 public void SymbolicDataAnalysisExpressionTreeInterpreterTypeCoherentGrammarPerformanceTest() { 56 TypeCoherentGrammarPerformanceTest(new SymbolicDataAnalysisExpressionTreeInterpreter(), 12.5e6); 57 } 58 59 [TestMethod] 60 [TestCategory("Problems.DataAnalysis")] 61 [TestProperty("Time", "long")] 62 public void SymbolicDataAnalysisExpressionTreeInterpreterFullGrammarPerformanceTest() { 63 FullGrammarPerformanceTest(new SymbolicDataAnalysisExpressionTreeInterpreter(), 12.5e6); 64 } 65 66 [TestMethod] 67 [TestCategory("Problems.DataAnalysis")] 68 [TestProperty("Time", "long")] 69 public void SymbolicDataAnalysisExpressionTreeInterpreterArithmeticGrammarPerformanceTest() { 70 ArithmeticGrammarPerformanceTest(new SymbolicDataAnalysisExpressionTreeInterpreter(), 12.5e6); 71 } 72 73 [TestMethod] 74 [TestCategory("Problems.DataAnalysis")] 75 [TestProperty("Time", "long")] 76 public void SymbolicDataAnalysisExpressionTreeILEmittingInterpreterTypeCoherentGrammarPerformanceTest() { 77 TypeCoherentGrammarPerformanceTest(new SymbolicDataAnalysisExpressionTreeILEmittingInterpreter(), 7.5e6); 78 } 79 80 [TestMethod] 81 [TestCategory("Problems.DataAnalysis")] 82 [TestProperty("Time", "long")] 83 public void SymbolicDataAnalysisExpressionTreeILEmittingInterpreterFullGrammarPerformanceTest() { 84 FullGrammarPerformanceTest(new SymbolicDataAnalysisExpressionTreeILEmittingInterpreter(), 7.5e6); 85 } 86 87 [TestCategory("Problems.DataAnalysis")] 88 [TestProperty("Time", "long")] 89 [TestMethod] 90 public void SymbolicDataAnalysisExpressionTreeILEmittingInterpreterArithmeticGrammarPerformanceTest() { 91 ArithmeticGrammarPerformanceTest(new SymbolicDataAnalysisExpressionTreeILEmittingInterpreter(), 7.5e6); 92 } 93 94 private void TypeCoherentGrammarPerformanceTest(ISymbolicDataAnalysisExpressionTreeInterpreter interpreter, double nodesPerSecThreshold) { 37 38 private static Dataset ds = new Dataset(new string[] { "Y", "A", "B" }, new double[,] { 39 { 1.0, 1.0, 1.0 }, 40 { 2.0, 2.0, 2.0 }, 41 { 3.0, 1.0, 2.0 }, 42 { 4.0, 1.0, 1.0 }, 43 { 5.0, 2.0, 2.0 }, 44 { 6.0, 1.0, 2.0 }, 45 { 7.0, 1.0, 1.0 }, 46 { 8.0, 2.0, 2.0 }, 47 { 9.0, 1.0, 2.0 }, 48 { 10.0, 1.0, 1.0 }, 49 { 11.0, 2.0, 2.0 }, 50 { 12.0, 1.0, 2.0 } 51 }); 52 53 [TestMethod] 54 [TestCategory("Problems.DataAnalysis.Symbolic")] 55 [TestProperty("Time", "long")] 56 public void StandardInterpreterTestTypeCoherentGrammarPerformance() { 57 TestTypeCoherentGrammarPerformance(new SymbolicDataAnalysisExpressionTreeInterpreter(), 12.5e6); 58 } 59 [TestMethod] 60 [TestCategory("Problems.DataAnalysis.Symbolic")] 61 [TestProperty("Time", "long")] 62 public void StandardInterpreterTestFullGrammarPerformance() { 63 TestFullGrammarPerformance(new SymbolicDataAnalysisExpressionTreeInterpreter(), 12.5e6); 64 } 65 [TestMethod] 66 [TestCategory("Problems.DataAnalysis.Symbolic")] 67 [TestProperty("Time", "long")] 68 public void StandardInterpreterTestArithmeticGrammarPerformance() { 69 TestArithmeticGrammarPerformance(new SymbolicDataAnalysisExpressionTreeInterpreter(), 12.5e6); 70 } 71 72 73 [TestMethod] 74 [TestCategory("Problems.DataAnalysis.Symbolic")] 75 [TestProperty("Time", "long")] 76 public void ILEmittingInterpreterTestTypeCoherentGrammarPerformance() { 77 TestTypeCoherentGrammarPerformance(new SymbolicDataAnalysisExpressionTreeILEmittingInterpreter(), 7.5e6); 78 } 79 [TestMethod] 80 [TestCategory("Problems.DataAnalysis.Symbolic")] 81 [TestProperty("Time", "long")] 82 public void ILEmittingInterpreterTestFullGrammarPerformance() { 83 TestFullGrammarPerformance(new SymbolicDataAnalysisExpressionTreeILEmittingInterpreter(), 7.5e6); 84 } 85 [TestMethod] 86 [TestCategory("Problems.DataAnalysis.Symbolic")] 87 [TestProperty("Time", "long")] 88 public void ILEmittingInterpreterTestArithmeticGrammarPerformance() { 89 TestArithmeticGrammarPerformance(new SymbolicDataAnalysisExpressionTreeILEmittingInterpreter(), 7.5e6); 90 } 91 92 93 [TestMethod] 94 [TestCategory("Problems.DataAnalysis.Symbolic")] 95 [TestProperty("Time", "long")] 96 public void LinearInterpreterTestTypeCoherentGrammarPerformance() { 97 TestTypeCoherentGrammarPerformance(new SymbolicDataAnalysisExpressionTreeLinearInterpreter(), 12.5e6); 98 } 99 [TestMethod] 100 [TestCategory("Problems.DataAnalysis.Symbolic")] 101 [TestProperty("Time", "long")] 102 public void LinearInterpreterTestFullGrammarPerformance() { 103 TestFullGrammarPerformance(new SymbolicDataAnalysisExpressionTreeLinearInterpreter(), 12.5e6); 104 } 105 [TestMethod] 106 [TestCategory("Problems.DataAnalysis.Symbolic")] 107 [TestProperty("Time", "long")] 108 public void LinearInterpreterTestArithmeticGrammarPerformance() { 109 TestArithmeticGrammarPerformance(new SymbolicDataAnalysisExpressionTreeLinearInterpreter(), 12.5e6); 110 } 111 112 private void TestTypeCoherentGrammarPerformance(ISymbolicDataAnalysisExpressionTreeInterpreter interpreter, double nodesPerSecThreshold) { 95 113 var twister = new MersenneTwister(31415); 96 114 var dataset = Util.CreateRandomDataset(twister, Rows, Columns); … … 110 128 } 111 129 112 private void FullGrammarPerformanceTest(ISymbolicDataAnalysisExpressionTreeInterpreter interpreter, double nodesPerSecThreshold) {130 private void TestFullGrammarPerformance(ISymbolicDataAnalysisExpressionTreeInterpreter interpreter, double nodesPerSecThreshold) { 113 131 var twister = new MersenneTwister(31415); 114 132 var dataset = Util.CreateRandomDataset(twister, Rows, Columns); … … 127 145 } 128 146 129 private void ArithmeticGrammarPerformanceTest(ISymbolicDataAnalysisExpressionTreeInterpreter interpreter, double nodesPerSecThreshold) {147 private void TestArithmeticGrammarPerformance(ISymbolicDataAnalysisExpressionTreeInterpreter interpreter, double nodesPerSecThreshold) { 130 148 var twister = new MersenneTwister(31415); 131 149 var dataset = Util.CreateRandomDataset(twister, Rows, Columns); … … 150 168 ///</summary> 151 169 [TestMethod] 152 [TestCategory("Problems.DataAnalysis ")]170 [TestCategory("Problems.DataAnalysis.Symbolic")] 153 171 [TestProperty("Time", "short")] 154 public void SymbolicDataAnalysisExpressionTreeInterpreterEvaluateTest() { 155 Dataset ds = new Dataset(new string[] { "Y", "A", "B" }, new double[,] { 156 { 1.0, 1.0, 1.0 }, 157 { 2.0, 2.0, 2.0 }, 158 { 3.0, 1.0, 2.0 }, 159 { 4.0, 1.0, 1.0 }, 160 { 5.0, 2.0, 2.0 }, 161 { 6.0, 1.0, 2.0 }, 162 { 7.0, 1.0, 1.0 }, 163 { 8.0, 2.0, 2.0 }, 164 { 9.0, 1.0, 2.0 }, 165 { 10.0, 1.0, 1.0 }, 166 { 11.0, 2.0, 2.0 }, 167 { 12.0, 1.0, 2.0 } 168 }); 169 172 public void StandardInterpreterTestEvaluation() { 170 173 var interpreter = new SymbolicDataAnalysisExpressionTreeInterpreter(); 171 174 EvaluateTerminals(interpreter, ds); … … 175 178 176 179 [TestMethod] 177 [TestCategory("Problems.DataAnalysis ")]180 [TestCategory("Problems.DataAnalysis.Symbolic")] 178 181 [TestProperty("Time", "short")] 179 public void SymbolicDataAnalysisExpressionILEmittingTreeInterpreterEvaluateTest() { 180 Dataset ds = new Dataset(new string[] { "Y", "A", "B" }, new double[,] { 181 { 1.0, 1.0, 1.0 }, 182 { 2.0, 2.0, 2.0 }, 183 { 3.0, 1.0, 2.0 }, 184 { 4.0, 1.0, 1.0 }, 185 { 5.0, 2.0, 2.0 }, 186 { 6.0, 1.0, 2.0 }, 187 { 7.0, 1.0, 1.0 }, 188 { 8.0, 2.0, 2.0 }, 189 { 9.0, 1.0, 2.0 }, 190 { 10.0, 1.0, 1.0 }, 191 { 11.0, 2.0, 2.0 }, 192 { 12.0, 1.0, 2.0 } 193 }); 194 182 public void ILEmittingInterpreterTestEvaluation() { 195 183 var interpreter = new SymbolicDataAnalysisExpressionTreeILEmittingInterpreter(); 184 EvaluateTerminals(interpreter, ds); 185 EvaluateOperations(interpreter, ds); 186 } 187 188 [TestMethod] 189 [TestCategory("Problems.DataAnalysis.Symbolic")] 190 [TestProperty("Time", "short")] 191 public void LinearInterpreterTestEvaluation() { 192 var interpreter = new SymbolicDataAnalysisExpressionTreeLinearInterpreter(); 193 194 //ADFs are not supported by the linear interpreter 196 195 EvaluateTerminals(interpreter, ds); 197 196 EvaluateOperations(interpreter, ds); … … 430 429 try { 431 430 Evaluate(interpreter, ds, "(psi " + x + ")", 0, alglib.psi(x)); 432 } catch (alglib.alglibexception) { // ignore cases where alglib throws an exception 431 } 432 catch (alglib.alglibexception) { // ignore cases where alglib throws an exception 433 433 } 434 434 }; -
trunk/sources/HeuristicLab.Tests/HeuristicLab.Problems.DataAnalysis.Symbolic.TimeSeriesPrognosis-3.4/SymbolicDataAnalysisExpressionTreeInterpreterTest.cs
r9785 r9828 37 37 38 38 [TestMethod] 39 [TestCategory("Problems.DataAnalysis ")]39 [TestCategory("Problems.DataAnalysis.Symbolic")] 40 40 [TestProperty("Time", "long")] 41 public void SymbolicTimeSeriesPrognosisTreeInterpreterTypeCoherentGrammarPerformanceTest() {42 T ypeCoherentGrammarPerformanceTest(new SymbolicTimeSeriesPrognosisExpressionTreeInterpreter("y"), 12.5e6);41 public void TimeSeriesPrognosisInterpreterTestTypeCoherentGrammarPerformance() { 42 TestTypeCoherentGrammarPerformance(new SymbolicTimeSeriesPrognosisExpressionTreeInterpreter("y"), 12.5e6); 43 43 } 44 44 45 45 [TestMethod] 46 [TestCategory("Problems.DataAnalysis ")]46 [TestCategory("Problems.DataAnalysis.Symbolic")] 47 47 [TestProperty("Time", "long")] 48 public void SymbolicTimeSeriesPrognosisTreeInterpreterFullGrammarPerformanceTest() {49 FullGrammarPerformanceTest(new SymbolicTimeSeriesPrognosisExpressionTreeInterpreter("y"), 12.5e6);48 public void TimeSeriesPrognosisInterpreterTestFullGrammarPerformance() { 49 TestFullGrammarPerformance(new SymbolicTimeSeriesPrognosisExpressionTreeInterpreter("y"), 12.5e6); 50 50 } 51 51 52 52 [TestMethod] 53 [TestCategory("Problems.DataAnalysis ")]53 [TestCategory("Problems.DataAnalysis.Symbolic")] 54 54 [TestProperty("Time", "long")] 55 public void SymbolicTimeSeriesPrognosisTreeInterpreterArithmeticGrammarPerformanceTest() {56 ArithmeticGrammarPerformanceTest(new SymbolicTimeSeriesPrognosisExpressionTreeInterpreter("y"), 12.5e6);57 } 58 59 private void T ypeCoherentGrammarPerformanceTest(ISymbolicTimeSeriesPrognosisExpressionTreeInterpreter interpreter, double nodesPerSecThreshold) {55 public void TimeSeriesPrognosisInterpreterTestArithmeticGrammarPerformance() { 56 TestArithmeticGrammarPerformance(new SymbolicTimeSeriesPrognosisExpressionTreeInterpreter("y"), 12.5e6); 57 } 58 59 private void TestTypeCoherentGrammarPerformance(ISymbolicTimeSeriesPrognosisExpressionTreeInterpreter interpreter, double nodesPerSecThreshold) { 60 60 var twister = new MersenneTwister(31415); 61 61 var dataset = Util.CreateRandomDataset(twister, Rows, Columns); … … 75 75 } 76 76 77 private void FullGrammarPerformanceTest(ISymbolicTimeSeriesPrognosisExpressionTreeInterpreter interpreter, double nodesPerSecThreshold) {77 private void TestFullGrammarPerformance(ISymbolicTimeSeriesPrognosisExpressionTreeInterpreter interpreter, double nodesPerSecThreshold) { 78 78 var twister = new MersenneTwister(31415); 79 79 var dataset = Util.CreateRandomDataset(twister, Rows, Columns); … … 92 92 } 93 93 94 private void ArithmeticGrammarPerformanceTest(ISymbolicTimeSeriesPrognosisExpressionTreeInterpreter interpreter, double nodesPerSecThreshold) {94 private void TestArithmeticGrammarPerformance(ISymbolicTimeSeriesPrognosisExpressionTreeInterpreter interpreter, double nodesPerSecThreshold) { 95 95 var twister = new MersenneTwister(31415); 96 96 var dataset = Util.CreateRandomDataset(twister, Rows, Columns); … … 115 115 ///</summary> 116 116 [TestMethod] 117 [TestCategory("Problems.DataAnalysis ")]117 [TestCategory("Problems.DataAnalysis.Symbolic")] 118 118 [TestProperty("Time", "short")] 119 public void SymbolicDataAnalysisExpressionTreeInterpreterEvaluateTest() {119 public void TimeSeriesPrognosisInterpreterTestEvaluation() { 120 120 Dataset ds = new Dataset(new string[] { "Y", "A", "B" }, new double[,] { 121 121 { 1.0, 1.0, 1.0 },
Note: See TracChangeset
for help on using the changeset viewer.