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

Location:
branches/2943_MOBasicProblem_MOCMAES/HeuristicLab.Problems.TestFunctions.MultiObjective/3.3/TestFunctions/ZDT
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/2943_MOBasicProblem_MOCMAES/HeuristicLab.Problems.TestFunctions.MultiObjective/3.3/TestFunctions/ZDT/ZDT1.cs

    r15583 r16171  
    4444    public override double[] Evaluate(RealVector r) {
    4545      double g = 0;
    46       for (int i = 1; i < r.Length; i++) g += r[i];
     46      for (var i = 1; i < r.Length; i++) g += r[i];
    4747      g = 1.0 + 9.0 * g / (r.Length - 1);
    48       double f0 = r[0];
    49       double f1 = g * (1.0 - Math.Sqrt(r[0] / g));
     48      var f0 = r[0];
     49      var f1 = g * (1.0 - Math.Sqrt(r[0] / g));
    5050      return new double[] { f0, f1 };
    5151    }
  • branches/2943_MOBasicProblem_MOCMAES/HeuristicLab.Problems.TestFunctions.MultiObjective/3.3/TestFunctions/ZDT/ZDT2.cs

    r15583 r16171  
    4242    public override double[] Evaluate(RealVector r) {
    4343      double g = 0;
    44       for (int i = 1; i < r.Length; i++) g += r[i];
     44      for (var i = 1; i < r.Length; i++) g += r[i];
    4545      g = 1.0 + 9.0 * g / (r.Length - 1);
    46       double d = r[0] / g;
    47       double f0 = r[0];
    48       double f1 = g * (1.0 - d * d);
     46      var d = r[0] / g;
     47      var f0 = r[0];
     48      var f1 = g * (1.0 - d * d);
    4949      return new double[] { f0, f1 };
    5050    }
  • branches/2943_MOBasicProblem_MOCMAES/HeuristicLab.Problems.TestFunctions.MultiObjective/3.3/TestFunctions/ZDT/ZDT3.cs

    r15583 r16171  
    4444    public override double[] Evaluate(RealVector r) {
    4545      double g = 0;
    46       for (int i = 1; i < r.Length; i++) g += r[i];
     46      for (var i = 1; i < r.Length; i++) g += r[i];
    4747      g = 1.0 + 9.0 * g / (r.Length - 1);
    48       double d = r[0] / g;
    49       double f0 = r[0];
    50       double f1 = g * (1.0 - Math.Sqrt(d) - d * Math.Sin(10 * Math.PI * r[0]));
     48      var d = r[0] / g;
     49      var f0 = r[0];
     50      var f1 = g * (1.0 - Math.Sqrt(d) - d * Math.Sin(10 * Math.PI * r[0]));
    5151      return new double[] { f0, f1 };
    5252    }
  • branches/2943_MOBasicProblem_MOCMAES/HeuristicLab.Problems.TestFunctions.MultiObjective/3.3/TestFunctions/ZDT/ZDT4.cs

    r15583 r16171  
    3030  public class ZDT4 : ZDT {
    3131    protected override double[,] GetBounds(int objectives) {
    32       double[,] bounds = new double[objectives, 2];
     32      var bounds = new double[objectives, 2];
    3333      bounds[0, 0] = 0; bounds[0, 1] = 1;
    34       for (int i = 1; i < objectives; i++) {
     34      for (var i = 1; i < objectives; i++) {
    3535        bounds[i, 0] = -5;
    3636        bounds[i, 1] = 5;
     
    5353    public override double[] Evaluate(RealVector r) {
    5454      double g = 0;
    55       for (int i = 1; i < r.Length; i++) {
    56         double v = r[i];
     55      for (var i = 1; i < r.Length; i++) {
     56        var v = r[i];
    5757        g += v * v - 10 * Math.Cos(4 * Math.PI * v);
    5858      }
    5959      g = 1.0 + 10.0 * (r.Length - 1) + g;
    60       double d = r[0] / g;
    61       double f0 = r[0];
    62       double f1 = 1 - Math.Sqrt(d);
     60      var d = r[0] / g;
     61      var f0 = r[0];
     62      var f1 = 1 - Math.Sqrt(d);
    6363      return new double[] { f0, f1 };
    6464    }
  • branches/2943_MOBasicProblem_MOCMAES/HeuristicLab.Problems.TestFunctions.MultiObjective/3.3/TestFunctions/ZDT/ZDT6.cs

    r15583 r16171  
    4343    public override double[] Evaluate(RealVector r) {
    4444      double g = 0;
    45       for (int i = 1; i < r.Length; i++) g += r[i];
     45      for (var i = 1; i < r.Length; i++) g += r[i];
    4646      g = 1.0 + 9.0 * Math.Pow(g / (r.Length - 1), 0.25);
    47       double f1 = 1 - Math.Exp(-4 * r[0]) * Math.Pow(Math.Sin(6 * Math.PI * r[0]), 6);
    48       double d = f1 / g;
    49       double f2 = g * (1.0 - d * d);
     47      var f1 = 1 - Math.Exp(-4 * r[0]) * Math.Pow(Math.Sin(6 * Math.PI * r[0]), 6);
     48      var d = f1 / g;
     49      var f2 = g * (1.0 - d * d);
    5050      return new double[] { f1, f2 };
    5151    }
Note: See TracChangeset for help on using the changeset viewer.