- Timestamp:
- 03/09/16 14:05:49 (9 years ago)
- Location:
- branches/HeuristicLab.Problems.MultiObjectiveTestFunctions
- Files:
-
- 8 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3/Testfunctions/DTLZ/DTLZ1.cs
r13672 r13673 49 49 throw new Exception("The dimensionality of the problem(ProblemSize) must be larger or equal than the dimensionality of the solution(SolutionSize) "); 50 50 } 51 double[] res = new double[objectives]; 52 int k = r.Length - objectives + 1; 53 double g = 0; 51 54 52 double[] res = new double[objectives]; 55 for (int i = r.Length - k; i < r.Length; i++) { 56 g += (r[i] - 0.5) * (r[i] - 0.5) - Math.Cos(20.0 * Math.PI * (r[i] - 0.5)); 57 }; 58 g += k; 59 g *= 100; 53 60 54 //calculate g(Xm)55 double sum = 0, length = 0;56 for (int i = objectives; i < r.Length; i++) {57 double d = r[i] - 0.5;58 sum += d * d - Math.Cos(20 * Math.PI * d);59 length += r[i] * r[i];60 }61 length = Math.Sqrt(length);62 double g = 100 * (length + sum);63 64 //calculating f0...fM-165 61 for (int i = 0; i < objectives; i++) { 66 double f = 0.5 * (i == 0 ? 1 : (1 - r[objectives - i - 1])) * (1+ g);67 for (int j = 0; j < objectives - i - 1; j++) {68 f *= r[j];69 }70 res[i] = f;62 res[i] = 0.5 * (1.0 + g); 63 for (int j = 0; j < objectives - i - 1; ++j) 64 res[i] *= (r[j]); 65 if (i > 0) 66 res[i] *= 1 - r[objectives - i - 1]; 71 67 } 72 68 return res; -
branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3/Testfunctions/DTLZ/DTLZ3.cs
r13672 r13673 51 51 52 52 //calculate g(Xm) 53 double sum = 0, length = 0; 54 for (int i = objectives; i < r.Length; i++) { 53 double sum = 0; 54 int length = r.Length - objectives + 1; 55 for (int i = r.Length-length; i < r.Length; i++) { 55 56 double d = r[i] - 0.5; 56 57 sum += d * d - Math.Cos(20 * Math.PI * d); 57 length += r[i] * r[i];58 58 59 } 59 length = Math.Sqrt(length);60 60 double g = 100 * (length + sum); 61 61 -
branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3/Testfunctions/DTLZ/DTLZ7.cs
r13672 r13673 52 52 53 53 //calculate g(Xm) 54 double g = 0, length = 0;54 double g = 0, length = length = r.Length - objectives + 1; 55 55 for (int i = objectives; i < r.Length; i++) { 56 56 g += r[i]; 57 length += r[i] * r[i];58 57 } 59 length = Math.Sqrt(length);60 58 g = 1.0 + 9.0 / length * g; 61 59 if (length == 0) { g = 1; }
Note: See TracChangeset
for help on using the changeset viewer.