Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
12/11/15 15:19:24 (8 years ago)
Author:
bwerth
Message:

#1087 extensive testing; fixed minor bugs

File:
1 edited

Legend:

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

    r13448 r13451  
    3636    public override bool[] Maximization {
    3737      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];
    4139      }
    4240    }
     
    5755    public override int MinimumProblemSize {
    5856      get {
    59         return Math.Max(2, ActualSolutionSize+1);
     57        return Math.Max(2, ActualSolutionSize);
    6058      }
    6159    }
     
    8482
    8583    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
    8688      double[] res = new double[objectives];
    8789
     
    98100      //calculating f0...fM-1
    99101      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);
    101103        for (int j = 0; j < objectives - i - 1; j++) {
    102104          f *= r[j];
Note: See TracChangeset for help on using the changeset viewer.