Changeset 16171 for branches/2943_MOBasicProblem_MOCMAES/HeuristicLab.Problems.TestFunctions.MultiObjective/3.3/TestFunctions/Misc/Kursawe.cs
- Timestamp:
- 09/21/18 09:18:49 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2943_MOBasicProblem_MOCMAES/HeuristicLab.Problems.TestFunctions.MultiObjective/3.3/TestFunctions/Misc/Kursawe.cs
r15583 r16171 21 21 using System; 22 22 using System.Collections.Generic; 23 using System.Linq; 23 24 using HeuristicLab.Common; 24 25 using HeuristicLab.Core; 25 26 using HeuristicLab.Encodings.RealVectorEncoding; 27 using HeuristicLab.Optimization; 26 28 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 27 29 … … 43 45 44 46 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)); 46 48 } 47 49 … … 65 67 if (objectives != 2) throw new ArgumentException("The Kursawe problem must always have 2 objectives"); 66 68 //objective 1 67 doublef0 = 0.0;68 for ( inti = 0; i < r.Length - 1; i++) {69 var f0 = 0.0; 70 for (var i = 0; i < r.Length - 1; i++) { 69 71 f0 += -10 * Math.Exp(-0.2 * Math.Sqrt(r[i] * r[i] + r[i + 1] * r[i + 1])); 70 72 } 71 73 //objective2 72 doublef1 = 0.0;73 for ( inti = 0; i < r.Length; i++) {74 var f1 = 0.0; 75 for (var i = 0; i < r.Length; i++) { 74 76 f1 += Math.Pow(Math.Abs(r[i]), 0.8) + 5 * Math.Sin(Math.Pow(r[i], 3)); 75 77 }
Note: See TracChangeset
for help on using the changeset viewer.