Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
02/12/15 21:49:06 (9 years ago)
Author:
mkommend
Message:

#2282: Fixed maximization flag and solution creators for binary problems.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Optimization/3.3/BasicProblems/BasicProblem.cs

    r11982 r11996  
    6767      Parameters.Add(new ValueParameter<TEncoding>("Encoding", "Describes the configuration of the encoding, what the variables are called, what type they are and their bounds if any."));
    6868      oldEncoding = Encoding;
     69      Parameterize();
    6970      RegisterEvents();
    7071    }
     
    9192
    9293    protected virtual void OnEncodingChanged() {
     94      Parameterize();
     95
     96      OnOperatorsChanged();
     97      OnReset();
     98    }
     99
     100    private void Parameterize() {
    93101      if (oldEncoding != null) {
    94102        AdaptEncodingOperators(oldEncoding, Encoding);
     
    107115        Encoding.SolutionCreator);
    108116      Parameters.Remove(SolutionCreatorParameter);
    109       Parameters.Add(solutionCreatorParam); 
    110       ((IValueParameter)solutionCreatorParam).ValueChanged += SolutionCreatorParameter_ValueChanged;     
     117      Parameters.Add(solutionCreatorParam);
     118      ((IValueParameter)solutionCreatorParam).ValueChanged += SolutionCreatorParameter_ValueChanged;
    111119
    112120      var multiEncoding = Encoding as MultiEncoding;
    113121      if (multiEncoding != null) multiEncoding.EncodingsChanged += MultiEncodingOnEncodingsChanged;
    114 
    115       OnOperatorsChanged();
    116       OnReset();
    117122    }
    118123
Note: See TracChangeset for help on using the changeset viewer.