Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
09/15/20 17:09:10 (4 years ago)
Author:
abeham
Message:

#2521: worked on refactoring

  • add results to problem base classes
  • fix external evaluation problem
  • Add result descriptions
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2521_ProblemRefactoring/HeuristicLab.Encodings.LinearLinkageEncoding/3.4/LinearLinkageMultiObjectiveProblem.cs

    r17695 r17747  
    3636  public abstract class LinearLinkageMultiObjectiveProblem : MultiObjectiveProblem<LinearLinkageEncoding, LinearLinkage> {
    3737    [Storable] protected ReferenceParameter<IntValue> DimensionRefParameter { get; private set; }
    38     public IValueParameter<IntValue> DimensionParameter => DimensionRefParameter;
     38    [Storable] public IResult<ParetoFrontScatterPlot<LinearLinkage>> BestParetoFrontResult { get; private set; }
    3939
    4040    public int Dimension {
    4141      get { return DimensionRefParameter.Value.Value; }
    4242      set { DimensionRefParameter.Value.Value = value; }
     43    }
     44
     45    protected ParetoFrontScatterPlot<LinearLinkage> BestParetoFront {
     46      get => BestParetoFrontResult.Value;
     47      set => BestParetoFrontResult.Value = value;
    4348    }
    4449
     
    5358      : base(original, cloner) {
    5459      DimensionRefParameter = cloner.Clone(original.DimensionRefParameter);
     60      BestParetoFrontResult = cloner.Clone(original.BestParetoFrontResult);
     61
    5562      RegisterEventHandlers();
    5663    }
     
    6168      EvaluatorParameter.ReadOnly = true;
    6269      Parameters.Add(DimensionRefParameter = new ReferenceParameter<IntValue>("Dimension", "The dimension of the linear linkage problem.", Encoding.LengthParameter));
    63 
     70      Results.Add(BestParetoFrontResult = new Result<ParetoFrontScatterPlot<LinearLinkage>>("Best Pareto Front", "The best Pareto front found so far."));
    6471
    6572      Operators.Add(new HammingSimilarityCalculator());
     
    7582      var fronts = DominationCalculator.CalculateAllParetoFrontsIndices(individuals, qualities, Maximization);
    7683      var plot = new ParetoFrontScatterPlot<LinearLinkage>(fronts, individuals, qualities, Objectives, BestKnownFront);
    77       results.AddOrUpdateResult("Pareto Front Scatter Plot", plot);
     84
     85      BestParetoFront = plot;
    7886    }
    7987
Note: See TracChangeset for help on using the changeset viewer.