Changeset 5872


Ignore:
Timestamp:
03/29/11 17:07:04 (9 years ago)
Author:
abeham
Message:

#1430

  • Changed BestKnownQuality parameter to an OptionalValueParameter
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Optimization/3.3/SingleObjectiveHeuristicOptimizationProblem.cs

    • Property svn:mergeinfo set to (toggle deleted branches)
      /branches/QAP/HeuristicLab.Optimization/3.3/SingleObjectiveHeuristicOptimizationProblem.csmergedeligible
      /branches/CloningRefactoring/HeuristicLab.Optimization/3.3/SingleObjectiveHeuristicOptimizationProblem.cs4656-4721
      /branches/DataAnalysis Refactoring/HeuristicLab.Optimization/3.3/SingleObjectiveHeuristicOptimizationProblem.cs5471-5808
      /branches/DataAnalysis/HeuristicLab.Optimization/3.3/SingleObjectiveHeuristicOptimizationProblem.cs4458-4459,​4462,​4464
      /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Optimization/3.3/SingleObjectiveHeuristicOptimizationProblem.cs5060
      /branches/NET40/sources/HeuristicLab.Optimization/3.3/SingleObjectiveHeuristicOptimizationProblem.cs5138-5162
      /branches/ParallelEngine/HeuristicLab.Optimization/3.3/SingleObjectiveHeuristicOptimizationProblem.cs5175-5192
      /branches/SuccessProgressAnalysis/HeuristicLab.Optimization/3.3/SingleObjectiveHeuristicOptimizationProblem.cs5370-5682
      /branches/VNS/HeuristicLab.Optimization/3.3/SingleObjectiveHeuristicOptimizationProblem.cs5594-5752
    r5809 r5872  
    4141      : base() {
    4242      Parameters.Add(new ValueParameter<BoolValue>(MaximizationParameterName, "Set to false if the problem should be minimized.", new BoolValue()));
    43       Parameters.Add(new ValueParameter<DoubleValue>(BestKnownQualityParameterName, "The quality of the best known solution of this problem.", new DoubleValue()));
     43      Parameters.Add(new OptionalValueParameter<DoubleValue>(BestKnownQualityParameterName, "The quality of the best known solution of this problem.", new DoubleValue()));
    4444    }
    4545
     
    4747      : base(evaluator, solutionCreator) {
    4848      Parameters.Add(new ValueParameter<BoolValue>(MaximizationParameterName, "Set to false if the problem should be minimized.", new BoolValue()));
    49       Parameters.Add(new ValueParameter<DoubleValue>(BestKnownQualityParameterName, "The quality of the best known solution of this problem.", new DoubleValue()));
     49      Parameters.Add(new OptionalValueParameter<DoubleValue>(BestKnownQualityParameterName, "The quality of the best known solution of this problem.", new DoubleValue()));
    5050    }
    5151
     52    [StorableHook(HookType.AfterDeserialization)]
     53    protected virtual void AfterDeserialization() {
     54      // BackwardsCompatibility3.3
     55      #region Backwards compatible code (remove with 3.4)
     56      if (BestKnownQualityParameter is ValueParameter<DoubleValue>) {
     57        Parameters.Remove(BestKnownQualityParameterName);
     58        Parameters.Add(new OptionalValueParameter<DoubleValue>(BestKnownQualityParameterName, "The quality of the best known solution of this problem."));
     59      }
     60      #endregion
     61    }
    5262    public ValueParameter<BoolValue> MaximizationParameter {
    5363      get { return (ValueParameter<BoolValue>)Parameters[MaximizationParameterName]; }
     
    6171    }
    6272
    63     public ValueParameter<DoubleValue> BestKnownQualityParameter {
    64       get { return (ValueParameter<DoubleValue>)Parameters[BestKnownQualityParameterName]; }
     73    public IValueParameter<DoubleValue> BestKnownQualityParameter {
     74      get { return (IValueParameter<DoubleValue>)Parameters[BestKnownQualityParameterName]; }
    6575    }
    6676    IParameter ISingleObjectiveHeuristicOptimizationProblem.BestKnownQualityParameter {
Note: See TracChangeset for help on using the changeset viewer.