public sealed override IOperation InstrumentedApply() { SymbolicExpressionTree expression = SymbolicExpressionTreeParameter.ActualValue; BoolMatrix world = WorldParameter.ActualValue; IntValue maxTimeSteps = MaxTimeStepsParameter.ActualValue; AntInterpreter interpreter = new AntInterpreter(); interpreter.MaxTimeSteps = maxTimeSteps.Value; interpreter.World = world; interpreter.Expression = expression; interpreter.Run(); QualityParameter.ActualValue = new DoubleValue(interpreter.FoodEaten); return base.InstrumentedApply(); }
public sealed override IOperation InstrumentedApply() { SymbolicExpressionTree expression = SymbolicExpressionTreeParameter.ActualValue; BoolMatrix world = WorldParameter.ActualValue; IntValue maxTimeSteps = MaxTimeStepsParameter.ActualValue; AntInterpreter interpreter = new AntInterpreter(); interpreter.MaxTimeSteps = maxTimeSteps.Value; interpreter.World = world; interpreter.Expression = expression; interpreter.Run(); QualityParameter.ActualValue = new DoubleValue(interpreter.FoodEaten); return(base.InstrumentedApply()); }
public sealed override IOperation Apply() { SymbolicExpressionTree tree = GenotypeToPhenotypeMapperParameter.ActualValue.Map( RandomParameter.ActualValue, BoundsParameter.ActualValue, MaxExpressionLengthParameter.ActualValue.Value, SymbolicExpressionTreeGrammarParameter.ActualValue, IntegerVectorParameter.ActualValue ); SymbolicExpressionTreeParameter.ActualValue = tree; BoolMatrix world = WorldParameter.ActualValue; IntValue maxTimeSteps = MaxTimeStepsParameter.ActualValue; AntInterpreter interpreter = new AntInterpreter(); interpreter.MaxTimeSteps = maxTimeSteps.Value; interpreter.World = world; interpreter.Expression = tree; interpreter.Run(); QualityParameter.ActualValue = new DoubleValue(interpreter.FoodEaten); return null; }