Changeset 7669 for branches/HeuristicLab.Hive.Azure/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisExpressionTreeInterpreter.cs
- Timestamp:
- 03/28/12 15:47:26 (12 years ago)
- Location:
- branches/HeuristicLab.Hive.Azure
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Hive.Azure
- Property svn:ignore
-
old new 3 3 *.resharper 4 4 *.suo 5 *.user 5 6 *.vsp 6 7 Doxygen 8 FxCopResults.txt 7 9 Google.ProtocolBuffers-0.9.1.dll 8 10 HeuristicLab 3.3.5.1.ReSharper.user
-
- Property svn:mergeinfo changed
- Property svn:ignore
-
branches/HeuristicLab.Hive.Azure/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisExpressionTreeInterpreter.cs
r7270 r7669 34 34 public sealed class SymbolicDataAnalysisExpressionTreeInterpreter : ParameterizedNamedItem, ISymbolicDataAnalysisExpressionTreeInterpreter { 35 35 private const string CheckExpressionsWithIntervalArithmeticParameterName = "CheckExpressionsWithIntervalArithmetic"; 36 private const string EvaluatedSolutionsParameterName = "EvaluatedSolutions"; 36 37 #region private classes 37 38 private class InterpreterState { … … 176 177 get { return (IValueParameter<BoolValue>)Parameters[CheckExpressionsWithIntervalArithmeticParameterName]; } 177 178 } 179 180 public IValueParameter<IntValue> EvaluatedSolutionsParameter { 181 get { return (IValueParameter<IntValue>)Parameters[EvaluatedSolutionsParameterName]; } 182 } 178 183 #endregion 179 184 … … 183 188 set { CheckExpressionsWithIntervalArithmeticParameter.Value = value; } 184 189 } 190 191 public IntValue EvaluatedSolutions { 192 get { return EvaluatedSolutionsParameter.Value; } 193 set { EvaluatedSolutionsParameter.Value = value; } 194 } 185 195 #endregion 186 187 196 188 197 [StorableConstructor] … … 196 205 : base("SymbolicDataAnalysisExpressionTreeInterpreter", "Interpreter for symbolic expression trees including automatically defined functions.") { 197 206 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))); 198 } 207 Parameters.Add(new ValueParameter<IntValue>(EvaluatedSolutionsParameterName, "A counter for the total number of solutions the interpreter has evaluated", new IntValue(0))); 208 } 209 210 [StorableHook(HookType.AfterDeserialization)] 211 private void AfterDeserialization() { 212 if (!Parameters.ContainsKey(EvaluatedSolutionsParameterName)) 213 Parameters.Add(new ValueParameter<IntValue>(EvaluatedSolutionsParameterName, "A counter for the total number of solutions the interpreter has evaluated", new IntValue(0))); 214 } 215 216 #region IStatefulItem 217 public void InitializeState() { 218 EvaluatedSolutions.Value = 0; 219 } 220 221 public void ClearState() { 222 } 223 #endregion 199 224 200 225 public IEnumerable<double> GetSymbolicExpressionTreeValues(ISymbolicExpressionTree tree, Dataset dataset, IEnumerable<int> rows) { 201 226 if (CheckExpressionsWithIntervalArithmetic.Value) 202 227 throw new NotSupportedException("Interval arithmetic is not yet supported in the symbolic data analysis interpreter."); 228 EvaluatedSolutions.Value++; // increment the evaluated solutions counter 203 229 var compiler = new SymbolicExpressionTreeCompiler(); 204 230 Instruction[] code = compiler.Compile(tree, MapSymbolToOpCode);
Note: See TracChangeset
for help on using the changeset viewer.