Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/23/20 16:21:55 (4 years ago)
Author:
abeham
Message:

#2521:

  • Moving solution creator parameter from problems to algorithms (breaking wiring in some HeuristicOptimizationProblems)
  • Disallowing evaluator or encoding changes in encoding-specific base problems (to avoid confusion in derived problems whether this needs to be handled or not)
  • Added private set to ReferenceParameter property (serialization)
Location:
branches/2521_ProblemRefactoring/HeuristicLab.Encodings.IntegerVectorEncoding/3.3
Files:
2 edited

Legend:

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

    r17620 r17695  
    2222#endregion
    2323
     24using System;
    2425using System.Linq;
    2526using HEAL.Attic;
     
    6667    protected IntegerVectorMultiObjectiveProblem(IntegerVectorEncoding encoding) : base(encoding) {
    6768      EncodingParameter.ReadOnly = true;
     69      EvaluatorParameter.ReadOnly = true;
    6870      Parameters.Add(BestResultParameter = new ResultParameter<ParetoFrontScatterPlot<IntegerVector>>("Best Pareto Front", "The best Pareto front found."));
    6971      Parameters.Add(DimensionRefParameter = new ReferenceParameter<IntValue>("Dimension", "The dimension of the integer vector problem.", Encoding.LengthParameter));
     
    8486
    8587      BestResultParameter.ActualValue = plot;
     88    }
     89
     90    protected override sealed void OnEvaluatorChanged() {
     91      throw new InvalidOperationException("Evaluator may not change!");
     92    }
     93
     94    protected override sealed void OnEncodingChanged() {
     95      throw new InvalidOperationException("Encoding may not change!");
    8696    }
    8797
  • branches/2521_ProblemRefactoring/HeuristicLab.Encodings.IntegerVectorEncoding/3.3/IntegerVectorProblem.cs

    r17620 r17695  
    2222#endregion
    2323
     24using System;
    2425using System.Linq;
    2526using HEAL.Attic;
     
    6768    protected IntegerVectorProblem(IntegerVectorEncoding encoding) : base(encoding) {
    6869      EncodingParameter.ReadOnly = true;
     70      EvaluatorParameter.ReadOnly = true;
    6971      Parameters.Add(BestResultParameter = new ResultParameter<IntegerVector>("Best Solution", "The best solution."));
    7072      Parameters.Add(DimensionRefParameter = new ReferenceParameter<IntValue>("Dimension", "The dimension of the integer vector problem.", Encoding.LengthParameter));
     
    8587
    8688      results.AddOrUpdateResult("Best Solution", (IItem)best.Item1.Clone());
     89    }
     90
     91    protected override sealed void OnEvaluatorChanged() {
     92      throw new InvalidOperationException("Evaluator may not change!");
     93    }
     94
     95    protected override sealed void OnEncodingChanged() {
     96      throw new InvalidOperationException("Encoding may not change!");
    8797    }
    8898
Note: See TracChangeset for help on using the changeset viewer.