Changeset 9828


Ignore:
Timestamp:
07/31/13 14:47:13 (8 years ago)
Author:
mkommend
Message:

#2021: Integrated the linear interpreter in the trunk and restructed interpreter unit tests.

Location:
trunk/sources
Files:
11 edited
4 copied

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding

  • trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Compiler/Instruction.cs

    r9456 r9828  
    3131    public byte nArguments;
    3232    // an optional object value (addresses for calls, argument index for arguments)
    33     public object iArg0;
     33    public object data;
    3434  }
    3535}
  • trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Compiler/SymbolicExpressionTreeCompiler.cs

    r9456 r9828  
    5252        if (instr.dynamicNode.Symbol is InvokeFunction) {
    5353          var invokeNode = (InvokeFunctionTreeNode)instr.dynamicNode;
    54           instr.iArg0 = entryPoint[invokeNode.Symbol.FunctionName];
     54          instr.data = entryPoint[invokeNode.Symbol.FunctionName];
    5555        }
    5656      }
     
    6868        if (node.Symbol is Argument) {
    6969          var argNode = (ArgumentTreeNode)node;
    70           instr.iArg0 = (ushort)argNode.Symbol.ArgumentIndex;
     70          instr.data = (ushort)argNode.Symbol.ArgumentIndex;
    7171        }
    7272        instr.dynamicNode = node;
  • trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4.csproj

    r9649 r9828  
    124124    <Compile Include="ArchitectureManipulators\SymbolicExpressionTreeArchitectureManipulator.cs" />
    125125    <Compile Include="Compiler\Instruction.cs" />
     126    <Compile Include="Compiler\LinearInstruction.cs" />
    126127    <Compile Include="Compiler\SymbolicExpressionTreeCompiler.cs" />
     128    <Compile Include="Compiler\SymbolicExpressionTreeLinearCompiler.cs" />
    127129    <Compile Include="Creators\FullTreeCreator.cs">
    128130      <SubType>Code</SubType>
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic

  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.TimeSeriesPrognosis/3.4/SymbolicTimeSeriesPrognosisExpressionTreeInterpreter.cs

    r9462 r9828  
    123123          var variableTreeNode = (VariableTreeNode)instr.dynamicNode;
    124124          if (variableTreeNode.VariableName == targetVariable)
    125             instr.iArg0 = targetVariableCache;
     125            instr.data = targetVariableCache;
    126126          else
    127             instr.iArg0 = dataset.GetReadOnlyDoubleValues(variableTreeNode.VariableName);
     127            instr.data = dataset.GetReadOnlyDoubleValues(variableTreeNode.VariableName);
    128128        } else if (instr.opCode == OpCodes.LagVariable) {
    129129          var variableTreeNode = (LaggedVariableTreeNode)instr.dynamicNode;
    130130          if (variableTreeNode.VariableName == targetVariable)
    131             instr.iArg0 = targetVariableCache;
     131            instr.data = targetVariableCache;
    132132          else
    133             instr.iArg0 = dataset.GetReadOnlyDoubleValues(variableTreeNode.VariableName);
     133            instr.data = dataset.GetReadOnlyDoubleValues(variableTreeNode.VariableName);
    134134        } else if (instr.opCode == OpCodes.VariableCondition) {
    135135          var variableTreeNode = (VariableConditionTreeNode)instr.dynamicNode;
    136136          if (variableTreeNode.VariableName == targetVariable)
    137             instr.iArg0 = targetVariableCache;
     137            instr.data = targetVariableCache;
    138138          else
    139             instr.iArg0 = dataset.GetReadOnlyDoubleValues(variableTreeNode.VariableName);
     139            instr.data = dataset.GetReadOnlyDoubleValues(variableTreeNode.VariableName);
    140140        } else if (instr.opCode == OpCodes.Call) {
    141141          necessaryArgStackSize += instr.nArguments + 1;
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.csproj

    r9821 r9828  
    147147    <Compile Include="Interpreter\SymbolicDataAnalysisExpressionTreeILEmittingInterpreter.cs" />
    148148    <Compile Include="Interpreter\SymbolicDataAnalysisExpressionTreeInterpreter.cs" />
     149    <Compile Include="Interpreter\SymbolicDataAnalysisExpressionTreeLinearInterpreter.cs" />
    149150    <Compile Include="Plugin.cs" />
    150151    <Compile Include="Formatters\SymbolicDataAnalysisExpressionLatexFormatter.cs" />
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeILEmittingInterpreter.cs

    r9456 r9828  
    168168        if (instr.opCode == OpCodes.Variable) {
    169169          var variableTreeNode = (VariableTreeNode)instr.dynamicNode;
    170           instr.iArg0 = doubleVariableNames[variableTreeNode.VariableName];
     170          instr.data = doubleVariableNames[variableTreeNode.VariableName];
    171171        } else if (instr.opCode == OpCodes.LagVariable) {
    172172          var laggedVariableTreeNode = (LaggedVariableTreeNode)instr.dynamicNode;
    173           instr.iArg0 = doubleVariableNames[laggedVariableTreeNode.VariableName];
     173          instr.data = doubleVariableNames[laggedVariableTreeNode.VariableName];
    174174        } else if (instr.opCode == OpCodes.VariableCondition) {
    175175          var variableConditionTreeNode = (VariableConditionTreeNode)instr.dynamicNode;
    176           instr.iArg0 = doubleVariableNames[variableConditionTreeNode.VariableName];
     176          instr.data = doubleVariableNames[variableConditionTreeNode.VariableName];
    177177        } else if (instr.opCode == OpCodes.Call) {
    178178          necessaryArgStackSize += instr.nArguments + 1;
     
    566566            VariableTreeNode varNode = (VariableTreeNode)currentInstr.dynamicNode;
    567567            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);
    569569            // load correct column of the current variable
    570570            il.Emit(System.Reflection.Emit.OpCodes.Ldelem_Ref);
     
    600600            LaggedVariableTreeNode varNode = (LaggedVariableTreeNode)currentInstr.dynamicNode;
    601601            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);
    603603            // load correct column of the current variable
    604604            il.Emit(System.Reflection.Emit.OpCodes.Ldelem_Ref);
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeInterpreter.cs

    r9456 r9828  
    117117        if (instr.opCode == OpCodes.Variable) {
    118118          var variableTreeNode = (VariableTreeNode)instr.dynamicNode;
    119           instr.iArg0 = dataset.GetReadOnlyDoubleValues(variableTreeNode.VariableName);
     119          instr.data = dataset.GetReadOnlyDoubleValues(variableTreeNode.VariableName);
    120120        } else if (instr.opCode == OpCodes.LagVariable) {
    121121          var laggedVariableTreeNode = (LaggedVariableTreeNode)instr.dynamicNode;
    122           instr.iArg0 = dataset.GetReadOnlyDoubleValues(laggedVariableTreeNode.VariableName);
     122          instr.data = dataset.GetReadOnlyDoubleValues(laggedVariableTreeNode.VariableName);
    123123        } else if (instr.opCode == OpCodes.VariableCondition) {
    124124          var variableConditionTreeNode = (VariableConditionTreeNode)instr.dynamicNode;
    125           instr.iArg0 = dataset.GetReadOnlyDoubleValues(variableConditionTreeNode.VariableName);
     125          instr.data = dataset.GetReadOnlyDoubleValues(variableConditionTreeNode.VariableName);
    126126        } else if (instr.opCode == OpCodes.Call) {
    127127          necessaryArgStackSize += instr.nArguments + 1;
     
    132132
    133133
    134     protected virtual double Evaluate(Dataset dataset, ref int row, InterpreterState state) {
     134    public virtual double Evaluate(Dataset dataset, ref int row, InterpreterState state) {
    135135      Instruction currentInstr = state.NextInstruction();
    136136      switch (currentInstr.opCode) {
     
    406406            int savedPc = state.ProgramCounter;
    407407            // set pc to start of function 
    408             state.ProgramCounter = (ushort)currentInstr.iArg0;
     408            state.ProgramCounter = (ushort)currentInstr.data;
    409409            // evaluate the function
    410410            double v = Evaluate(dataset, ref row, state);
     
    418418          }
    419419        case OpCodes.Arg: {
    420             return state.GetStackFrameValue((ushort)currentInstr.iArg0);
     420            return state.GetStackFrameValue((ushort)currentInstr.data);
    421421          }
    422422        case OpCodes.Variable: {
    423423            if (row < 0 || row >= dataset.Rows) return double.NaN;
    424424            var variableTreeNode = (VariableTreeNode)currentInstr.dynamicNode;
    425             return ((IList<double>)currentInstr.iArg0)[row] * variableTreeNode.Weight;
     425            return ((IList<double>)currentInstr.data)[row] * variableTreeNode.Weight;
    426426          }
    427427        case OpCodes.LagVariable: {
     
    429429            int actualRow = row + laggedVariableTreeNode.Lag;
    430430            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;
    432432          }
    433433        case OpCodes.Constant: {
     
    441441            if (row < 0 || row >= dataset.Rows) return double.NaN;
    442442            var variableConditionTreeNode = (VariableConditionTreeNode)currentInstr.dynamicNode;
    443             double variableValue = ((IList<double>)currentInstr.iArg0)[row];
     443            double variableValue = ((IList<double>)currentInstr.data)[row];
    444444            double x = variableValue - variableConditionTreeNode.Threshold;
    445445            double p = 1 / (1 + Math.Exp(-variableConditionTreeNode.Slope * x));
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeLinearInterpreter.cs

    r9826 r9828  
    7373    }
    7474
    75     private SymbolicDataAnalysisExpressionTreeLinearInterpreter(
    76       SymbolicDataAnalysisExpressionTreeLinearInterpreter original, Cloner cloner)
     75    private SymbolicDataAnalysisExpressionTreeLinearInterpreter(SymbolicDataAnalysisExpressionTreeLinearInterpreter original, Cloner cloner)
    7776      : base(original, cloner) {
    78       interpreter = original.interpreter;
     77      interpreter = cloner.Clone(original.interpreter);
    7978    }
    8079
     
    9089    }
    9190
    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 
    9991    [StorableHook(HookType.AfterDeserialization)]
    10092    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)));
    10393      if (interpreter == null) interpreter = new SymbolicDataAnalysisExpressionTreeInterpreter();
    10494    }
    10595
    10696    #region IStatefulItem
    107 
    10897    public void InitializeState() {
    10998      EvaluatedSolutions.Value = 0;
    11099    }
    111100
    112     public void ClearState() {
    113     }
    114 
     101    public void ClearState() { }
    115102    #endregion
    116103
  • trunk/sources/HeuristicLab.Tests/HeuristicLab.Problems.DataAnalysis.Symbolic-3.4/SymbolicDataAnalysisExpressionTreeInterpreterTest.cs

    r9785 r9828  
    3030
    3131
    32   [TestClass()]
     32  [TestClass]
    3333  public class SymbolicDataAnalysisExpressionTreeInterpreterTest {
    3434    private const int N = 1000;
    3535    private const int Rows = 1000;
    3636    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) {
    95113      var twister = new MersenneTwister(31415);
    96114      var dataset = Util.CreateRandomDataset(twister, Rows, Columns);
     
    110128    }
    111129
    112     private void FullGrammarPerformanceTest(ISymbolicDataAnalysisExpressionTreeInterpreter interpreter, double nodesPerSecThreshold) {
     130    private void TestFullGrammarPerformance(ISymbolicDataAnalysisExpressionTreeInterpreter interpreter, double nodesPerSecThreshold) {
    113131      var twister = new MersenneTwister(31415);
    114132      var dataset = Util.CreateRandomDataset(twister, Rows, Columns);
     
    127145    }
    128146
    129     private void ArithmeticGrammarPerformanceTest(ISymbolicDataAnalysisExpressionTreeInterpreter interpreter, double nodesPerSecThreshold) {
     147    private void TestArithmeticGrammarPerformance(ISymbolicDataAnalysisExpressionTreeInterpreter interpreter, double nodesPerSecThreshold) {
    130148      var twister = new MersenneTwister(31415);
    131149      var dataset = Util.CreateRandomDataset(twister, Rows, Columns);
     
    150168    ///</summary>
    151169    [TestMethod]
    152     [TestCategory("Problems.DataAnalysis")]
     170    [TestCategory("Problems.DataAnalysis.Symbolic")]
    153171    [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() {
    170173      var interpreter = new SymbolicDataAnalysisExpressionTreeInterpreter();
    171174      EvaluateTerminals(interpreter, ds);
     
    175178
    176179    [TestMethod]
    177     [TestCategory("Problems.DataAnalysis")]
     180    [TestCategory("Problems.DataAnalysis.Symbolic")]
    178181    [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() {
    195183      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
    196195      EvaluateTerminals(interpreter, ds);
    197196      EvaluateOperations(interpreter, ds);
     
    430429          try {
    431430            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
    433433          }
    434434        };
  • trunk/sources/HeuristicLab.Tests/HeuristicLab.Problems.DataAnalysis.Symbolic.TimeSeriesPrognosis-3.4/SymbolicDataAnalysisExpressionTreeInterpreterTest.cs

    r9785 r9828  
    3737
    3838    [TestMethod]
    39     [TestCategory("Problems.DataAnalysis")]
     39    [TestCategory("Problems.DataAnalysis.Symbolic")]
    4040    [TestProperty("Time", "long")]
    41     public void SymbolicTimeSeriesPrognosisTreeInterpreterTypeCoherentGrammarPerformanceTest() {
    42       TypeCoherentGrammarPerformanceTest(new SymbolicTimeSeriesPrognosisExpressionTreeInterpreter("y"), 12.5e6);
     41    public void TimeSeriesPrognosisInterpreterTestTypeCoherentGrammarPerformance() {
     42      TestTypeCoherentGrammarPerformance(new SymbolicTimeSeriesPrognosisExpressionTreeInterpreter("y"), 12.5e6);
    4343    }
    4444
    4545    [TestMethod]
    46     [TestCategory("Problems.DataAnalysis")]
     46    [TestCategory("Problems.DataAnalysis.Symbolic")]
    4747    [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);
    5050    }
    5151
    5252    [TestMethod]
    53     [TestCategory("Problems.DataAnalysis")]
     53    [TestCategory("Problems.DataAnalysis.Symbolic")]
    5454    [TestProperty("Time", "long")]
    55     public void SymbolicTimeSeriesPrognosisTreeInterpreterArithmeticGrammarPerformanceTest() {
    56       ArithmeticGrammarPerformanceTest(new SymbolicTimeSeriesPrognosisExpressionTreeInterpreter("y"), 12.5e6);
    57     }
    58 
    59     private void TypeCoherentGrammarPerformanceTest(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) {
    6060      var twister = new MersenneTwister(31415);
    6161      var dataset = Util.CreateRandomDataset(twister, Rows, Columns);
     
    7575    }
    7676
    77     private void FullGrammarPerformanceTest(ISymbolicTimeSeriesPrognosisExpressionTreeInterpreter interpreter, double nodesPerSecThreshold) {
     77    private void TestFullGrammarPerformance(ISymbolicTimeSeriesPrognosisExpressionTreeInterpreter interpreter, double nodesPerSecThreshold) {
    7878      var twister = new MersenneTwister(31415);
    7979      var dataset = Util.CreateRandomDataset(twister, Rows, Columns);
     
    9292    }
    9393
    94     private void ArithmeticGrammarPerformanceTest(ISymbolicTimeSeriesPrognosisExpressionTreeInterpreter interpreter, double nodesPerSecThreshold) {
     94    private void TestArithmeticGrammarPerformance(ISymbolicTimeSeriesPrognosisExpressionTreeInterpreter interpreter, double nodesPerSecThreshold) {
    9595      var twister = new MersenneTwister(31415);
    9696      var dataset = Util.CreateRandomDataset(twister, Rows, Columns);
     
    115115    ///</summary>
    116116    [TestMethod]
    117     [TestCategory("Problems.DataAnalysis")]
     117    [TestCategory("Problems.DataAnalysis.Symbolic")]
    118118    [TestProperty("Time", "short")]
    119     public void SymbolicDataAnalysisExpressionTreeInterpreterEvaluateTest() {
     119    public void TimeSeriesPrognosisInterpreterTestEvaluation() {
    120120      Dataset ds = new Dataset(new string[] { "Y", "A", "B" }, new double[,] {
    121121        { 1.0, 1.0, 1.0 },
Note: See TracChangeset for help on using the changeset viewer.