Changeset 9734


Ignore:
Timestamp:
07/22/13 15:10:10 (6 years ago)
Author:
bburlacu
Message:

#2021: Updated license year, fixed interpreter name (SymbolicDataAnalysisExpressionTreeLinearInterpreter) and updated description. Replaced tabs with spaces in Instruction.cs.

Location:
branches/HeuristicLab.DataAnalysis.Symbolic.LinearInterpreter
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.DataAnalysis.Symbolic.LinearInterpreter/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Compiler/Instruction.cs

    r9732 r9734  
    3333    public object iArg0;
    3434
    35   public double value;
    36   public int childIndex;
     35    public double value;
     36    public int childIndex;
    3737  }
    3838}
  • branches/HeuristicLab.DataAnalysis.Symbolic.LinearInterpreter/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeLinearInterpreter.cs

    r9732 r9734  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    3131namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
    3232  [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 {
    3735    private const string CheckExpressionsWithIntervalArithmeticParameterName = "CheckExpressionsWithIntervalArithmetic";
    3836    private const string EvaluatedSolutionsParameterName = "EvaluatedSolutions";
     
    7371
    7472    [StorableConstructor]
    75     protected SymbolicDataAnalysisExpressionTreeFastInterpreter(bool deserializing)
     73    protected SymbolicDataAnalysisExpressionTreeLinearInterpreter(bool deserializing)
    7674      : base(deserializing) {
    7775    }
    7876
    79     protected SymbolicDataAnalysisExpressionTreeFastInterpreter(
    80       SymbolicDataAnalysisExpressionTreeFastInterpreter original, Cloner cloner)
     77    protected SymbolicDataAnalysisExpressionTreeLinearInterpreter(
     78      SymbolicDataAnalysisExpressionTreeLinearInterpreter original, Cloner cloner)
    8179      : base(original, cloner) {
    8280    }
    8381
    8482    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)
    10193      : 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)));
    10896    }
    10997
     
    11199    private void AfterDeserialization() {
    112100      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)));
    116102    }
    117103
     
    127113    #endregion
    128114
    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) {
    131116      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.");
    134118
    135119      lock (EvaluatedSolutions) {
Note: See TracChangeset for help on using the changeset viewer.