Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/30/09 19:41:58 (15 years ago)
Author:
gkronber
Message:

GP Refactoring #713

  • cleaned code
  • reintegrated GP.Boolean and GP.SantaFe
  • worked on serialization of function trees
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/GP-Refactoring-713/sources/HeuristicLab.GP.SantaFe/3.3/Evaluator.cs

    r1529 r2216  
    2020#endregion
    2121
    22 using System;
    23 using System.Collections.Generic;
    24 using System.Linq;
    25 using System.Text;
    2622using HeuristicLab.Core;
    2723using HeuristicLab.Data;
    28 using HeuristicLab.DataAnalysis;
     24using HeuristicLab.GP.Interfaces;
    2925
    3026namespace HeuristicLab.GP.SantaFe {
     
    3228    public Evaluator()
    3329      : base() {
    34       AddVariableInfo(new VariableInfo("FunctionTree", "The function tree representing the ant", typeof(IFunctionTree), VariableKind.In));
     30      AddVariableInfo(new VariableInfo("FunctionTree", "The function tree representing the ant", typeof(IGeneticProgrammingModel), VariableKind.In));
    3531      AddVariableInfo(new VariableInfo("FoodEaten", "Number of food items that the ant found", typeof(DoubleData), VariableKind.New | VariableKind.Out));
    3632    }
    3733
    3834    public override IOperation Apply(IScope scope) {
    39       IFunctionTree tree = GetVariableValue<IFunctionTree>("FunctionTree", scope, false);
     35      IGeneticProgrammingModel gpModel = GetVariableValue<IGeneticProgrammingModel>("FunctionTree", scope, false);
    4036      AntInterpreter interpreter = new AntInterpreter();
    4137      interpreter.MaxTimeSteps = 600;
    42       interpreter.Run(tree);
     38      interpreter.Run(gpModel.FunctionTree);
    4339
    4440      scope.AddVariable(new HeuristicLab.Core.Variable(scope.TranslateName("FoodEaten"), new DoubleData(interpreter.FoodEaten)));
Note: See TracChangeset for help on using the changeset viewer.