Changeset 16950 for branches/2521_ProblemRefactoring/HeuristicLab.Problems.TestFunctions.MultiObjective/3.3/TestFunctions
- Timestamp:
- 05/13/19 22:56:49 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2521_ProblemRefactoring/HeuristicLab.Problems.TestFunctions.MultiObjective/3.3/TestFunctions/MultiObjectiveTestFunction.cs
r16723 r16950 22 22 using System; 23 23 using System.Collections.Generic; 24 using HEAL.Attic; 24 25 using HeuristicLab.Common; 25 26 using HeuristicLab.Core; … … 27 28 using HeuristicLab.Encodings.RealVectorEncoding; 28 29 using HeuristicLab.Parameters; 29 using HEAL.Attic;30 30 31 31 namespace HeuristicLab.Problems.TestFunctions.MultiObjective { … … 71 71 /// </summary> 72 72 public bool[] Maximization(int objectives) { 73 CheckObjectives(objectives);73 ThrowIfObjectivesOutOfRange(objectives); 74 74 return GetMaximization(objectives); 75 75 } … … 79 79 /// </summary> 80 80 public double[,] Bounds(int objectives) { 81 CheckObjectives(objectives);81 ThrowIfObjectivesOutOfRange(objectives); 82 82 return GetBounds(objectives); 83 83 } … … 88 88 /// </summary> 89 89 public IEnumerable<double[]> OptimalParetoFront(int objectives) { 90 CheckObjectives(objectives);90 ThrowIfObjectivesOutOfRange(objectives); 91 91 return GetOptimalParetoFront(objectives); 92 92 } … … 97 97 /// </summary> 98 98 public double[] ReferencePoint(int objectives) { 99 CheckObjectives(objectives);99 ThrowIfObjectivesOutOfRange(objectives); 100 100 return GetReferencePoint(objectives); 101 101 } … … 106 106 /// </summary> 107 107 public virtual double OptimalHypervolume(int objectives) { 108 CheckObjectives(objectives);108 ThrowIfObjectivesOutOfRange(objectives); 109 109 return GetBestKnownHypervolume(objectives); 110 110 } … … 114 114 } 115 115 116 protected void CheckObjectives(int objectives) {116 protected void ThrowIfObjectivesOutOfRange(int objectives) { 117 117 if (objectives < MinimumObjectives) throw new ArgumentException(string.Format("There must be at least {0} objectives", MinimumObjectives)); 118 118 if (objectives > MaximumObjectives) throw new ArgumentException(string.Format("There must be at most {0} objectives", MaximumObjectives)); … … 121 121 [StorableConstructor] 122 122 protected MultiObjectiveTestFunction(StorableConstructorFlag _) : base(_) { } 123 124 123 protected MultiObjectiveTestFunction(MultiObjectiveTestFunction original, Cloner cloner) 125 124 : base(original, cloner) { … … 129 128 MaximumSolutionLength = original.MaximumSolutionLength; 130 129 } 131 132 130 protected MultiObjectiveTestFunction(int minimumObjectives, int maximumObjectives, int minimumSolutionLength, int maximumSolutionLength) 133 131 : base() {
Note: See TracChangeset
for help on using the changeset viewer.