Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/23/15 16:14:57 (9 years ago)
Author:
mkommend
Message:

#2521: Rectored problems and encodings.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/ProblemRefactoring/HeuristicLab.Algorithms.ParameterlessPopulationPyramid/3.3/EvaluationTracker.cs

    r12057 r13339  
    2626using HeuristicLab.Data;
    2727using HeuristicLab.Encodings.BinaryVectorEncoding;
     28using HeuristicLab.Optimization;
    2829using HeuristicLab.Parameters;
    2930using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    30 using HeuristicLab.Problems.Binary;
    3131
    3232namespace HeuristicLab.Algorithms.ParameterlessPopulationPyramid {
     
    3434  // B. W. Goldman and W. F. Punch, "Parameter-less Population Pyramid," GECCO, pp. 785–792, 2014
    3535  // and the original source code in C++11 available from: https://github.com/brianwgoldman/Parameter-less_Population_Pyramid
    36   internal sealed class EvaluationTracker : BinaryProblem {
    37     private readonly BinaryProblem problem;
     36  internal sealed class EvaluationTracker : SingleObjectiveProblem<BinaryVectorEncoding, BinaryVector> {
     37    private readonly ISingleObjectiveProblem<BinaryVectorEncoding, BinaryVector> problem;
    3838
    3939    private int maxEvaluations;
     
    5959      private set;
    6060    }
     61
     62    public new BinaryVectorEncoding Encoding {
     63      get { return problem.Encoding; }
     64    }
    6165    #endregion
    6266
     
    7579      return new EvaluationTracker(this, cloner);
    7680    }
    77     public EvaluationTracker(BinaryProblem problem, int maxEvaluations) {
     81    public EvaluationTracker(ISingleObjectiveProblem<BinaryVectorEncoding, BinaryVector> problem, int maxEvaluations) {
    7882      this.problem = problem;
    7983      this.maxEvaluations = maxEvaluations;
    80       BestSolution = new BinaryVector(Length);
     84      BestSolution = new BinaryVector(problem.Encoding.Length);
    8185      BestQuality = double.NaN;
    8286      Evaluations = 0;
     
    99103    }
    100104
    101     public override int Length {
    102       get { return problem.Length; }
    103       set { problem.Length = value; }
    104     }
    105 
    106105    public override bool Maximization {
    107106      get {
Note: See TracChangeset for help on using the changeset viewer.