Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
08/03/09 12:26:42 (15 years ago)
Author:
gkronber
Message:

Merged changes from GP-refactoring branch back into the trunk #713.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/Evaluators/VariableQualityImpactCalculator.cs

    r2165 r2222  
    2121
    2222using System;
    23 using System.Collections.Generic;
    24 using System.Text;
    25 using System.Xml;
    2623using HeuristicLab.Core;
    2724using HeuristicLab.Data;
    2825using HeuristicLab.DataAnalysis;
    29 using System.Linq;
     26using HeuristicLab.GP.Interfaces;
    3027
    3128namespace HeuristicLab.GP.StructureIdentification {
     
    3532      : base() {
    3633      AddVariableInfo(new VariableInfo("TreeEvaluator", "The evaluator that should be used to evaluate the expression tree", typeof(ITreeEvaluator), VariableKind.In));
    37       AddVariableInfo(new VariableInfo("FunctionTree", "The function tree that should be evaluated", typeof(IFunctionTree), VariableKind.In));
     34      AddVariableInfo(new VariableInfo("FunctionTree", "The function tree that should be evaluated", typeof(IGeneticProgrammingModel), VariableKind.In));
    3835      AddVariableInfo(new VariableInfo("TreeSize", "Size (number of nodes) of the tree to evaluate", typeof(IntData), VariableKind.In));
    3936      AddVariableInfo(new VariableInfo("PunishmentFactor", "Punishment factor for invalid estimations", typeof(DoubleData), VariableKind.In));
     
    4239    protected override double CalculateQuality(IScope scope, Dataset dataset, int targetVariable, int start, int end) {
    4340      ITreeEvaluator evaluator = GetVariableValue<ITreeEvaluator>("TreeEvaluator", scope, true);
    44       IFunctionTree tree = GetVariableValue<IFunctionTree>("FunctionTree", scope, true);
     41      IGeneticProgrammingModel gpModel = GetVariableValue<IGeneticProgrammingModel>("FunctionTree", scope, true);
    4542      double punishmentFactor = GetVariableValue<DoubleData>("PunishmentFactor", scope, true).Data;
    46       evaluator.PrepareForEvaluation(dataset, targetVariable, start, end, punishmentFactor, tree);
     43      evaluator.PrepareForEvaluation(dataset, targetVariable, start, end, punishmentFactor, gpModel.FunctionTree);
    4744
    4845      double[,] result = new double[end - start, 2];
Note: See TracChangeset for help on using the changeset viewer.