Changeset 16171 for branches/2943_MOBasicProblem_MOCMAES/HeuristicLab.Optimization/3.3/BasicProblems
- Timestamp:
- 09/21/18 09:18:49 (6 years ago)
- Location:
- branches/2943_MOBasicProblem_MOCMAES/HeuristicLab.Optimization/3.3/BasicProblems
- Files:
-
- 3 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2943_MOBasicProblem_MOCMAES/HeuristicLab.Optimization/3.3/BasicProblems/BasicProblem.cs
r15583 r16171 30 30 namespace HeuristicLab.Optimization { 31 31 [StorableClass] 32 public abstract class BasicProblem<TEncoding, TEvaluator> : HeuristicOptimizationProblem<TEvaluator, ISolutionCreator>, I ProblemDefinition, IStorableContent32 public abstract class BasicProblem<TEncoding, TEvaluator> : HeuristicOptimizationProblem<TEvaluator, ISolutionCreator>, IBasicProblem 33 33 where TEncoding : class, IEncoding 34 34 where TEvaluator : class, IEvaluator { -
branches/2943_MOBasicProblem_MOCMAES/HeuristicLab.Optimization/3.3/BasicProblems/MultiObjectiveBasicProblem.cs
r15583 r16171 31 31 namespace HeuristicLab.Optimization { 32 32 [StorableClass] 33 public abstract class MultiObjectiveBasicProblem<TEncoding> : BasicProblem<TEncoding, MultiObjectiveEvaluator>, IMultiObjective HeuristicOptimizationProblem, IMultiObjectiveProblemDefinition33 public abstract class MultiObjectiveBasicProblem<TEncoding> : BasicProblem<TEncoding, MultiObjectiveEvaluator>, IMultiObjectiveBasicProblem 34 34 where TEncoding : class, IEncoding { 35 36 #region Parameternames 37 public const string MaximizationParameterName = "Maximization"; 38 public const string BestKnownFrontParameterName = "BestKnownFront"; 39 public const string ReferencePointParameterName = "ReferencePoint"; 40 #endregion 41 42 #region Parameterproperties 43 public IValueParameter<BoolArray> MaximizationParameter { 44 get { return (IValueParameter<BoolArray>) Parameters[MaximizationParameterName]; } 45 } 46 public IValueParameter<DoubleMatrix> BestKnownFrontParameter { 47 get { return (IValueParameter<DoubleMatrix>)Parameters[BestKnownFrontParameterName]; } 48 } 49 public IValueParameter<DoubleArray> ReferencePointParameter { 50 get { return (IValueParameter<DoubleArray>)Parameters[ReferencePointParameterName]; } 51 } 52 #endregion 53 54 #region Properties 55 56 public abstract bool[] Maximization { get; } 57 58 public DoubleMatrix BestKnownFront { 59 get { return Parameters.ContainsKey(BestKnownFrontParameterName) ? BestKnownFrontParameter.Value : null; } 60 set { BestKnownFrontParameter.Value = value; } 61 } 62 public DoubleArray ReferencePoint { 63 get { return Parameters.ContainsKey(ReferencePointParameterName) ? ReferencePointParameter.Value : null; } 64 set { ReferencePointParameter.Value = value; } 65 } 66 #endregion 67 35 68 [StorableConstructor] 36 69 protected MultiObjectiveBasicProblem(bool deserializing) : base(deserializing) { } … … 43 76 protected MultiObjectiveBasicProblem() 44 77 : base() { 45 Parameters.Add(new ValueParameter<BoolArray>("Maximization", "Set to false if the problem should be minimized.", (BoolArray)new BoolArray(Maximization).AsReadOnly())); 46 78 Parameters.Add(new ValueParameter<BoolArray>(MaximizationParameterName, "Set to false if the problem should be minimized.", (BoolArray)new BoolArray(Maximization).AsReadOnly())); 79 Parameters.Add(new OptionalValueParameter<DoubleMatrix>(BestKnownFrontParameterName, "A double matrix representing the best known qualites for this problem (aka points on the Pareto front). Points are to be given in a row-wise fashion.")); 80 Parameters.Add(new OptionalValueParameter<DoubleArray>(ReferencePointParameterName, "The refrence point for hypervolume calculations on this problem")); 47 81 Operators.Add(Evaluator); 48 82 Operators.Add(new MultiObjectiveAnalyzer()); … … 56 90 } 57 91 58 public abstract bool[] Maximization { get; }92 59 93 public abstract double[] Evaluate(Individual individual, IRandom random); 60 94 public virtual void Analyze(Individual[] individuals, double[][] qualities, ResultCollection results, IRandom random) { } … … 96 130 } 97 131 98 99 132 #region IMultiObjectiveHeuristicOptimizationProblem Members 100 133 IParameter IMultiObjectiveHeuristicOptimizationProblem.MaximizationParameter { 101 get { return Parameters[ "Maximization"]; }134 get { return Parameters[MaximizationParameterName]; } 102 135 } 103 136 IMultiObjectiveEvaluator IMultiObjectiveHeuristicOptimizationProblem.Evaluator { -
branches/2943_MOBasicProblem_MOCMAES/HeuristicLab.Optimization/3.3/BasicProblems/SingleObjectiveBasicProblem.cs
r15583 r16171 31 31 namespace HeuristicLab.Optimization { 32 32 [StorableClass] 33 public abstract class SingleObjectiveBasicProblem<TEncoding> : BasicProblem<TEncoding, SingleObjectiveEvaluator>, 34 ISingleObjectiveProblemDefinition, ISingleObjectiveHeuristicOptimizationProblem 33 public abstract class SingleObjectiveBasicProblem<TEncoding> : BasicProblem<TEncoding, SingleObjectiveEvaluator>, ISingleObjectiveBasicProblem 35 34 where TEncoding : class, IEncoding { 36 35
Note: See TracChangeset
for help on using the changeset viewer.