Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/27/20 18:12:39 (4 years ago)
Author:
abeham
Message:

#2521 WIP refactoring:

  1. Introduce nicer type IResultDefinition for API users to avoid complex IParameter interface (hide ActualValue)
  2. Change result parameter to contexts (need quality and solution): only implemented for BinaryVectorProblem
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2521_ProblemRefactoring/HeuristicLab.Encodings.IntegerVectorEncoding/3.3/IntegerVectorProblem.cs

    r16950 r17522  
    3434  [StorableType("c6081457-a3de-45ce-9f47-e0eb1c851bd2")]
    3535  public abstract class IntegerVectorProblem : SingleObjectiveProblem<IntegerVectorEncoding, IntegerVector> {
     36    [Storable] protected IResultParameter<IntegerVector> BestResultParameter { get; private set; }
     37    public IResultDefinition<IntegerVector> BestResult { get => BestResultParameter; }
     38
    3639    public int Length {
    3740      get { return Encoding.Length; }
     
    4851    protected IntegerVectorProblem(IntegerVectorProblem original, Cloner cloner)
    4952      : base(original, cloner) {
     53      BestResultParameter = cloner.Clone(original.BestResultParameter);
    5054      RegisterEventHandlers();
    5155    }
     
    5458    protected IntegerVectorProblem(IntegerVectorEncoding encoding) : base(encoding) {
    5559      EncodingParameter.ReadOnly = true;
     60      Parameters.Add(BestResultParameter = new ResultParameter<IntegerVector>("Best Solution", "The best solution."));
    5661
    5762      Operators.Add(new HammingSimilarityCalculator());
Note: See TracChangeset for help on using the changeset viewer.