Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/18/20 18:55:08 (4 years ago)
Author:
abeham
Message:

#2521: worked on refactoring, worked a lot on binary encoding / problems

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.Binary/3.3/HIFFProblem.cs

    r17382 r17544  
    2727using HeuristicLab.Common;
    2828using HeuristicLab.Core;
     29using HeuristicLab.Data;
    2930using HeuristicLab.Encodings.BinaryVectorEncoding;
    3031using HeuristicLab.Optimization;
     
    3536  [Creatable(CreatableAttribute.Categories.CombinatorialProblems, Priority = 220)]
    3637  public class HIFFProblem : BinaryVectorProblem {
    37     [StorableConstructor]
    38     protected HIFFProblem(StorableConstructorFlag _) : base(_) { }
    39     protected HIFFProblem(HIFFProblem original, Cloner cloner)
    40       : base(original, cloner) {
    41     }
    42     public override IDeepCloneable Clone(Cloner cloner) {
    43       return new HIFFProblem(this, cloner);
    44     }
    4538
    4639    public HIFFProblem() : base() {
    4740      Maximization = true;
    48       Encoding.Length = 64;
     41      DimensionRefParameter.ForceValue(new IntValue(64, @readonly: false));
    4942    }
     43
    5044    // In the GECCO paper, Section 4.1
    5145    public override ISingleObjectiveEvaluationResult Evaluate(BinaryVector individual, IRandom random, CancellationToken cancellationToken) {
     
    8781      return new SingleObjectiveEvaluationResult(quality);
    8882    }
     83
     84    [StorableConstructor]
     85    protected HIFFProblem(StorableConstructorFlag _) : base(_) { }
     86    protected HIFFProblem(HIFFProblem original, Cloner cloner)
     87      : base(original, cloner) {
     88    }
     89    public override IDeepCloneable Clone(Cloner cloner) {
     90      return new HIFFProblem(this, cloner);
     91    }
    8992  }
    9093}
Note: See TracChangeset for help on using the changeset viewer.