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.LinearLinkageEncoding/3.4
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/2521_ProblemRefactoring/HeuristicLab.Encodings.LinearLinkageEncoding/3.4/LinearLinkageMultiObjectiveProblem.cs

    r17620 r17695  
    2222#endregion
    2323
     24using System;
    2425using System.Linq;
    2526using HEAL.Attic;
     
    5859    protected LinearLinkageMultiObjectiveProblem(LinearLinkageEncoding encoding) : base(new LinearLinkageEncoding()) {
    5960      EncodingParameter.ReadOnly = true;
     61      EvaluatorParameter.ReadOnly = true;
    6062      Parameters.Add(DimensionRefParameter = new ReferenceParameter<IntValue>("Dimension", "The dimension of the linear linkage problem.", Encoding.LengthParameter));
    6163
     
    7476      var plot = new ParetoFrontScatterPlot<LinearLinkage>(fronts, individuals, qualities, Objectives, BestKnownFront);
    7577      results.AddOrUpdateResult("Pareto Front Scatter Plot", plot);
     78    }
     79
     80    protected override sealed void OnEvaluatorChanged() {
     81      throw new InvalidOperationException("Evaluator may not change!");
     82    }
     83
     84    protected override sealed void OnEncodingChanged() {
     85      throw new InvalidOperationException("Encoding may not change!");
    7686    }
    7787
  • branches/2521_ProblemRefactoring/HeuristicLab.Encodings.LinearLinkageEncoding/3.4/LinearLinkageProblem.cs

    r17620 r17695  
    2222#endregion
    2323
     24using System;
    2425using System.Linq;
    2526using HEAL.Attic;
     
    5859    protected LinearLinkageProblem(LinearLinkageEncoding encoding) : base(encoding) {
    5960      EncodingParameter.ReadOnly = true;
     61      EvaluatorParameter.ReadOnly = true;
    6062      Parameters.Add(DimensionRefParameter = new ReferenceParameter<IntValue>("Dimension", "The dimension of the linear linkage problem.", Encoding.LengthParameter));
    6163
     
    7476
    7577      results.AddOrUpdateResult("Best Solution", (Item)best.Item1.Clone());
     78    }
     79
     80    protected override sealed void OnEvaluatorChanged() {
     81      throw new InvalidOperationException("Evaluator may not change!");
     82    }
     83
     84    protected override sealed void OnEncodingChanged() {
     85      throw new InvalidOperationException("Encoding may not change!");
    7686    }
    7787
Note: See TracChangeset for help on using the changeset viewer.