Changeset 13451 for branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3/Testfunctions/DTLZ1.cs
- Timestamp:
- 12/11/15 15:19:24 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3/Testfunctions/DTLZ1.cs
r13448 r13451 36 36 public override bool[] Maximization { 37 37 get { 38 bool[] res = new bool[actualSolutionSize]; 39 for(int i =0; i < res.Length; i++) res[i] = false; //TODO: diligent initialzation 40 return res; 38 return new bool[actualSolutionSize]; 41 39 } 42 40 } … … 57 55 public override int MinimumProblemSize { 58 56 get { 59 return Math.Max(2, ActualSolutionSize +1);57 return Math.Max(2, ActualSolutionSize); 60 58 } 61 59 } … … 84 82 85 83 private double[] Evaluate(RealVector r, int objectives) { 84 if (r.Length < objectives) { 85 throw new Exception("The dimensionality of the problem(ProblemSize) must be larger or equal than the dimensionality of the solution(SolutionSize) "); 86 } 87 86 88 double[] res = new double[objectives]; 87 89 … … 98 100 //calculating f0...fM-1 99 101 for (int i = 0; i < objectives; i++) { 100 double f = 0.5 * i == 0 ? 1 : (1 - r[objectives - i - 1]) * (1 + g);102 double f = 0.5 * (i == 0 ? 1 : (1 - r[objectives - i - 1])) * (1 + g); 101 103 for (int j = 0; j < objectives - i - 1; j++) { 102 104 f *= r[j];
Note: See TracChangeset
for help on using the changeset viewer.