Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
02/12/15 21:49:06 (10 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/MultiObjectiveBasicProblem.cs

    r11970 r11996  
    4141    protected MultiObjectiveBasicProblem()
    4242      : base() {
    43       Parameters.Add(new ValueParameter<BoolArray>("Maximization", "Set to false if the problem should be minimized.", new BoolArray()));
     43      Parameters.Add(new ValueParameter<BoolArray>("Maximization", "Set to false if the problem should be minimized.", (BoolArray)new BoolArray(Maximization).AsReadOnly()));
    4444
    4545      Operators.Add(Evaluator);
     
    5757    public abstract double[] Evaluate(Individual individual, IRandom random);
    5858    public virtual void Analyze(Individual[] individuals, double[][] qualities, ResultCollection results, IRandom random) { }
    59 
    60     protected override void OnEncodingChanged() {
    61       base.OnEncodingChanged();
    62       Parameters["Maximization"].ActualValue = new BoolArray(Maximization);
    63     }
    6459
    6560    protected override void OnOperatorsChanged() {
Note: See TracChangeset for help on using the changeset viewer.