Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/14/16 13:34:21 (8 years ago)
Author:
mkommend
Message:

#1087: Refactored multi-objective test functions.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3/Testfunctions/DTLZ/DTLZ8.cs

    r13988 r14067  
    2929  [StorableClass]
    3030  public class DTLZ8 : DTLZ, IConstrainedTestFunction {
     31    public static double[] IllegalValue(int size, bool[] maximization) {
     32      double[] res = new double[size];
     33      for (int i = 0; i < size; i++) {
     34        res[i] = maximization[i] ? Double.MinValue : Double.MaxValue;
     35      }
     36      return res;
     37    }
    3138
    3239    [StorableConstructor]
     
    5360      }
    5461      for (int j = 0; j < M - 1; j++) {
    55         if (res[objectives - 1] + 4 * res[j] - 1 < 0) return MultiObjectiveTestFunction.IllegalValue(objectives, Maximization(objectives));
     62        if (res[objectives - 1] + 4 * res[j] - 1 < 0) return IllegalValue(objectives, Maximization(objectives));
    5663      }
    5764      double min = Double.PositiveInfinity;
     
    6370      }
    6471
    65       if (2 * res[objectives - 1] + min - 1 < 0) return MultiObjectiveTestFunction.IllegalValue(objectives, Maximization(objectives));
     72      if (2 * res[objectives - 1] + min - 1 < 0) return IllegalValue(objectives, Maximization(objectives));
    6673      return res;
    6774    }
Note: See TracChangeset for help on using the changeset viewer.