- Timestamp:
- 07/14/16 14:33:15 (9 years ago)
- Location:
- branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3
- Files:
-
- 1 added
- 22 edited
- 6 moved
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3/HeuristicLab.Problems.MultiObjectiveTestFunctions-3.3.csproj
r14066 r14068 169 169 <Compile Include="Instances\DTLZInstanceProvider.cs" /> 170 170 <Compile Include="Interfaces\IMOFrontModel.cs" /> 171 <Compile Include="Testfunctions\ CIGTAB.cs" />171 <Compile Include="Testfunctions\Misc\CIGTAB.cs" /> 172 172 <Compile Include="Testfunctions\IHR\IHR.cs" /> 173 173 <Compile Include="Testfunctions\IHR\IHR1.cs" /> … … 176 176 <Compile Include="Testfunctions\IHR\IHR3.cs" /> 177 177 <Compile Include="Testfunctions\IHR\IHR2.cs" /> 178 <Compile Include="Testfunctions\ ELLI1.cs" />178 <Compile Include="Testfunctions\Misc\ELLI1.cs" /> 179 179 <Compile Include="Views\MOSolution.cs" /> 180 180 <Compile Include="Views\MOFrontScatterPlotView.cs"> … … 198 198 <Compile Include="Testfunctions\DTLZ\DTLZ3.cs" /> 199 199 <Compile Include="Testfunctions\DTLZ\DTLZ2.cs" /> 200 <Compile Include="Testfunctions\ Kursawe.cs" />200 <Compile Include="Testfunctions\Misc\Kursawe.cs" /> 201 201 <Compile Include="Testfunctions\DTLZ\DTLZ1.cs" /> 202 202 <Compile Include="Testfunctions\ZDT\ZDT.cs" /> … … 206 206 <Compile Include="Testfunctions\ZDT\ZDT2.cs" /> 207 207 <Compile Include="Testfunctions\ZDT\ZDT1.cs" /> 208 <Compile Include="Testfunctions\ SchafferN2.cs" />209 <Compile Include="Testfunctions\ SchafferN1.cs" />210 <Compile Include="Testfunctions\ Fonseca.cs" />208 <Compile Include="Testfunctions\Misc\SchafferN2.cs" /> 209 <Compile Include="Testfunctions\Misc\SchafferN1.cs" /> 210 <Compile Include="Testfunctions\Misc\Fonseca.cs" /> 211 211 <Compile Include="Testfunctions\MultiObjectiveTestFunction.cs" /> 212 212 </ItemGroup> -
branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3/MultiObjectiveTestFunctionProblem.cs
r14065 r14068 170 170 /// <param name="individual"></param> 171 171 /// <returns>a double array that holds the distances that describe how much every contraint is violated (0 is not violated). If the current TestFunction does not have constraints an array of length 0 is returned</returns> 172 public double[] checkContraints(RealVector individual) { 173 if (TestFunction is IConstrainedTestFunction) { 174 return ((IConstrainedTestFunction)TestFunction).CheckConstraints(individual, Objectives); 172 public double[] CheckContraints(RealVector individual) { 173 var constrainedTestFunction = (IConstrainedTestFunction)TestFunction; 174 if (constrainedTestFunction != null) { 175 return constrainedTestFunction.CheckConstraints(individual, Objectives); 175 176 } 176 177 return new double[0]; -
branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3/Testfunctions/DTLZ/DTLZ.cs
r14067 r14068 19 19 */ 20 20 #endregion 21 21 22 using System.Collections.Generic; 22 23 using HeuristicLab.Common; … … 27 28 [StorableClass] 28 29 public abstract class DTLZ : MultiObjectiveTestFunction { 29 30 public override IEnumerable<double[]> OptimalParetoFront(int objectives) { 30 protected override IEnumerable<double[]> GetOptimalParetoFront(int objectives) { 31 31 if (objectives == 2) return PFStore.get(this.ItemName + ".2D"); 32 32 return null; 33 33 } 34 34 35 p ublic override double[,]Bounds(int objectives) {35 protected override double[,] GetBounds(int objectives) { 36 36 return new double[,] { { 0, 1 } }; 37 37 } 38 38 39 p ublic override bool[]Maximization(int objectives) {39 protected override bool[] GetMaximization(int objectives) { 40 40 return new bool[objectives]; 41 41 } 42 42 43 p ublic override double[]ReferencePoint(int objectives) {43 protected override double[] GetReferencePoint(int objectives) { 44 44 double[] rp = new double[objectives]; 45 45 for (int i = 0; i < objectives; i++) { -
branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3/Testfunctions/DTLZ/DTLZ1.cs
r13725 r14068 29 29 [StorableClass] 30 30 public class DTLZ1 : DTLZ { 31 32 public override double BestKnownHypervolume(int objectives) { 31 protected override double GetBestKnownHypervolume(int objectives) { 33 32 if (objectives == 2) return 120 + 7.0 / 8; 34 33 return -1; -
branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3/Testfunctions/DTLZ/DTLZ2.cs
r13988 r14068 29 29 [StorableClass] 30 30 public class DTLZ2 : DTLZ { 31 32 public override double BestKnownHypervolume(int objectives) { 31 protected override double GetBestKnownHypervolume(int objectives) { 33 32 if (objectives == 2) return 121.0 - 1.0 / 4.0 * Math.PI; 34 33 return -1; -
branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3/Testfunctions/DTLZ/DTLZ3.cs
r13725 r14068 29 29 [StorableClass] 30 30 public class DTLZ3 : DTLZ { 31 32 public override double BestKnownHypervolume(int objectives) { 31 protected override double GetBestKnownHypervolume(int objectives) { 33 32 if (objectives == 2) return 121.0 - 1.0 / 4.0 * Math.PI; 34 33 return -1; -
branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3/Testfunctions/DTLZ/DTLZ4.cs
r13725 r14068 29 29 [StorableClass] 30 30 public class DTLZ4 : DTLZ { 31 32 public override double BestKnownHypervolume(int objectives) { 31 protected override double GetBestKnownHypervolume(int objectives) { 33 32 if (objectives == 2) return 121.0 - 1.0 / 4.0 * Math.PI; 34 33 return -1; -
branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3/Testfunctions/DTLZ/DTLZ7.cs
r13988 r14068 30 30 [StorableClass] 31 31 public class DTLZ7 : DTLZ { 32 33 public override double BestKnownHypervolume(int objectives) { 32 protected override double GetBestKnownHypervolume(int objectives) { 34 33 if (objectives == 2) return 116.1138716447221; 35 34 return -1; -
branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3/Testfunctions/DTLZ/DTLZ8.cs
r14067 r14068 60 60 } 61 61 for (int j = 0; j < M - 1; j++) { 62 if (res[objectives - 1] + 4 * res[j] - 1 < 0) return IllegalValue(objectives, Maximization(objectives));62 if (res[objectives - 1] + 4 * res[j] - 1 < 0) return IllegalValue(objectives, GetMaximization(objectives)); 63 63 } 64 64 double min = Double.PositiveInfinity; … … 70 70 } 71 71 72 if (2 * res[objectives - 1] + min - 1 < 0) return IllegalValue(objectives, Maximization(objectives));72 if (2 * res[objectives - 1] + min - 1 < 0) return IllegalValue(objectives, GetMaximization(objectives)); 73 73 return res; 74 74 } -
branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3/Testfunctions/IHR/IHR.cs
r14067 r14068 28 28 [StorableClass] 29 29 public abstract class IHR : MultiObjectiveTestFunction { 30 31 public override IEnumerable<double[]> OptimalParetoFront(int objectives) { 30 protected override IEnumerable<double[]> GetOptimalParetoFront(int objectives) { 32 31 if (objectives == 2) return PFStore.get(this.ItemName + ".2D"); 33 32 return null; 34 33 } 35 34 36 p ublic override double[,]Bounds(int objectives) {35 protected override double[,] GetBounds(int objectives) { 37 36 return new double[,] { { -1, 1 } }; 38 37 } 39 38 40 p ublic override bool[]Maximization(int objectives) {39 protected override bool[] GetMaximization(int objectives) { 41 40 return new bool[objectives]; 42 41 } 43 42 44 p ublic override double[]ReferencePoint(int objectives) {43 protected override double[] GetReferencePoint(int objectives) { 45 44 double[] rp = new double[objectives]; 46 45 for (int i = 0; i < objectives; i++) { -
branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3/Testfunctions/IHR/IHR1.cs
r13988 r14068 30 30 [StorableClass] 31 31 public class IHR1 : IHR { 32 33 public override IEnumerable<double[]> OptimalParetoFront(int objectives) { 32 protected override IEnumerable<double[]> GetOptimalParetoFront(int objectives) { 34 33 List<double[]> res = new List<double[]>(); 35 34 for (int i = 0; i <= 500; i++) { … … 40 39 return res; 41 40 } 42 public override double BestKnownHypervolume(int objectives) { 43 return Hypervolume.Calculate(OptimalParetoFront(objectives), ReferencePoint(objectives), Maximization(objectives)); 41 42 protected override double GetBestKnownHypervolume(int objectives) { 43 return Hypervolume.Calculate(GetOptimalParetoFront(objectives), GetReferencePoint(objectives), GetMaximization(objectives)); 44 44 } 45 45 -
branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3/Testfunctions/IHR/IHR2.cs
r13988 r14068 30 30 [StorableClass] 31 31 public class IHR2 : IHR { 32 33 public override IEnumerable<double[]> OptimalParetoFront(int objectives) { 32 protected override IEnumerable<double[]> GetOptimalParetoFront(int objectives) { 34 33 List<double[]> res = new List<double[]>(); 35 34 for (int i = 0; i <= 500; i++) { … … 41 40 return res; 42 41 } 43 public override double BestKnownHypervolume(int objectives) { 44 return Hypervolume.Calculate(OptimalParetoFront(objectives), ReferencePoint(objectives), Maximization(objectives)); 42 43 protected override double GetBestKnownHypervolume(int objectives) { 44 return Hypervolume.Calculate(GetOptimalParetoFront(objectives), GetReferencePoint(objectives), GetMaximization(objectives)); 45 45 } 46 46 -
branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3/Testfunctions/IHR/IHR3.cs
r13988 r14068 30 30 [StorableClass] 31 31 public class IHR3 : IHR { 32 33 public override IEnumerable<double[]> OptimalParetoFront(int objectives) { 32 protected override IEnumerable<double[]> GetOptimalParetoFront(int objectives) { 34 33 List<double[]> res = new List<double[]>(); 35 34 for (int i = 0; i <= 500; i++) { … … 41 40 return res; 42 41 } 43 public override double BestKnownHypervolume(int objectives) { 44 return Hypervolume.Calculate(OptimalParetoFront(objectives), ReferencePoint(objectives), Maximization(objectives)); 42 43 protected override double GetBestKnownHypervolume(int objectives) { 44 return Hypervolume.Calculate(GetOptimalParetoFront(objectives), GetReferencePoint(objectives), GetMaximization(objectives)); 45 45 } 46 46 -
branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3/Testfunctions/IHR/IHR4.cs
r13988 r14068 30 30 [StorableClass] 31 31 public class IHR4 : IHR { 32 33 34 public override IEnumerable<double[]> OptimalParetoFront(int objectives) { 32 protected override IEnumerable<double[]> GetOptimalParetoFront(int objectives) { 35 33 List<double[]> res = new List<double[]>(); 36 34 for (int i = 0; i <= 500; i++) { … … 41 39 return res; 42 40 } 43 public override double BestKnownHypervolume(int objectives) { 44 return Hypervolume.Calculate(OptimalParetoFront(objectives), ReferencePoint(objectives), Maximization(objectives)); 41 42 protected override double GetBestKnownHypervolume(int objectives) { 43 return Hypervolume.Calculate(GetOptimalParetoFront(objectives), GetReferencePoint(objectives), GetMaximization(objectives)); 45 44 } 46 45 47 p ublic override double[,]Bounds(int objectives) {46 protected override double[,] GetBounds(int objectives) { 48 47 return new double[,] { { -5, 5 } }; 49 48 } -
branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3/Testfunctions/IHR/IHR6.cs
r13988 r14068 30 30 [StorableClass] 31 31 public class IHR6 : IHR { 32 33 public override IEnumerable<double[]> OptimalParetoFront(int objectives) { 32 protected override IEnumerable<double[]> GetOptimalParetoFront(int objectives) { 34 33 List<double[]> res = new List<double[]>(); 35 34 for (int i = 0; i <= 500; i++) { … … 40 39 return res; 41 40 } 42 public override double BestKnownHypervolume(int objectives) { 43 return Hypervolume.Calculate(OptimalParetoFront(objectives), ReferencePoint(objectives), Maximization(objectives)); 41 42 protected override double GetBestKnownHypervolume(int objectives) { 43 return Hypervolume.Calculate(GetOptimalParetoFront(objectives), GetReferencePoint(objectives), GetMaximization(objectives)); 44 44 } 45 45 -
branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3/Testfunctions/Misc/CIGTAB.cs
r14067 r14068 30 30 [StorableClass] 31 31 public class CIGTAB : MultiObjectiveTestFunction { 32 33 public override double[,] Bounds(int objectives) { 32 protected override double[,] GetBounds(int objectives) { 34 33 return new double[,] { { -10, 10 } }; 35 34 } 36 35 37 p ublic override bool[]Maximization(int objecitves) {36 protected override bool[] GetMaximization(int objecitves) { 38 37 return new bool[2]; 39 38 } 40 39 41 p ublic override double[]ReferencePoint(int objecitves) {40 protected override double[] GetReferencePoint(int objecitves) { 42 41 return new double[] { 11, 11 }; 43 42 } 44 43 45 p ublic override IEnumerable<double[]>OptimalParetoFront(int objecitves) {44 protected override IEnumerable<double[]> GetOptimalParetoFront(int objecitves) { 46 45 List<double[]> res = new List<double[]>(); 47 46 for (int i = 0; i <= 500; i++) { … … 53 52 return res; 54 53 } 55 public override double BestKnownHypervolume(int objectives) { 56 return Hypervolume.Calculate(OptimalParetoFront(objectives), ReferencePoint(objectives), Maximization(objectives)); 54 55 protected override double GetBestKnownHypervolume(int objectives) { 56 return Hypervolume.Calculate(GetOptimalParetoFront(objectives), GetReferencePoint(objectives), GetMaximization(objectives)); 57 57 } 58 58 -
branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3/Testfunctions/Misc/ELLI1.cs
r14067 r14068 30 30 [StorableClass] 31 31 public class ELLI : MultiObjectiveTestFunction { 32 33 public override double[,] Bounds(int objectives) { 32 protected override double[,] GetBounds(int objectives) { 34 33 return new double[,] { { -10, 10 } }; 35 34 } 36 35 37 p ublic override bool[]Maximization(int objecitves) {36 protected override bool[] GetMaximization(int objecitves) { 38 37 return new bool[2]; 39 38 } 40 39 41 p ublic override double[]ReferencePoint(int objecitves) {40 protected override double[] GetReferencePoint(int objecitves) { 42 41 return new double[] { 11, 11 }; 43 42 } 44 43 45 p ublic override IEnumerable<double[]>OptimalParetoFront(int objecitves) {44 protected override IEnumerable<double[]> GetOptimalParetoFront(int objecitves) { 46 45 List<double[]> res = new List<double[]>(); 47 46 for (int i = 0; i <= 500; i++) { … … 54 53 } 55 54 56 p ublic override doubleBestKnownHypervolume(int objectives) {57 return Hypervolume.Calculate( OptimalParetoFront(objectives), ReferencePoint(objectives),Maximization(objectives));55 protected override double GetBestKnownHypervolume(int objectives) { 56 return Hypervolume.Calculate(GetOptimalParetoFront(objectives), GetReferencePoint(objectives), GetMaximization(objectives)); 58 57 } 59 58 -
branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3/Testfunctions/Misc/Fonseca.cs
r14067 r14068 31 31 [StorableClass] 32 32 public class Fonseca : MultiObjectiveTestFunction { 33 34 public override double[,] Bounds(int objectives) { 33 protected override double[,] GetBounds(int objectives) { 35 34 return new double[,] { { -4, 4 } }; 36 35 } 37 36 38 p ublic override bool[]Maximization(int objecitves) {37 protected override bool[] GetMaximization(int objecitves) { 39 38 return new bool[2]; 40 39 } 41 40 42 p ublic override IEnumerable<double[]>OptimalParetoFront(int objectives) {41 protected override IEnumerable<double[]> GetOptimalParetoFront(int objectives) { 43 42 return PFStore.get(this.ItemName); 44 43 } 45 public override double BestKnownHypervolume(int objectives) { 46 return Hypervolume.Calculate(OptimalParetoFront(objectives), ReferencePoint(objectives), Maximization(objectives)); 44 45 protected override double GetBestKnownHypervolume(int objectives) { 46 return Hypervolume.Calculate(GetOptimalParetoFront(objectives), GetReferencePoint(objectives), GetMaximization(objectives)); 47 47 } 48 48 49 p ublic override double[]ReferencePoint(int objectives) {49 protected override double[] GetReferencePoint(int objectives) { 50 50 return new double[] { 11, 11 }; 51 51 } -
branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3/Testfunctions/Misc/Kursawe.cs
r14067 r14068 30 30 [StorableClass] 31 31 public class Kursawe : MultiObjectiveTestFunction { 32 33 public override double[,] Bounds(int objectives) { 32 protected override double[,] GetBounds(int objectives) { 34 33 return new double[,] { { -5, 5 } }; 35 34 } 36 35 37 p ublic override bool[]Maximization(int objecitves) {36 protected override bool[] GetMaximization(int objecitves) { 38 37 return new bool[2]; 39 38 } 40 39 41 p ublic override IEnumerable<double[]>OptimalParetoFront(int objecitves) {40 protected override IEnumerable<double[]> GetOptimalParetoFront(int objecitves) { 42 41 return PFStore.get(this.ItemName); 43 42 } 44 public override double BestKnownHypervolume(int objectives) { 45 return Hypervolume.Calculate(OptimalParetoFront(objectives), ReferencePoint(objectives), Maximization(objectives)); 43 44 protected override double GetBestKnownHypervolume(int objectives) { 45 return Hypervolume.Calculate(GetOptimalParetoFront(objectives), GetReferencePoint(objectives), GetMaximization(objectives)); 46 46 } 47 public override double[] ReferencePoint(int objectives) { 47 48 protected override double[] GetReferencePoint(int objectives) { 48 49 return new double[] { 11, 11 }; 49 50 } -
branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3/Testfunctions/Misc/SchafferN1.cs
r14067 r14068 30 30 [StorableClass] 31 31 public class SchafferN1 : MultiObjectiveTestFunction { 32 33 public override double[,] Bounds(int objectives) { 32 protected override double[,] GetBounds(int objectives) { 34 33 return new double[,] { { -1e5, 1e5 } }; 35 34 } 36 35 37 p ublic override bool[] Maximization(int objecitves) {36 protected override bool[] GetMaximization(int objectives) { 38 37 return new bool[2]; 39 38 } 40 39 41 p ublic override double[] ReferencePoint(int objecitves) {40 protected override double[] GetReferencePoint(int objectives) { 42 41 return new double[] { 1e5, 1e5 }; 43 42 } 44 43 45 44 46 p ublic override IEnumerable<double[]> OptimalParetoFront(int objecitves) {45 protected override IEnumerable<double[]> GetOptimalParetoFront(int objectives) { 47 46 return PFStore.get("Schaffer"); 48 47 } 49 public override double BestKnownHypervolume(int objectives) {50 return Hypervolume.Calculate(OptimalParetoFront(objectives), ReferencePoint(objectives), Maximization(objectives));51 48 49 protected override double GetBestKnownHypervolume(int objectives) { 50 return Hypervolume.Calculate(GetOptimalParetoFront(objectives), GetReferencePoint(objectives), GetMaximization(objectives)); 52 51 } 53 52 -
branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3/Testfunctions/Misc/SchafferN2.cs
r14067 r14068 30 30 [StorableClass] 31 31 public class SchafferN2 : MultiObjectiveTestFunction { 32 33 public override double[,] Bounds(int objectives) { 32 protected override double[,] GetBounds(int objectives) { 34 33 return new double[,] { { -5, 10 } }; 35 34 } 36 35 37 p ublic override bool[]Maximization(int objecitves) {36 protected override bool[] GetMaximization(int objecitves) { 38 37 return new bool[2]; 39 38 } 40 39 41 p ublic override double[]ReferencePoint(int objecitves) {40 protected override double[] GetReferencePoint(int objecitves) { 42 41 return new double[] { 100, 100 }; 43 42 } 44 43 45 44 46 p ublic override IEnumerable<double[]>OptimalParetoFront(int objectives) {45 protected override IEnumerable<double[]> GetOptimalParetoFront(int objectives) { 47 46 throw new NotImplementedException(); 48 47 } -
branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3/Testfunctions/MultiObjectiveTestFunction.cs
r14067 r14068 20 20 #endregion 21 21 22 using System; 22 23 using System.Collections.Generic; 23 24 using HeuristicLab.Common; … … 69 70 /// Returns whether the actual function constitutes a maximization or minimization problem. 70 71 /// </summary> 71 public abstract bool[] Maximization(int objectives); 72 public bool[] Maximization(int objectives) { 73 CheckObjectives(objectives); 74 return GetMaximization(objectives); 75 } 76 protected abstract bool[] GetMaximization(int objectives); 72 77 /// <summary> 73 78 /// Gets the lower and upper bound of the function. 74 79 /// </summary> 75 public abstract double[,] Bounds(int objectives); 76 80 public double[,] Bounds(int objectives) { 81 CheckObjectives(objectives); 82 return GetBounds(objectives); 83 } 84 protected abstract double[,] GetBounds(int objectives); 77 85 78 86 /// <summary> 79 87 /// retrieves the optimal pareto front (if known from a file) 80 88 /// </summary> 81 public abstract IEnumerable<double[]> OptimalParetoFront(int objectives); 89 public IEnumerable<double[]> OptimalParetoFront(int objectives) { 90 CheckObjectives(objectives); 91 return GetOptimalParetoFront(objectives); 92 } 93 protected abstract IEnumerable<double[]> GetOptimalParetoFront(int objectives); 82 94 83 95 /// <summary> 84 96 /// returns a Reference Point for Hypervolume calculation (default=(11|11)) 85 97 /// </summary> 86 public abstract double[] ReferencePoint(int objectives); 87 98 public double[] ReferencePoint(int objectives) { 99 CheckObjectives(objectives); 100 return GetReferencePoint(objectives); 101 } 102 protected abstract double[] GetReferencePoint(int objectives); 88 103 89 104 /// <summary> 90 105 /// returns the best known Hypervolume for this test function (default=-1) 91 /// </summary> 106 /// </summary> 92 107 public virtual double BestKnownHypervolume(int objectives) { 108 CheckObjectives(objectives); 109 return GetBestKnownHypervolume(objectives); 110 } 111 112 protected virtual double GetBestKnownHypervolume(int objectives) { 93 113 return -1; 114 } 115 116 protected void CheckObjectives(int objectives) { 117 if (objectives < MinimumObjectives) throw new ArgumentException(string.Format("There must be at least {0} objectives", MinimumObjectives)); 118 if (objectives > MaximumObjectives) throw new ArgumentException(string.Format("There must be at most {0} objectives", MaximumObjectives)); 94 119 } 95 120 -
branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3/Testfunctions/ZDT/ZDT.cs
r14067 r14068 28 28 [StorableClass] 29 29 public abstract class ZDT : MultiObjectiveTestFunction { 30 31 public override IEnumerable<double[]> OptimalParetoFront(int objectives) { 30 protected override IEnumerable<double[]> GetOptimalParetoFront(int objectives) { 32 31 return PFStore.get(this.ItemName); 33 32 } 34 33 35 p ublic override double[,]Bounds(int objectives) {34 protected override double[,] GetBounds(int objectives) { 36 35 return new double[,] { { 0, 1 } }; 37 36 } 38 37 39 p ublic override bool[]Maximization(int objectives) {38 protected override bool[] GetMaximization(int objectives) { 40 39 return new bool[objectives]; 41 40 } 42 41 43 p ublic override double[]ReferencePoint(int objecitives) {42 protected override double[] GetReferencePoint(int objecitives) { 44 43 return new double[] { 11.0, 11.0 }; 45 44 } 46 45 47 p ublic override doubleBestKnownHypervolume(int objectives) {46 protected override double GetBestKnownHypervolume(int objectives) { 48 47 return -1; 49 48 } -
branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3/Testfunctions/ZDT/ZDT1.cs
r13672 r14068 29 29 [StorableClass] 30 30 public class ZDT1 : ZDT { 31 32 public override double BestKnownHypervolume(int objectives) { 31 protected override double GetBestKnownHypervolume(int objectives) { 33 32 return 120 + 2.0 / 3; 34 33 } -
branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3/Testfunctions/ZDT/ZDT2.cs
r13672 r14068 28 28 [StorableClass] 29 29 public class ZDT2 : ZDT { 30 31 public override double BestKnownHypervolume(int objectives) { 30 protected override double GetBestKnownHypervolume(int objectives) { 32 31 return 120 + 1.0 / 3; 33 32 } -
branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3/Testfunctions/ZDT/ZDT3.cs
r13672 r14068 29 29 [StorableClass] 30 30 public class ZDT3 : ZDT { 31 32 public override double BestKnownHypervolume(int objectives) { 31 protected override double GetBestKnownHypervolume(int objectives) { 33 32 return 128.77811613069076060; 34 33 } -
branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3/Testfunctions/ZDT/ZDT4.cs
r13988 r14068 29 29 [StorableClass] 30 30 public class ZDT4 : ZDT { 31 32 public override double[,] Bounds(int objectives) { 31 protected override double[,] GetBounds(int objectives) { 33 32 double[,] bounds = new double[objectives, 2]; 34 33 bounds[0, 0] = 0; bounds[0, 1] = 1; … … 40 39 } 41 40 42 p ublic override doubleBestKnownHypervolume(int objectives) {41 protected override double GetBestKnownHypervolume(int objectives) { 43 42 return 120 + 2.0 / 3; 44 43 } -
branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3/Testfunctions/ZDT/ZDT6.cs
r13988 r14068 29 29 [StorableClass] 30 30 public class ZDT6 : ZDT { 31 32 public override double BestKnownHypervolume(int objectives) { 31 protected override double GetBestKnownHypervolume(int objectives) { 33 32 return 117.51857519692037009; //presumed typo on the ETH-homepage (119.518... is listed there but this doesnot match values for any given Pareto front 34 33 }
Note: See TracChangeset
for help on using the changeset viewer.