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/SingleObjectiveBasicProblem.cs

    r11990 r11996  
    5959    protected SingleObjectiveBasicProblem()
    6060      : base() {
    61       Parameters.Add(new FixedValueParameter<BoolValue>("Maximization", "Set to false if the problem should be minimized.", new BoolValue()));
     61      Parameters.Add(new FixedValueParameter<BoolValue>("Maximization", "Set to false if the problem should be minimized.", (BoolValue)new BoolValue(Maximization).AsReadOnly()) { Hidden = true });
    6262      Parameters.Add(new OptionalValueParameter<DoubleValue>("BestKnownQuality", "The quality of the best known solution of this problem."));
    6363
     
    8282    public virtual IEnumerable<Individual> GetNeighbors(Individual individual, IRandom random) {
    8383      return Enumerable.Empty<Individual>();
    84     }
    85 
    86 
    87     protected override void OnEncodingChanged() {
    88       base.OnEncodingChanged();
    89       var max = (BoolValue)Parameters["Maximization"].ActualValue;
    90       max.Value = Maximization;
    9184    }
    9285
Note: See TracChangeset for help on using the changeset viewer.