Changeset 13372 for branches/ProblemRefactoring/HeuristicLab.Problems.GrammaticalEvolution/3.4/ArtificialAnt/GEArtificialAntProblem.cs
- Timestamp:
- 11/24/15 17:22:41 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ProblemRefactoring/HeuristicLab.Problems.GrammaticalEvolution/3.4/ArtificialAnt/GEArtificialAntProblem.cs
r13336 r13372 38 38 [Creatable(CreatableAttribute.Categories.GeneticProgrammingProblems, Priority = 170)] 39 39 [StorableClass] 40 public sealed class GEArtificialAntProblem : SingleObjectiveProblem<IntegerVectorEncoding>, IStorableContent { 41 public string Filename { get; set; } 40 public sealed class GEArtificialAntProblem : SingleObjectiveProblem<IntegerVectorEncoding, IntegerVector> { 42 41 43 42 #region Parameter Properties … … 99 98 100 99 private readonly object syncRoot = new object(); 101 public override double Evaluate(Individual individual, IRandom random) { 102 var vector = individual.IntegerVector(); 103 100 public override double Evaluate(IntegerVector solution, IRandom random) { 104 101 var bounds = Encoding.Bounds; 105 102 var len = Encoding.Length; … … 113 110 fastRand = new FastRandom(random.Next()); 114 111 } 115 var tree = mapper.Map(fastRand, bounds, len, grammar, vector);112 var tree = mapper.Map(fastRand, bounds, len, grammar, solution); 116 113 117 114 Interpreter interpreter = new Interpreter(tree, World, MaxTimeSteps); … … 121 118 } 122 119 123 public override void Analyze(In dividual[] individuals, double[] qualities, ResultCollection results, IRandom random) {120 public override void Analyze(IntegerVector[] solutions, double[] qualities, ResultCollection results, IRandom random) { 124 121 var bounds = Encoding.Bounds; 125 122 var len = Encoding.Length; … … 127 124 var mapper = GenotypeToPhenotypeMapperParameter.Value; 128 125 129 var trees = individuals130 .Select(ind => mapper.Map(random, bounds, len, grammar, ind .IntegerVector()))126 var trees = solutions 127 .Select(ind => mapper.Map(random, bounds, len, grammar, ind)) 131 128 .ToArray(); 132 129
Note: See TracChangeset
for help on using the changeset viewer.