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.IntegerVectorEncoding/3.3/IntegerVectorMultiObjectiveProblem.cs

    r17695 r17747  
    3535  [StorableType("11916b0f-4c34-4ece-acae-e28d11211b43")]
    3636  public abstract class IntegerVectorMultiObjectiveProblem : MultiObjectiveProblem<IntegerVectorEncoding, IntegerVector> {
    37     [Storable] protected IResultParameter<ParetoFrontScatterPlot<IntegerVector>> BestResultParameter { get; private set; }
    3837    [Storable] protected ReferenceParameter<IntValue> DimensionRefParameter { get; private set; }
    3938    [Storable] protected ReferenceParameter<IntMatrix> BoundsRefParameter { get; private set; }
     39    [Storable] public IResult<ParetoFrontScatterPlot<IntegerVector>> BestParetoFrontResult { get; private set; }
    4040
    4141    public int Dimension {
     
    4949    }
    5050
     51    protected ParetoFrontScatterPlot<IntegerVector> BestParetoFront {
     52      get => BestParetoFrontResult.Value;
     53      set => BestParetoFrontResult.Value = value;
     54    }
     55
    5156    [StorableConstructor]
    5257    protected IntegerVectorMultiObjectiveProblem(StorableConstructorFlag _) : base(_) { }
     
    5863    protected IntegerVectorMultiObjectiveProblem(IntegerVectorMultiObjectiveProblem original, Cloner cloner)
    5964      : base(original, cloner) {
    60       BestResultParameter = cloner.Clone(original.BestResultParameter);
    6165      DimensionRefParameter = cloner.Clone(original.DimensionRefParameter);
    6266      BoundsRefParameter = cloner.Clone(original.BoundsRefParameter);
     67      BestParetoFrontResult = cloner.Clone(original.BestParetoFrontResult);
    6368      RegisterEventHandlers();
    6469    }
     
    6873      EncodingParameter.ReadOnly = true;
    6974      EvaluatorParameter.ReadOnly = true;
    70       Parameters.Add(BestResultParameter = new ResultParameter<ParetoFrontScatterPlot<IntegerVector>>("Best Pareto Front", "The best Pareto front found."));
    7175      Parameters.Add(DimensionRefParameter = new ReferenceParameter<IntValue>("Dimension", "The dimension of the integer vector problem.", Encoding.LengthParameter));
    7276      Parameters.Add(BoundsRefParameter = new ReferenceParameter<IntMatrix>("Bounds", "The bounds of the integer vector problem.", Encoding.BoundsParameter));
     77      Results.Add(BestParetoFrontResult = new Result<ParetoFrontScatterPlot<IntegerVector>>("Best Pareto Front", "The best Pareto front found so far."));
    7378
    7479      Operators.Add(new HammingSimilarityCalculator());
     
    8590      var plot = new ParetoFrontScatterPlot<IntegerVector>(fronts, individuals, qualities, Objectives, BestKnownFront);
    8691
    87       BestResultParameter.ActualValue = plot;
     92      BestParetoFront = plot;
    8893    }
    8994
Note: See TracChangeset for help on using the changeset viewer.