Changeset 11485 for branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/SingleObjectiveProblemDefinition.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/SingleObjectiveProblemDefinition.cs
r11484 r11485 27 27 namespace HeuristicLab.Problems.Programmable { 28 28 [Item("Single-objective Problem Definition", "Base class for custom single-objective problem definitions.")] 29 [StorableClass]30 29 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 }41 30 31 public abstract bool IsMaximizationProblem { 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 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) { } 52 38 protected SingleObjectiveProblemDefinition(Encoding encoding) : this(encoding, "SingleObjectiveProblemDefinition", null) { } 53 39 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) { } 56 41 } 57 42 }
Note: See TracChangeset
for help on using the changeset viewer.