Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
02/13/15 12:29:25 (10 years ago)
Author:
mkommend
Message:

#2282: Fixed evaluation tracker.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Algorithms.ParameterlessPopulationPyramid/3.3/EvaluationTracker.cs

    r11987 r11999  
    2424using HeuristicLab.Common;
    2525using HeuristicLab.Core;
     26using HeuristicLab.Data;
    2627using HeuristicLab.Encodings.BinaryVectorEncoding;
     28using HeuristicLab.Parameters;
    2729using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2830using HeuristicLab.Problems.Binary;
     
    8082      Evaluations = 0;
    8183      BestFoundOnEvaluation = 0;
     84
     85      if (Parameters.ContainsKey("Maximization")) Parameters.Remove("Maximization");
     86      Parameters.Add(new FixedValueParameter<BoolValue>("Maximization", "Set to false if the problem should be minimized.", (BoolValue)new BoolValue(Maximization).AsReadOnly()) { Hidden = true });
    8287    }
    83 
    84 
    8588
    8689    public override double Evaluate(BinaryVector vector, IRandom random) {
     
    102105
    103106    public override bool Maximization {
    104       get { return problem.Maximization; }
     107      get {
     108        if (problem == null) return false;
     109        return problem.Maximization;
     110      }
    105111    }
    106112
Note: See TracChangeset for help on using the changeset viewer.