Changeset 16171 for branches/2943_MOBasicProblem_MOCMAES/HeuristicLab.Problems.TestFunctions.MultiObjective/3.3/TestFunctions/DTLZ/DTLZ3.cs
- Timestamp:
- 09/21/18 09:18:49 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2943_MOBasicProblem_MOCMAES/HeuristicLab.Problems.TestFunctions.MultiObjective/3.3/TestFunctions/DTLZ/DTLZ3.cs
r15583 r16171 47 47 throw new ArgumentException("The dimensionality of the problem(ProblemSize) must be larger than or equal to the number of objectives"); 48 48 } 49 double[]res = new double[objectives];49 var res = new double[objectives]; 50 50 51 51 //calculate g(Xm) 52 52 double sum = 0; 53 intlength = r.Length - objectives + 1;54 for ( inti = r.Length - length; i < r.Length; i++) {55 doubled = r[i] - 0.5;53 var length = r.Length - objectives + 1; 54 for (var i = r.Length - length; i < r.Length; i++) { 55 var d = r[i] - 0.5; 56 56 sum += d * d - Math.Cos(20 * Math.PI * d); 57 57 } 58 doubleg = 100 * (length + sum);58 var g = 100 * (length + sum); 59 59 60 60 //calculating f0...fM-1 61 for ( inti = 0; i < objectives; i++) {62 doublef = i == 0 ? 1 : (Math.Sin(r[objectives - i - 1] * Math.PI / 2)) * (1 + g);63 for ( intj = 0; j < objectives - i - 1; j++) {61 for (var i = 0; i < objectives; i++) { 62 var f = i == 0 ? 1 : (Math.Sin(r[objectives - i - 1] * Math.PI / 2)) * (1 + g); 63 for (var j = 0; j < objectives - i - 1; j++) { 64 64 f *= Math.Cos(r[j] * Math.PI / 2); 65 65 }
Note: See TracChangeset
for help on using the changeset viewer.