- Timestamp:
- 09/26/19 10:02:47 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2521_ProblemRefactoring/HeuristicLab.Problems.ExternalEvaluation/3.4/SingleObjectiveExternalEvaluationProblem.cs
r16816 r17270 93 93 public ExternalEvaluationProblem(TEncoding encoding) 94 94 : base(encoding) { 95 Parameters.Remove("Maximization"); // readonly in base class96 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 97 97 Parameters.Add(new OptionalValueParameter<EvaluationCache>("Cache", "Cache of previously evaluated solutions.")); 98 98 Parameters.Add(new ValueParameter<CheckedItemCollection<IEvaluationServiceClient>>("Clients", "The clients that are used to communicate with the external application.", new CheckedItemCollection<IEvaluationServiceClient>() { new EvaluationServiceClient() })); … … 104 104 105 105 #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 114 106 public override double Evaluate(TEncodedSolution solution, IRandom random) { 115 107 var qualityMessage = Evaluate(BuildSolutionMessage(solution));
Note: See TracChangeset
for help on using the changeset viewer.