Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/12/16 14:15:05 (9 years ago)
Author:
abeham
Message:

#2551: added SetMaximization method, because there's no way to add a setter to an overridden property

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.ExternalEvaluation/3.4/MultiObjectiveExternalEvaluationProblem.cs

    r13491 r13500  
    5656      get { return (IFixedValueParameter<MultiObjectiveOptimizationSupportScript>)Parameters["SupportScript"]; }
    5757    }
     58
     59    private IFixedValueParameter<BoolArray> MaximizationParameter {
     60      get { return (IFixedValueParameter<BoolArray>)Parameters["Maximization"]; }
     61    }
    5862    #endregion
    5963
     
    101105        return Parameters.ContainsKey("Maximization") ? ((IValueParameter<BoolArray>)Parameters["Maximization"]).Value.ToArray() : new bool[0];
    102106      }
     107    }
     108
     109    public virtual void SetMaximization(bool[] maximization) {
     110      ((IStringConvertibleArray)MaximizationParameter.Value).Length = maximization.Length;
     111      var array = MaximizationParameter.Value;
     112      for (var i = 0; i < maximization.Length; i++)
     113        array[i] = maximization[i];
    103114    }
    104115
Note: See TracChangeset for help on using the changeset viewer.