- Timestamp:
- 03/31/10 14:26:45 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.ArtificialAnt/3.3/Evaluator.cs
r3223 r3239 40 40 get { return (ILookupParameter<SymbolicExpressionTree>)Parameters["SymbolicExpressionTree"]; } 41 41 } 42 public ILookupParameter<BoolMatrix> WorldParameter { 43 get { return (ILookupParameter<BoolMatrix>)Parameters["World"]; } 44 } 45 public ILookupParameter<IntValue> MaxTimeStepsParameter { 46 get { return (ILookupParameter<IntValue>)Parameters["MaxTimeSteps"]; } 47 } 48 42 49 public Evaluator() 43 50 : base() { 44 51 Parameters.Add(new LookupParameter<DoubleValue>("Quality", "The quality of the evaluated artificial ant solution.")); 45 52 Parameters.Add(new LookupParameter<SymbolicExpressionTree>("SymbolicExpressionTree", "The artificial ant solution encoded as a symbolic expression tree that should be evaluated")); 53 Parameters.Add(new LookupParameter<BoolMatrix>("World", "The world for the artificial ant with scattered food items.")); 54 Parameters.Add(new LookupParameter<IntValue>("MaxTimeSteps", "The maximal number of time steps that the artificial ant should be simulated.")); 46 55 } 47 56 48 57 public sealed override IOperation Apply() { 58 SymbolicExpressionTree expression = SymbolicExpressionTreeParameter.ActualValue; 59 BoolMatrix world = WorldParameter.ActualValue; 60 IntValue maxTimeSteps = MaxTimeStepsParameter.ActualValue; 49 61 50 SymbolicExpressionTree solution = SymbolicExpressionTreeParameter.ActualValue;51 62 AntInterpreter interpreter = new AntInterpreter(); 52 interpreter.MaxTimeSteps = 600; 53 interpreter.Run(solution); 63 interpreter.MaxTimeSteps = maxTimeSteps.Value; 64 interpreter.World = world; 65 interpreter.Expression = expression; 66 interpreter.Run(); 54 67 55 68 QualityParameter.ActualValue = new DoubleValue(interpreter.FoodEaten);
Note: See TracChangeset
for help on using the changeset viewer.