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.Algorithms.GradientDescent/3.3/Lbfgs.cs

    r17226 r17695  
    2323using System;
    2424using System.Linq;
     25using HEAL.Attic;
    2526using HeuristicLab.Analysis;
    2627using HeuristicLab.Common;
     
    3132using HeuristicLab.Optimization;
    3233using HeuristicLab.Parameters;
    33 using HEAL.Attic;
    3434using HeuristicLab.Random;
    3535
     
    199199      if (Problem != null) {
    200200        RegisterEvents();
    201         solutionCreator.OperatorParameter.ActualName = Problem.SolutionCreatorParameter.Name;
     201        solutionCreator.OperatorParameter.ActualName = SolutionCreatorParameter.Name;
    202202        solutionCreator.OperatorParameter.Hidden = true;
    203203        evaluator.OperatorParameter.ActualName = Problem.EvaluatorParameter.Name;
     
    208208    }
    209209
    210     protected override void Problem_SolutionCreatorChanged(object sender, EventArgs e) {
    211       base.Problem_SolutionCreatorChanged(sender, e);
     210    protected override void SolutionCreatorOnChanged() {
     211      base.SolutionCreatorOnChanged();
    212212      RegisterSolutionCreatorEvents();
    213213      ParameterizeOperators();
     
    223223      base.Problem_OperatorsChanged(sender, e);
    224224      RegisterEvents();
    225       solutionCreator.OperatorParameter.ActualName = Problem.SolutionCreatorParameter.Name;
     225      solutionCreator.OperatorParameter.ActualName = SolutionCreatorParameter.Name;
    226226      solutionCreator.OperatorParameter.Hidden = true;
    227227      evaluator.OperatorParameter.ActualName = Problem.EvaluatorParameter.Name;
     
    232232
    233233    private void RegisterSolutionCreatorEvents() {
    234       var realVectorCreator = Problem.SolutionCreator as IRealVectorCreator;
     234      var realVectorCreator = SolutionCreator as IRealVectorCreator;
    235235      // ignore if we have a different kind of problem
    236236      if (realVectorCreator != null) {
     
    245245
    246246    protected override void OnStarted() {
    247       var realVectorCreator = Problem.SolutionCreator as IRealVectorCreator;
     247      var realVectorCreator = SolutionCreator as IRealVectorCreator;
    248248      // must catch the case that user loaded an unsupported problem
    249249      if (realVectorCreator == null)
     
    269269
    270270    private void ParameterizeOperators() {
    271       var realVectorCreator = Problem.SolutionCreator as IRealVectorCreator;
     271      var realVectorCreator = SolutionCreator as IRealVectorCreator;
    272272      // ignore if we have a different kind of problem
    273273      if (realVectorCreator != null) {
Note: See TracChangeset for help on using the changeset viewer.