Changeset 16171 for branches/2943_MOBasicProblem_MOCMAES/HeuristicLab.Problems.TestFunctions.MultiObjective/3.3/TestFunctions/IHR
- Timestamp:
- 09/21/18 09:18:49 (6 years ago)
- Location:
- branches/2943_MOBasicProblem_MOCMAES/HeuristicLab.Problems.TestFunctions.MultiObjective/3.3/TestFunctions/IHR
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2943_MOBasicProblem_MOCMAES/HeuristicLab.Problems.TestFunctions.MultiObjective/3.3/TestFunctions/IHR/IHR.cs
r15583 r16171 20 20 #endregion 21 21 using System; 22 using System.Linq; 22 23 using HeuristicLab.Common; 23 24 using HeuristicLab.Encodings.RealVectorEncoding; 25 using HeuristicLab.Optimization; 24 26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 25 27 … … 36 38 37 39 protected override double[] GetReferencePoint(int objectives) { 38 double[]rp = new double[objectives];39 for ( inti = 0; i < objectives; i++) {40 var rp = new double[objectives]; 41 for (var i = 0; i < objectives; i++) { 40 42 rp[i] = 11; 41 43 } … … 58 60 protected abstract double G(RealVector y); 59 61 62 protected override double GetBestKnownHypervolume(int objectives) { 63 return HypervolumeCalculator.CalculateHypervolume(GetOptimalParetoFront(objectives).ToArray(), GetReferencePoint(objectives), GetMaximization(objectives)); 64 } 60 65 61 66 protected double H(double x, RealVector r) { -
branches/2943_MOBasicProblem_MOCMAES/HeuristicLab.Problems.TestFunctions.MultiObjective/3.3/TestFunctions/IHR/IHR1.cs
r15583 r16171 31 31 public class IHR1 : IHR { 32 32 protected override IEnumerable<double[]> GetOptimalParetoFront(int objectives) { 33 List<double[]>res = new List<double[]>();34 for ( inti = 0; i <= 500; i++) {35 RealVector r = new RealVector(objectives);33 var res = new List<double[]>(); 34 for (var i = 0; i <= 500; i++) { 35 var r = new RealVector(objectives); 36 36 r[0] = 1 / 500.0 * i; 37 37 res.Add(this.Evaluate(r, objectives)); 38 38 } 39 39 return res; 40 }41 42 protected override double GetBestKnownHypervolume(int objectives) {43 return Hypervolume.Calculate(GetOptimalParetoFront(objectives), GetReferencePoint(objectives), GetMaximization(objectives));44 40 } 45 41 … … 64 60 65 61 protected override double G(RealVector y) { 66 doublesum = 0.0;67 for ( inti = 1; i < y.Length; i++) {62 var sum = 0.0; 63 for (var i = 1; i < y.Length; i++) { 68 64 sum += HG(y[i]); 69 65 } -
branches/2943_MOBasicProblem_MOCMAES/HeuristicLab.Problems.TestFunctions.MultiObjective/3.3/TestFunctions/IHR/IHR2.cs
r15583 r16171 31 31 public class IHR2 : IHR { 32 32 protected override IEnumerable<double[]> GetOptimalParetoFront(int objectives) { 33 List<double[]>res = new List<double[]>();34 for ( inti = 0; i <= 500; i++) {35 RealVector r = new RealVector(objectives);33 var res = new List<double[]>(); 34 for (var i = 0; i <= 500; i++) { 35 var r = new RealVector(objectives); 36 36 r[0] = 1 / 500.0 * i; 37 37 … … 39 39 } 40 40 return res; 41 }42 43 protected override double GetBestKnownHypervolume(int objectives) {44 return Hypervolume.Calculate(GetOptimalParetoFront(objectives), GetReferencePoint(objectives), GetMaximization(objectives));45 41 } 46 42 … … 66 62 67 63 protected override double G(RealVector y) { 68 doublesum = 0.0;69 for ( inti = 1; i < y.Length; i++) {64 var sum = 0.0; 65 for (var i = 1; i < y.Length; i++) { 70 66 sum += HG(y[i]); 71 67 } -
branches/2943_MOBasicProblem_MOCMAES/HeuristicLab.Problems.TestFunctions.MultiObjective/3.3/TestFunctions/IHR/IHR3.cs
r15583 r16171 21 21 using System; 22 22 using System.Collections.Generic; 23 using System.Linq; 23 24 using HeuristicLab.Common; 24 25 using HeuristicLab.Core; … … 31 32 public class IHR3 : IHR { 32 33 protected override IEnumerable<double[]> GetOptimalParetoFront(int objectives) { 33 List<double[]>res = new List<double[]>();34 for ( inti = 0; i <= 500; i++) {35 RealVector r = new RealVector(objectives);34 var res = new List<double[]>(); 35 for (var i = 0; i <= 500; i++) { 36 var r = new RealVector(objectives); 36 37 r[0] = 1 / 500.0 * i; 37 38 … … 39 40 } 40 41 return res; 41 }42 43 protected override double GetBestKnownHypervolume(int objectives) {44 return Hypervolume.Calculate(GetOptimalParetoFront(objectives), GetReferencePoint(objectives), GetMaximization(objectives));45 42 } 46 43 … … 66 63 67 64 protected override double G(RealVector y) { 68 doublesum = 0.0;69 for ( inti = 1; i < y.Length; i++) {65 var sum = 0.0; 66 for (var i = 1; i < y.Length; i++) { 70 67 sum += HG(y[i]); 71 68 } -
branches/2943_MOBasicProblem_MOCMAES/HeuristicLab.Problems.TestFunctions.MultiObjective/3.3/TestFunctions/IHR/IHR4.cs
r15583 r16171 21 21 using System; 22 22 using System.Collections.Generic; 23 using System.Linq; 23 24 using HeuristicLab.Common; 24 25 using HeuristicLab.Core; … … 31 32 public class IHR4 : IHR { 32 33 protected override IEnumerable<double[]> GetOptimalParetoFront(int objectives) { 33 List<double[]>res = new List<double[]>();34 for ( inti = 0; i <= 500; i++) {35 RealVector r = new RealVector(objectives);34 var res = new List<double[]>(); 35 for (var i = 0; i <= 500; i++) { 36 var r = new RealVector(objectives); 36 37 r[0] = 1 / 500.0 * i; 37 38 res.Add(this.Evaluate(r, objectives)); 38 39 } 39 40 return res; 40 }41 42 protected override double GetBestKnownHypervolume(int objectives) {43 return Hypervolume.Calculate(GetOptimalParetoFront(objectives), GetReferencePoint(objectives), GetMaximization(objectives));44 41 } 45 42 … … 69 66 70 67 protected override double G(RealVector y) { 71 doublesum = 0.0;72 for ( inti = 1; i < y.Length; i++) {68 var sum = 0.0; 69 for (var i = 1; i < y.Length; i++) { 73 70 sum += y[i] * y[i] - 10 * Math.Cos(4 * Math.PI * y[i]); 74 71 } -
branches/2943_MOBasicProblem_MOCMAES/HeuristicLab.Problems.TestFunctions.MultiObjective/3.3/TestFunctions/IHR/IHR6.cs
r15583 r16171 21 21 using System; 22 22 using System.Collections.Generic; 23 using System.Linq; 23 24 using HeuristicLab.Common; 24 25 using HeuristicLab.Core; … … 31 32 public class IHR6 : IHR { 32 33 protected override IEnumerable<double[]> GetOptimalParetoFront(int objectives) { 33 List<double[]>res = new List<double[]>();34 for ( inti = 0; i <= 500; i++) {35 RealVector r = new RealVector(objectives);34 var res = new List<double[]>(); 35 for (var i = 0; i <= 500; i++) { 36 var r = new RealVector(objectives); 36 37 r[0] = 1 / 500.0 * i; 37 38 res.Add(this.Evaluate(r, objectives)); 38 39 } 39 40 return res; 40 }41 42 protected override double GetBestKnownHypervolume(int objectives) {43 return Hypervolume.Calculate(GetOptimalParetoFront(objectives), GetReferencePoint(objectives), GetMaximization(objectives));44 41 } 45 42 … … 65 62 66 63 protected override double G(RealVector y) { 67 doublesum = 0.0;68 for ( inti = 1; i < y.Length; i++) {64 var sum = 0.0; 65 for (var i = 1; i < y.Length; i++) { 69 66 sum += HG(y[i]); 70 67 }
Note: See TracChangeset
for help on using the changeset viewer.