Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/16/15 11:14:50 (9 years ago)
Author:
mkommend
Message:

#2174: Changed operator parameterization in programmable problem.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/New/MultiObjectiveProgrammableProblem.cs

    r11780 r11786  
    2121
    2222using System.Linq;
    23 using HeuristicLab.Analysis;
    2423using HeuristicLab.Common;
    2524using HeuristicLab.Core;
     
    4342    protected MultiObjectiveProgrammableProblem()
    4443      : base() {
    45         Parameters.Add(new ValueParameter<BoolArray>("Maximization", "Set to false if the problem should be minimized.", new BoolArray(Maximization)));
     44      Parameters.Add(new ValueParameter<BoolArray>("Maximization", "Set to false if the problem should be minimized.", new BoolArray()));
    4645
    4746      Operators.Add(Evaluator);
    48       Operators.Add(new BestScopeSolutionAnalyzer());
    4947      Operators.Add(new MultiObjectiveAnalyzer());
    5048
     
    6159    public virtual void Analyze(Individual[] individuals, double[][] qualities, ResultCollection results) { }
    6260
     61    protected override void OnEncodingChanged() {
     62      base.OnEncodingChanged();
     63      Parameters["Maximization"].ActualValue = new BoolArray(Maximization);
     64    }
    6365
    6466    protected override void OnEvaluatorChanged() {
     
    6769    }
    6870
    69     protected override void ParameterizeOperators() {
    70       base.ParameterizeOperators();
     71    private void ParameterizeOperators() {
    7172      foreach (var op in Operators.OfType<IMultiObjectiveEvaluationOperator>())
    7273        op.EvaluateFunc = Evaluate;
Note: See TracChangeset for help on using the changeset viewer.