Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/17/12 15:18:03 (13 years ago)
Author:
bburlacu
Message:

#1682: New branch format: removed unnecessary files, merged remaining.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/gp-crossover/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisExpressionTreeILEmittingInterpreter.cs

    r6849 r7344  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2011 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    4848    internal delegate double CompiledFunction(int sampleIndex, IList<double>[] columns);
    4949    private const string CheckExpressionsWithIntervalArithmeticParameterName = "CheckExpressionsWithIntervalArithmetic";
     50    private const string EvaluatedSolutionsParameterName = "EvaluatedSolutions";
    5051    #region private classes
    5152    private class InterpreterState {
     
    156157      get { return (IValueParameter<BoolValue>)Parameters[CheckExpressionsWithIntervalArithmeticParameterName]; }
    157158    }
     159
     160    public IValueParameter<IntValue> EvaluatedSolutionsParameter {
     161      get { return (IValueParameter<IntValue>)Parameters[EvaluatedSolutionsParameterName]; }
     162    }
    158163    #endregion
    159164
     
    162167      get { return CheckExpressionsWithIntervalArithmeticParameter.Value; }
    163168      set { CheckExpressionsWithIntervalArithmeticParameter.Value = value; }
     169    }
     170
     171    public IntValue EvaluatedSolutions {
     172      get { return EvaluatedSolutionsParameter.Value; }
     173      set { EvaluatedSolutionsParameter.Value = value; }
    164174    }
    165175    #endregion
     
    176186      : base("SymbolicDataAnalysisExpressionTreeILEmittingInterpreter", "Interpreter for symbolic expression trees.") {
    177187      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)));
    178     }
     188      Parameters.Add(new ValueParameter<IntValue>(EvaluatedSolutionsParameterName, "A counter for the total number of solutions the interpreter has evaluated", new IntValue(0)));
     189    }
     190
     191    #region state
     192    public void InitializeState() {
     193      EvaluatedSolutions.Value = 0;
     194    }
     195
     196    public void ClearState() {
     197      EvaluatedSolutions.Value = 0;
     198    }
     199    #endregion
    179200
    180201    public IEnumerable<double> GetSymbolicExpressionTreeValues(ISymbolicExpressionTree tree, Dataset dataset, IEnumerable<int> rows) {
     
    584605        //to determine the relative amounts of the true and false branch see http://en.wikipedia.org/wiki/Logistic_function
    585606        case OpCodes.VariableCondition: {
    586             throw new NotImplementedException();
    587           }
    588         default: throw new NotSupportedException();
     607            throw new NotSupportedException("Interpretation of symbol " + currentInstr.dynamicNode.Symbol.Name + " is not supported by the SymbolicDataAnalysisTreeILEmittingInterpreter");
     608          }
     609        default: throw new NotSupportedException("Interpretation of symbol " + currentInstr.dynamicNode.Symbol.Name + " is not supported by the SymbolicDataAnalysisTreeILEmittingInterpreter");
    589610      }
    590611    }
Note: See TracChangeset for help on using the changeset viewer.