Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
09/21/18 09:18:49 (6 years ago)
Author:
bwerth
Message:

#2943 worked on MOBasicProblem - added Interfaces;reworked MOCalculators; several minor changes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2943_MOBasicProblem_MOCMAES/HeuristicLab.Problems.TestFunctions.MultiObjective/3.3/TestFunctions/DTLZ/DTLZ3.cs

    r15583 r16171  
    4747        throw new ArgumentException("The dimensionality of the problem(ProblemSize) must be larger than or equal to the number of objectives");
    4848      }
    49       double[] res = new double[objectives];
     49      var res = new double[objectives];
    5050
    5151      //calculate g(Xm)
    5252      double sum = 0;
    53       int length = r.Length - objectives + 1;
    54       for (int i = r.Length - length; i < r.Length; i++) {
    55         double d = 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;
    5656        sum += d * d - Math.Cos(20 * Math.PI * d);
    5757      }
    58       double g = 100 * (length + sum);
     58      var g = 100 * (length + sum);
    5959
    6060      //calculating f0...fM-1
    61       for (int i = 0; i < objectives; i++) {
    62         double f = i == 0 ? 1 : (Math.Sin(r[objectives - i - 1] * Math.PI / 2)) * (1 + g);
    63         for (int j = 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++) {
    6464          f *= Math.Cos(r[j] * Math.PI / 2);
    6565        }
Note: See TracChangeset for help on using the changeset viewer.