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)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2521_ProblemRefactoring/HeuristicLab.Encodings.BinaryVectorEncoding/3.3/BinaryVectorProblem.cs

    r17620 r17695  
    2020#endregion
    2121
     22using System;
    2223using System.Linq;
    2324using HEAL.Attic;
     
    6364    protected BinaryVectorProblem(BinaryVectorEncoding encoding) : base(encoding) {
    6465      EncodingParameter.ReadOnly = true;
     66      EvaluatorParameter.ReadOnly = true;
    6567      Parameters.Add(DimensionRefParameter = new ReferenceParameter<IntValue>("Dimension", "The dimension of the binary vector problem.", Encoding.LengthParameter));
    6668      Results.Add(BestSolutionResult = new Result<ISingleObjectiveSolutionContext<BinaryVector>>("Best Solution"));
     
    8082      if (BestSolution == null || IsBetter(best, BestSolution))
    8183        BestSolution = best.Clone() as SingleObjectiveSolutionContext<BinaryVector>;
     84    }
     85
     86    protected override sealed void OnEvaluatorChanged() {
     87      throw new InvalidOperationException("Evaluator may not change!");
     88    }
     89
     90    protected override sealed void OnEncodingChanged() {
     91      throw new InvalidOperationException("Encoding may not change!");
    8292    }
    8393
Note: See TracChangeset for help on using the changeset viewer.