- Timestamp:
- 07/30/09 19:41:58 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/GP-Refactoring-713/sources/HeuristicLab.GP.SantaFe/3.3/Evaluator.cs
r1529 r2216 20 20 #endregion 21 21 22 using System;23 using System.Collections.Generic;24 using System.Linq;25 using System.Text;26 22 using HeuristicLab.Core; 27 23 using HeuristicLab.Data; 28 using HeuristicLab. DataAnalysis;24 using HeuristicLab.GP.Interfaces; 29 25 30 26 namespace HeuristicLab.GP.SantaFe { … … 32 28 public Evaluator() 33 29 : base() { 34 AddVariableInfo(new VariableInfo("FunctionTree", "The function tree representing the ant", typeof(I FunctionTree), VariableKind.In));30 AddVariableInfo(new VariableInfo("FunctionTree", "The function tree representing the ant", typeof(IGeneticProgrammingModel), VariableKind.In)); 35 31 AddVariableInfo(new VariableInfo("FoodEaten", "Number of food items that the ant found", typeof(DoubleData), VariableKind.New | VariableKind.Out)); 36 32 } 37 33 38 34 public override IOperation Apply(IScope scope) { 39 I FunctionTree tree = GetVariableValue<IFunctionTree>("FunctionTree", scope, false);35 IGeneticProgrammingModel gpModel = GetVariableValue<IGeneticProgrammingModel>("FunctionTree", scope, false); 40 36 AntInterpreter interpreter = new AntInterpreter(); 41 37 interpreter.MaxTimeSteps = 600; 42 interpreter.Run( tree);38 interpreter.Run(gpModel.FunctionTree); 43 39 44 40 scope.AddVariable(new HeuristicLab.Core.Variable(scope.TranslateName("FoodEaten"), new DoubleData(interpreter.FoodEaten)));
Note: See TracChangeset
for help on using the changeset viewer.