Free cookie consent management tool by TermsFeed Policy Generator

Changeset 13631


Ignore:
Timestamp:
02/23/16 22:04:59 (9 years ago)
Author:
abeham
Message:

#2551: merged r13491,r13498,r13500 to stable

Location:
stable
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • stable

  • stable/HeuristicLab.Problems.ExternalEvaluation/3.4/ExternalEvaluationProblem.cs

    r13259 r13631  
    5959      get { return (IFixedValueParameter<SingleObjectiveOptimizationSupportScript>)Parameters["SupportScript"]; }
    6060    }
     61
     62    private IFixedValueParameter<BoolValue> MaximizationParameter {
     63      get { return (IFixedValueParameter<BoolValue>)Parameters["Maximization"]; }
     64    }
    6165    #endregion
    6266
    6367    #region Properties
     68    public new IEncoding Encoding {
     69      get { return base.Encoding; }
     70      set { base.Encoding = value; }
     71    }
    6472    public EvaluationCache Cache {
    6573      get { return CacheParameter.Value; }
     
    100108    public override bool Maximization {
    101109      get { return Parameters.ContainsKey("Maximization") && ((IValueParameter<BoolValue>)Parameters["Maximization"]).Value.Value; }
     110    }
     111
     112    public virtual void SetMaximization(bool maximization) {
     113      MaximizationParameter.Value.Value = maximization;
    102114    }
    103115
  • stable/HeuristicLab.Problems.ExternalEvaluation/3.4/MultiObjectiveExternalEvaluationProblem.cs

    r13259 r13631  
    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
    6064    #region Properties
     65    public new IEncoding Encoding {
     66      get { return base.Encoding; }
     67      set { base.Encoding = value; }
     68    }
    6169    public EvaluationCache Cache {
    6270      get { return CacheParameter.Value; }
     
    97105        return Parameters.ContainsKey("Maximization") ? ((IValueParameter<BoolArray>)Parameters["Maximization"]).Value.ToArray() : new bool[0];
    98106      }
     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];
    99114    }
    100115
Note: See TracChangeset for help on using the changeset viewer.