Changeset 11485 for branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/MultiObjectiveProblemDefinition.cs
- Timestamp:
- 10/21/14 19:10:35 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/MultiObjectiveProblemDefinition.cs
r11484 r11485 20 20 #endregion 21 21 22 using System.Linq;23 22 using HeuristicLab.Common; 24 23 using HeuristicLab.Core; … … 29 28 [Item("Multi-objective Problem Definition", "Base class for custom multi-objective problem definitions.")] 30 29 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 }41 30 31 public abstract bool[] Maximization { get; } 42 32 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) { } 45 34 46 35 [StorableConstructor] 47 36 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) { } 52 38 protected MultiObjectiveProblemDefinition(Encoding encoding) : this(encoding, "MultiObjectiveProblemDefinition", null) { } 53 39 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) { } 56 41 } 57 42 }
Note: See TracChangeset
for help on using the changeset viewer.