Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/24/15 17:22:41 (9 years ago)
Author:
mkommend
Message:

#2521: Fixed all problems.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/ProblemRefactoring/HeuristicLab.Problems.GrammaticalEvolution/3.4/ArtificialAnt/GEArtificialAntProblem.cs

    r13336 r13372  
    3838  [Creatable(CreatableAttribute.Categories.GeneticProgrammingProblems, Priority = 170)]
    3939  [StorableClass]
    40   public sealed class GEArtificialAntProblem : SingleObjectiveProblem<IntegerVectorEncoding>, IStorableContent {
    41     public string Filename { get; set; }
     40  public sealed class GEArtificialAntProblem : SingleObjectiveProblem<IntegerVectorEncoding, IntegerVector> {
    4241
    4342    #region Parameter Properties
     
    9998
    10099    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) {
    104101      var bounds = Encoding.Bounds;
    105102      var len = Encoding.Length;
     
    113110        fastRand = new FastRandom(random.Next());
    114111      }
    115       var tree = mapper.Map(fastRand, bounds, len, grammar, vector);
     112      var tree = mapper.Map(fastRand, bounds, len, grammar, solution);
    116113
    117114      Interpreter interpreter = new Interpreter(tree, World, MaxTimeSteps);
     
    121118    }
    122119
    123     public override void Analyze(Individual[] individuals, double[] qualities, ResultCollection results, IRandom random) {
     120    public override void Analyze(IntegerVector[] solutions, double[] qualities, ResultCollection results, IRandom random) {
    124121      var bounds = Encoding.Bounds;
    125122      var len = Encoding.Length;
     
    127124      var mapper = GenotypeToPhenotypeMapperParameter.Value;
    128125
    129       var trees = individuals
    130         .Select(ind => mapper.Map(random, bounds, len, grammar, ind.IntegerVector()))
     126      var trees = solutions
     127        .Select(ind => mapper.Map(random, bounds, len, grammar, ind))
    131128        .ToArray();
    132129
Note: See TracChangeset for help on using the changeset viewer.