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.RealVectorEncoding/3.3/RealVectorProblem.cs

    r17620 r17695  
    2222#endregion
    2323
     24using System;
    2425using System.Linq;
    2526using HEAL.Attic;
     
    6566    protected RealVectorProblem(RealVectorEncoding encoding) : base(encoding) {
    6667      EncodingParameter.ReadOnly = true;
     68      EvaluatorParameter.ReadOnly = true;
    6769      Parameters.Add(DimensionRefParameter = new ReferenceParameter<IntValue>("Dimension", "The dimension of the real vector problem.", Encoding.LengthParameter));
    6870      Parameters.Add(BoundsRefParameter = new ReferenceParameter<DoubleMatrix>("Bounds", "The bounding box of the values.", Encoding.BoundsParameter));
     
    8385
    8486      results.AddOrUpdateResult("Best Solution", (IItem)best.Item1.Clone());
     87    }
     88
     89    protected override sealed void OnEvaluatorChanged() {
     90      throw new InvalidOperationException("Evaluator may not change!");
     91    }
     92
     93    protected override sealed void OnEncodingChanged() {
     94      throw new InvalidOperationException("Encoding may not change!");
    8595    }
    8696
Note: See TracChangeset for help on using the changeset viewer.