Changeset 13339 for branches/ProblemRefactoring/HeuristicLab.Algorithms.ParameterlessPopulationPyramid/3.3/EvaluationTracker.cs
- Timestamp:
- 11/23/15 16:14:57 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ProblemRefactoring/HeuristicLab.Algorithms.ParameterlessPopulationPyramid/3.3/EvaluationTracker.cs
r12057 r13339 26 26 using HeuristicLab.Data; 27 27 using HeuristicLab.Encodings.BinaryVectorEncoding; 28 using HeuristicLab.Optimization; 28 29 using HeuristicLab.Parameters; 29 30 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 30 using HeuristicLab.Problems.Binary;31 31 32 32 namespace HeuristicLab.Algorithms.ParameterlessPopulationPyramid { … … 34 34 // B. W. Goldman and W. F. Punch, "Parameter-less Population Pyramid," GECCO, pp. 785–792, 2014 35 35 // 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 BinaryProblemproblem;36 internal sealed class EvaluationTracker : SingleObjectiveProblem<BinaryVectorEncoding, BinaryVector> { 37 private readonly ISingleObjectiveProblem<BinaryVectorEncoding, BinaryVector> problem; 38 38 39 39 private int maxEvaluations; … … 59 59 private set; 60 60 } 61 62 public new BinaryVectorEncoding Encoding { 63 get { return problem.Encoding; } 64 } 61 65 #endregion 62 66 … … 75 79 return new EvaluationTracker(this, cloner); 76 80 } 77 public EvaluationTracker( BinaryProblemproblem, int maxEvaluations) {81 public EvaluationTracker(ISingleObjectiveProblem<BinaryVectorEncoding, BinaryVector> problem, int maxEvaluations) { 78 82 this.problem = problem; 79 83 this.maxEvaluations = maxEvaluations; 80 BestSolution = new BinaryVector( Length);84 BestSolution = new BinaryVector(problem.Encoding.Length); 81 85 BestQuality = double.NaN; 82 86 Evaluations = 0; … … 99 103 } 100 104 101 public override int Length {102 get { return problem.Length; }103 set { problem.Length = value; }104 }105 106 105 public override bool Maximization { 107 106 get {
Note: See TracChangeset
for help on using the changeset viewer.