Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/02/10 18:10:15 (15 years ago)
Author:
gkronber
Message:

Implemented #824 (Refactor: ITreeEvaluator interface to provide a method that evaluates a tree on a range of samples.)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/BaseClasses/TreeEvaluatorBase.cs

    r2364 r2578  
    6060    }
    6161
    62     public void PrepareForEvaluation(Dataset dataset, IFunctionTree functionTree) {
     62    [Obsolete]
     63    public virtual void PrepareForEvaluation(Dataset dataset, IFunctionTree functionTree) {
    6364      this.dataset = dataset;
    6465      codeArr = new Instr[functionTree.GetSize()];
     
    9495    }
    9596
    96     public double Evaluate(int sampleIndex) {
     97    [Obsolete]
     98    public virtual double Evaluate(int sampleIndex) {
    9799      PC = 0;
    98100      this.sampleIndex = sampleIndex;
     
    101103      if (double.IsNaN(estimated)) estimated = UpperEvaluationLimit;
    102104      return estimated;
     105    }
     106
     107    public virtual IEnumerable<double> Evaluate(Dataset dataset, IFunctionTree tree, IEnumerable<int> rows) {
     108      PrepareForEvaluation(dataset, tree);
     109      foreach (int row in rows)
     110        yield return Evaluate(row);
    103111    }
    104112
Note: See TracChangeset for help on using the changeset viewer.