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/Misc/Kursawe.cs

    r15583 r16171  
    2121using System;
    2222using System.Collections.Generic;
     23using System.Linq;
    2324using HeuristicLab.Common;
    2425using HeuristicLab.Core;
    2526using HeuristicLab.Encodings.RealVectorEncoding;
     27using HeuristicLab.Optimization;
    2628using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2729
     
    4345
    4446    protected override double GetBestKnownHypervolume(int objectives) {
    45       return Hypervolume.Calculate(GetOptimalParetoFront(objectives), GetReferencePoint(objectives), GetMaximization(objectives));
     47      return HypervolumeCalculator.CalculateHypervolume(GetOptimalParetoFront(objectives).ToArray(), GetReferencePoint(objectives), GetMaximization(objectives));
    4648    }
    4749
     
    6567      if (objectives != 2) throw new ArgumentException("The Kursawe problem must always have 2 objectives");
    6668      //objective 1
    67       double f0 = 0.0;
    68       for (int i = 0; i < r.Length - 1; i++) {
     69      var f0 = 0.0;
     70      for (var i = 0; i < r.Length - 1; i++) {
    6971        f0 += -10 * Math.Exp(-0.2 * Math.Sqrt(r[i] * r[i] + r[i + 1] * r[i + 1]));
    7072      }
    7173      //objective2
    72       double f1 = 0.0;
    73       for (int i = 0; i < r.Length; i++) {
     74      var f1 = 0.0;
     75      for (var i = 0; i < r.Length; i++) {
    7476        f1 += Math.Pow(Math.Abs(r[i]), 0.8) + 5 * Math.Sin(Math.Pow(r[i], 3));
    7577      }
Note: See TracChangeset for help on using the changeset viewer.