Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
10/21/14 19:10:35 (10 years ago)
Author:
abeham
Message:

#2174:

  • fixed some bugs
  • changed IsMaximizationProblem/Maximization to be an abstract property
  • changed Analyze to include an empty virtual definition
File:
1 edited

Legend:

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

    r11484 r11485  
    2727namespace HeuristicLab.Problems.Programmable {
    2828  [Item("Single-objective Problem Definition", "Base class for custom single-objective problem definitions.")]
    29   [StorableClass]
    3029  public abstract class SingleObjectiveProblemDefinition : ProblemDefinition, ISingleObjectiveProblemDefinition {
    31     [Storable(Name = "Storable")]
    32     private bool isMaximizationProblem;
    33     public bool IsMaximizationProblem {
    34       get { return isMaximizationProblem; }
    35       set {
    36         if (isMaximizationProblem == value) return;
    37         isMaximizationProblem = value;
    38         OnProblemDefinitionChanged();
    39       }
    40     }
    4130
     31    public abstract bool IsMaximizationProblem { get; }
    4232    public abstract double Evaluate(IRandom random, Individual vector);
    43 
    44     public abstract void Analyze(Individual[] vectors, double[] qualities, ResultCollection results);
     33    public virtual void Analyze(Individual[] vectors, double[] qualities, ResultCollection results) { }
    4534
    4635    [StorableConstructor]
    4736    protected SingleObjectiveProblemDefinition(bool deserializing) : base(deserializing) { }
    48     protected SingleObjectiveProblemDefinition(SingleObjectiveProblemDefinition original, Cloner cloner)
    49       : base(original, cloner) {
    50       this.isMaximizationProblem = original.isMaximizationProblem;
    51     }
     37    protected SingleObjectiveProblemDefinition(SingleObjectiveProblemDefinition original, Cloner cloner) : base(original, cloner) { }
    5238    protected SingleObjectiveProblemDefinition(Encoding encoding) : this(encoding, "SingleObjectiveProblemDefinition", null) { }
    5339    protected SingleObjectiveProblemDefinition(Encoding encoding, string name) : this(encoding, name, null) { }
    54     protected SingleObjectiveProblemDefinition(Encoding encoding, string name, string description)
    55       : base(encoding) { }
     40    protected SingleObjectiveProblemDefinition(Encoding encoding, string name, string description) : base(encoding, name, description) { }
    5641  }
    5742}
Note: See TracChangeset for help on using the changeset viewer.