Free cookie consent management tool by TermsFeed Policy Generator

Changeset 483


Ignore:
Timestamp:
08/10/08 14:24:30 (16 years ago)
Author:
gkronber
Message:

fixed a bug uncovered by r482

Location:
trunk/sources
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Functions/BakedFunctionTree.cs

    r396 r483  
    270270    }
    271271
    272     public IEvaluator CreateEvaluator(Dataset dataset) {
    273       return new BakedTreeEvaluator(dataset);
     272    public IEvaluator CreateEvaluator() {
     273      return new BakedTreeEvaluator();
    274274    }
    275275
  • trunk/sources/HeuristicLab.Functions/BakedTreeEvaluator.cs

    r477 r483  
    4848
    4949
    50     public BakedTreeEvaluator(Dataset dataset) {
    51       this.dataset = dataset;
     50    public BakedTreeEvaluator() {
    5251      codeArr = new Instr[MAX_TREE_SIZE];
    5352      for(int i = 0; i < MAX_TREE_SIZE; i++) {
     
    5655    }
    5756
    58     public void ResetEvaluator(IFunctionTree functionTree) {
     57    public void ResetEvaluator(IFunctionTree functionTree, Dataset dataset) {
     58      this.dataset = dataset;
    5959      List<LightWeightFunction> linearRepresentation = ((BakedFunctionTree)functionTree).LinearRepresentation;
    6060      int i = 0;
  • trunk/sources/HeuristicLab.Functions/IEvaluator.cs

    r396 r483  
    33using System.Linq;
    44using System.Text;
     5using HeuristicLab.DataAnalysis;
    56
    67namespace HeuristicLab.Functions {
    78  public interface IEvaluator {
    8     void ResetEvaluator(IFunctionTree functionTree);
     9    void ResetEvaluator(IFunctionTree functionTree, Dataset dataset);
    910    double Evaluate(int sampleIndex);
    1011  }
  • trunk/sources/HeuristicLab.Functions/IFunctionTree.cs

    r396 r483  
    4040    void RemoveSubTree(int index);
    4141
    42     IEvaluator CreateEvaluator(Dataset dataset);
     42    IEvaluator CreateEvaluator();
    4343  }
    4444}
  • trunk/sources/HeuristicLab.StructureIdentification/Evaluation/GPEvaluatorBase.cs

    r482 r483  
    8787
    8888      // initialize and reset the evaluator
    89       if(evaluator == null) evaluator = functionTree.CreateEvaluator(dataset);
    90       evaluator.ResetEvaluator(functionTree);
     89      if(evaluator == null) evaluator = functionTree.CreateEvaluator();
     90      evaluator.ResetEvaluator(functionTree, dataset);
    9191      evaluatedSamples = 0;
    9292
     
    9797      // update the value of total evaluated nodes
    9898      scope.GetVariableValue<DoubleData>("TotalEvaluatedNodes", true).Data = totalEvaluatedNodes + treeSize * evaluatedSamples;
    99       // write the calculate quality value
    10099      return null;
    101100    }
Note: See TracChangeset for help on using the changeset viewer.