Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/10/08 18:42:44 (16 years ago)
Author:
gkronber
Message:

fixed bugs in plugin HL.GP.Boolean #340 (Plugin for genetic programming for boolean logic)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.GP.Boolean/Evaluator.cs

    r720 r730  
    3232    public Evaluator()
    3333      : base() {
    34       AddVariableInfo(new VariableInfo("FunctionTree", "The function tree representing the ant", typeof(IFunctionTree), VariableKind.In));
     34      AddVariableInfo(new VariableInfo("FunctionTree", "The function tree representing the ant", typeof(BakedFunctionTree), VariableKind.In));
    3535      AddVariableInfo(new VariableInfo("Dataset", "The boolean dataset (values 0.0 = false, 1.0=true)", typeof(Dataset), VariableKind.In));
    3636      AddVariableInfo(new VariableInfo("TargetVariable", "Index of the column of the dataset that holds the target variable", typeof(IntData), VariableKind.In));
    3737      AddVariableInfo(new VariableInfo("SamplesStart", "Start index of samples in dataset to evaluate", typeof(IntData), VariableKind.In));
    3838      AddVariableInfo(new VariableInfo("SamplesEnd", "End index of samples in dataset to evaluate", typeof(IntData), VariableKind.In));
    39       AddVariableInfo(new VariableInfo("MatchingCases", "", typeof(DoubleData), VariableKind.New | VariableKind.Out));
     39      AddVariableInfo(new VariableInfo("Errors", "", typeof(DoubleData), VariableKind.New | VariableKind.Out));
    4040    }
    4141
    4242    public override IOperation Apply(IScope scope) {
    43       IFunctionTree tree = GetVariableValue<IFunctionTree>("FunctionTree", scope, true);
     43      BakedFunctionTree tree = GetVariableValue<BakedFunctionTree>("FunctionTree", scope, true);
    4444      Dataset dataset = GetVariableValue<Dataset>("Dataset", scope, true);
    4545      int targetVariable = GetVariableValue<IntData>("TargetVariable", scope, true).Data;
     
    4949      BooleanTreeInterpreter interpreter = new BooleanTreeInterpreter();
    5050      interpreter.Reset(dataset, tree, targetVariable);
    51       int matchingCases = interpreter.GetNumberMatchingInstances(start, end);
     51      int errors = interpreter.GetNumberOfErrors(start, end);
    5252
    53       scope.AddVariable(new HeuristicLab.Core.Variable(scope.TranslateName("MatchingCases"), new DoubleData(matchingCases)));
     53      scope.AddVariable(new HeuristicLab.Core.Variable(scope.TranslateName("Errors"), new DoubleData(errors)));
    5454      return null;
    5555    }
Note: See TracChangeset for help on using the changeset viewer.