Changeset 3513 for trunk/sources/HeuristicLab.Problems.DataAnalysis
- Timestamp:
- 04/23/10 14:28:07 (15 years ago)
- Location:
- trunk/sources/HeuristicLab.Problems.DataAnalysis/3.3
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.DataAnalysis/3.3/DataAnalysisSolution.cs
r3462 r3513 50 50 } 51 51 } 52 [Storable] 53 private double lowerEstimationLimit; 54 public double LowerEstimationLimit { 55 get { return lowerEstimationLimit; } 56 set { 57 if (lowerEstimationLimit != value) { 58 lowerEstimationLimit = value; 59 OnEstimatedValuesChanged(EventArgs.Empty); 60 } 61 } 62 } 63 64 [Storable] 65 private double upperEstimationLimit; 66 public double UpperEstimationLimit { 67 get { return upperEstimationLimit; } 68 set { 69 if (upperEstimationLimit != value) { 70 upperEstimationLimit = value; 71 OnEstimatedValuesChanged(EventArgs.Empty); 72 } 73 } 74 } 52 75 53 76 public abstract IEnumerable<double> EstimatedValues { get; } … … 56 79 57 80 protected DataAnalysisSolution() : base() { } 58 protected DataAnalysisSolution(DataAnalysisProblemData problemData) 81 protected DataAnalysisSolution(DataAnalysisProblemData problemData) : this(problemData, double.NegativeInfinity, double.PositiveInfinity) { } 82 protected DataAnalysisSolution(DataAnalysisProblemData problemData, double lowerEstimationLimit, double upperEstimationLimit) 59 83 : this() { 60 84 this.problemData = problemData; 85 this.lowerEstimationLimit = lowerEstimationLimit; 86 this.upperEstimationLimit = upperEstimationLimit; 61 87 Initialize(); 62 88 } … … 74 100 // don't clone the problem data! 75 101 clone.problemData = problemData; 102 clone.lowerEstimationLimit = lowerEstimationLimit; 103 clone.upperEstimationLimit = upperEstimationLimit; 76 104 clone.Initialize(); 77 105 return clone; -
trunk/sources/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/SimpleArithmeticExpressionInterpreter.cs
r3491 r3513 34 34 [Item("SimpleArithmeticExpressionInterpreter", "Interpreter for arithmetic symbolic expression trees including function calls.")] 35 35 // not thread safe! 36 public class SimpleArithmeticExpressionInterpreter : Item, ISymbolicExpressionTreeInterpreter {36 public class SimpleArithmeticExpressionInterpreter : NamedItem, ISymbolicExpressionTreeInterpreter { 37 37 private class OpCodes { 38 38 public const byte Add = 1; … … 47 47 48 48 private const int ARGUMENT_STACK_SIZE = 1024; 49 49 50 private Dataset dataset; 50 51 private int row; 51 52 private Instruction[] code; 52 53 private int pc; 54 55 public SimpleArithmeticExpressionInterpreter() 56 : base() { 57 } 53 58 54 59 public IEnumerable<double> GetSymbolicExpressionTreeValues(SymbolicExpressionTree tree, Dataset dataset, IEnumerable<int> rows) { … … 61 66 pc = 0; 62 67 argStackPointer = 0; 63 var estimatedValue = Evaluate(); 64 if (double.IsNaN(estimatedValue) || double.IsInfinity(estimatedValue)) yield return 0.0; 65 else yield return estimatedValue; 68 yield return Evaluate(); 66 69 } 67 70 }
Note: See TracChangeset
for help on using the changeset viewer.