Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
09/26/19 10:02:47 (5 years ago)
Author:
abeham
Message:

#2521: worked on removing virtual from Maximization for single-objective problems

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.ExternalEvaluation/3.4/SingleObjectiveExternalEvaluationProblem.cs

    r16816 r17270  
    9393    public ExternalEvaluationProblem(TEncoding encoding)
    9494      : base(encoding) {
    95       Parameters.Remove("Maximization"); // readonly in base class
    96       Parameters.Add(new FixedValueParameter<BoolValue>("Maximization", "Set to false if the problem should be minimized.", new BoolValue()));
     95      MaximizationParameter.ReadOnly = false;
     96      MaximizationParameter.Value = new BoolValue(); // is a read-only boolvalue in base class
    9797      Parameters.Add(new OptionalValueParameter<EvaluationCache>("Cache", "Cache of previously evaluated solutions."));
    9898      Parameters.Add(new ValueParameter<CheckedItemCollection<IEvaluationServiceClient>>("Clients", "The clients that are used to communicate with the external application.", new CheckedItemCollection<IEvaluationServiceClient>() { new EvaluationServiceClient() }));
     
    104104
    105105    #region Single Objective Problem Overrides
    106     public override bool Maximization {
    107       get { return Parameters.ContainsKey("Maximization") && ((IValueParameter<BoolValue>)Parameters["Maximization"]).Value.Value; }
    108     }
    109 
    110     public virtual void SetMaximization(bool maximization) {
    111       MaximizationParameter.Value.Value = maximization;
    112     }
    113 
    114106    public override double Evaluate(TEncodedSolution solution, IRandom random) {
    115107      var qualityMessage = Evaluate(BuildSolutionMessage(solution));
Note: See TracChangeset for help on using the changeset viewer.