Changeset 9734
- Timestamp:
- 07/22/13 15:10:10 (12 years ago)
- Location:
- branches/HeuristicLab.DataAnalysis.Symbolic.LinearInterpreter
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified branches/HeuristicLab.DataAnalysis.Symbolic.LinearInterpreter/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Compiler/Instruction.cs ¶
r9732 r9734 33 33 public object iArg0; 34 34 35 36 35 public double value; 36 public int childIndex; 37 37 } 38 38 } -
TabularUnified branches/HeuristicLab.DataAnalysis.Symbolic.LinearInterpreter/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeLinearInterpreter.cs ¶
r9732 r9734 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 2Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 31 31 namespace HeuristicLab.Problems.DataAnalysis.Symbolic { 32 32 [StorableClass] 33 [Item("SymbolicDataAnalysisExpressionTreeFastInterpreter", 34 "Fast interpreter for symbolic expression trees including automatically defined functions.")] 35 public class SymbolicDataAnalysisExpressionTreeFastInterpreter : ParameterizedNamedItem, 36 ISymbolicDataAnalysisExpressionTreeInterpreter { 33 [Item("SymbolicDataAnalysisExpressionTreeLinearInterpreter", "Linear (non-recursive) interpreter for symbolic expression trees (does not support ADFs).")] 34 public class SymbolicDataAnalysisExpressionTreeLinearInterpreter : ParameterizedNamedItem, ISymbolicDataAnalysisExpressionTreeInterpreter { 37 35 private const string CheckExpressionsWithIntervalArithmeticParameterName = "CheckExpressionsWithIntervalArithmetic"; 38 36 private const string EvaluatedSolutionsParameterName = "EvaluatedSolutions"; … … 73 71 74 72 [StorableConstructor] 75 protected SymbolicDataAnalysisExpressionTree FastInterpreter(bool deserializing)73 protected SymbolicDataAnalysisExpressionTreeLinearInterpreter(bool deserializing) 76 74 : base(deserializing) { 77 75 } 78 76 79 protected SymbolicDataAnalysisExpressionTree FastInterpreter(80 SymbolicDataAnalysisExpressionTree FastInterpreter original, Cloner cloner)77 protected SymbolicDataAnalysisExpressionTreeLinearInterpreter( 78 SymbolicDataAnalysisExpressionTreeLinearInterpreter original, Cloner cloner) 81 79 : base(original, cloner) { 82 80 } 83 81 84 82 public override IDeepCloneable Clone(Cloner cloner) { 85 return new SymbolicDataAnalysisExpressionTreeFastInterpreter(this, cloner); 86 } 87 88 public SymbolicDataAnalysisExpressionTreeFastInterpreter() 89 : base( 90 "SymbolicDataAnalysisExpressionTreeFastInterpreter", 91 "Interpreter for symbolic expression trees including automatically defined functions.") { 92 Parameters.Add(new ValueParameter<BoolValue>(CheckExpressionsWithIntervalArithmeticParameterName, 93 "Switch that determines if the interpreter checks the validity of expressions with interval arithmetic before evaluating the expression.", 94 new BoolValue(false))); 95 Parameters.Add(new ValueParameter<IntValue>(EvaluatedSolutionsParameterName, 96 "A counter for the total number of solutions the interpreter has evaluated", 97 new IntValue(0))); 98 } 99 100 protected SymbolicDataAnalysisExpressionTreeFastInterpreter(string name, string description) 83 return new SymbolicDataAnalysisExpressionTreeLinearInterpreter(this, cloner); 84 } 85 86 public SymbolicDataAnalysisExpressionTreeLinearInterpreter() 87 : base("SymbolicDataAnalysisExpressionTreeLinearInterpreter", "Interpreter for symbolic expression trees including automatically defined functions.") { 88 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))); 89 Parameters.Add(new ValueParameter<IntValue>(EvaluatedSolutionsParameterName, "A counter for the total number of solutions the interpreter has evaluated", new IntValue(0))); 90 } 91 92 protected SymbolicDataAnalysisExpressionTreeLinearInterpreter(string name, string description) 101 93 : base(name, description) { 102 Parameters.Add(new ValueParameter<BoolValue>(CheckExpressionsWithIntervalArithmeticParameterName, 103 "Switch that determines if the interpreter checks the validity of expressions with interval arithmetic before evaluating the expression.", 104 new BoolValue(false))); 105 Parameters.Add(new ValueParameter<IntValue>(EvaluatedSolutionsParameterName, 106 "A counter for the total number of solutions the interpreter has evaluated", 107 new IntValue(0))); 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))); 108 96 } 109 97 … … 111 99 private void AfterDeserialization() { 112 100 if (!Parameters.ContainsKey(EvaluatedSolutionsParameterName)) 113 Parameters.Add(new ValueParameter<IntValue>(EvaluatedSolutionsParameterName, 114 "A counter for the total number of solutions the interpreter has evaluated", 115 new IntValue(0))); 101 Parameters.Add(new ValueParameter<IntValue>(EvaluatedSolutionsParameterName, "A counter for the total number of solutions the interpreter has evaluated", new IntValue(0))); 116 102 } 117 103 … … 127 113 #endregion 128 114 129 public IEnumerable<double> GetSymbolicExpressionTreeValues(ISymbolicExpressionTree tree, Dataset dataset, 130 IEnumerable<int> rows) { 115 public IEnumerable<double> GetSymbolicExpressionTreeValues(ISymbolicExpressionTree tree, Dataset dataset, IEnumerable<int> rows) { 131 116 if (CheckExpressionsWithIntervalArithmetic.Value) 132 throw new NotSupportedException( 133 "Interval arithmetic is not yet supported in the symbolic data analysis interpreter."); 117 throw new NotSupportedException("Interval arithmetic is not yet supported in the symbolic data analysis interpreter."); 134 118 135 119 lock (EvaluatedSolutions) {
Note: See TracChangeset
for help on using the changeset viewer.