Changeset 10068 for branches/GrammaticalEvolution/HeuristicLab.Problems.GrammaticalEvolution/GEArtificialAntEvaluator.cs
- Timestamp:
- 10/20/13 18:44:04 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/GrammaticalEvolution/HeuristicLab.Problems.GrammaticalEvolution/GEArtificialAntEvaluator.cs
r10039 r10068 23 23 using HeuristicLab.Core; 24 24 using HeuristicLab.Data; 25 using HeuristicLab.Encodings.IntegerVectorEncoding; 25 26 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 26 using HeuristicLab.Problems.ArtificialAnt;27 27 using HeuristicLab.Operators; 28 28 using HeuristicLab.Optimization; 29 29 using HeuristicLab.Parameters; 30 30 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 31 using HeuristicLab. Encodings.IntegerVectorEncoding;31 using HeuristicLab.Problems.ArtificialAnt; 32 32 using HeuristicLab.Problems.GrammaticalEvolution.Mappers; 33 33 … … 38 38 ISingleObjectiveEvaluator, ISymbolicExpressionTreeGrammarBasedOperator { 39 39 40 40 #region Parameter Properties 41 41 public ILookupParameter<DoubleValue> QualityParameter { 42 42 get { return (ILookupParameter<DoubleValue>)Parameters["Quality"]; } 43 43 } 44 45 44 // genotype: 45 public ILookupParameter<IntegerVector> IntegerVectorParameter { 46 46 get { return (ILookupParameter<IntegerVector>)Parameters["IntegerVector"]; } 47 47 } 48 48 // phenotype: 49 49 public ILookupParameter<SymbolicExpressionTree> SymbolicExpressionTreeParameter { 50 50 get { return (ILookupParameter<SymbolicExpressionTree>)Parameters["SymbolicExpressionTree"]; } … … 56 56 get { return (ILookupParameter<IntValue>)Parameters["MaxTimeSteps"]; } 57 57 } 58 58 public IValueLookupParameter<ISymbolicExpressionGrammar> SymbolicExpressionTreeGrammarParameter { 59 59 get { return (IValueLookupParameter<ISymbolicExpressionGrammar>)Parameters["SymbolicExpressionTreeGrammar"]; } 60 60 } 61 62 61 // genotype-to-phenotype-mapper: 62 public ILookupParameter<IGenotypeToPhenotypeMapper> GenotypeToPhenotypeMapperParameter { 63 63 get { return (ILookupParameter<IGenotypeToPhenotypeMapper>)Parameters["GenotypeToPhenotypeMapper"]; } 64 64 } 65 66 65 #endregion 66 67 67 [StorableConstructor] 68 68 protected GEArtificialAntEvaluator(bool deserializing) : base(deserializing) { } … … 81 81 82 82 public sealed override IOperation Apply() { 83 SymbolicExpressionTree expression = GenotypeToPhenotypeMapperParameter.ActualValue.Map 83 SymbolicExpressionTree expression = GenotypeToPhenotypeMapperParameter.ActualValue.Map( 84 84 SymbolicExpressionTreeGrammarParameter.ActualValue, 85 IntegerVectorParameter.ActualValue 85 IntegerVectorParameter.ActualValue 86 86 ); 87 87 SymbolicExpressionTreeParameter.ActualValue = expression; 88 88 BoolMatrix world = WorldParameter.ActualValue; 89 89 IntValue maxTimeSteps = MaxTimeStepsParameter.ActualValue; 90 90 91 91 AntInterpreter interpreter = new AntInterpreter(); 92 interpreter.MaxTimeSteps 93 interpreter.World 94 interpreter.Expression 92 interpreter.MaxTimeSteps = maxTimeSteps.Value; 93 interpreter.World = world; 94 interpreter.Expression = expression; 95 95 interpreter.Run(); 96 96
Note: See TracChangeset
for help on using the changeset viewer.