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/MultiObjectiveProblemDefinition.cs

    r11484 r11485  
    2020#endregion
    2121
    22 using System.Linq;
    2322using HeuristicLab.Common;
    2423using HeuristicLab.Core;
     
    2928  [Item("Multi-objective Problem Definition", "Base class for custom multi-objective problem definitions.")]
    3029  public abstract class MultiObjectiveProblemDefinition : ProblemDefinition, IMultiObjectiveProblemDefinition {
    31     [Storable(Name = "Storable")]
    32     private bool[] maximization;
    33     public bool[] Maximization {
    34       get { return maximization; }
    35       set {
    36         if (maximization.SequenceEqual(value)) return;
    37         maximization = value;
    38         OnProblemDefinitionChanged();
    39       }
    40     }
    4130
     31    public abstract bool[] Maximization { 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 MultiObjectiveProblemDefinition(bool deserializing) : base(deserializing) { }
    48     protected MultiObjectiveProblemDefinition(MultiObjectiveProblemDefinition original, Cloner cloner)
    49       : base(original, cloner) {
    50       this.maximization = (bool[])original.maximization.Clone();
    51     }
     37    protected MultiObjectiveProblemDefinition(MultiObjectiveProblemDefinition original, Cloner cloner) : base(original, cloner) { }
    5238    protected MultiObjectiveProblemDefinition(Encoding encoding) : this(encoding, "MultiObjectiveProblemDefinition", null) { }
    5339    protected MultiObjectiveProblemDefinition(Encoding encoding, string name) : this(encoding, name, null) { }
    54     protected MultiObjectiveProblemDefinition(Encoding encoding, string name, string description)
    55       : base(encoding) { }
     40    protected MultiObjectiveProblemDefinition(Encoding encoding, string name, string description) : base(encoding, name, description) { }
    5641  }
    5742}
Note: See TracChangeset for help on using the changeset viewer.