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.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.