Changeset 13515 for branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3/Testfunctions/Kursawe.cs
- Timestamp:
- 01/15/16 16:07:14 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3/Testfunctions/Kursawe.cs
r13451 r13515 1 1 using System; 2 using System.Collections.Generic;3 using System.Linq;4 using System.Text;5 using System.Threading.Tasks;6 2 using HeuristicLab.Common; 7 3 using HeuristicLab.Core; … … 9 5 using HeuristicLab.Encodings.RealVectorEncoding; 10 6 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 11 using HeuristicLab.Problems.MultiObjectiveTestFunction;12 7 13 namespace HeuristicLab.Problems. TestFunctions {14 [Item("Kursawe", " from // http://darwin.di.uminho.pt/jecoli/index.php/Multiobjective_example [30.11.2015]")]8 namespace HeuristicLab.Problems.MultiObjectiveTestFunctions { 9 [Item("Kursawe", "Kursawe function from // http://darwin.di.uminho.pt/jecoli/index.php/Multiobjective_example [30.11.2015]")] 15 10 [StorableClass] 16 11 public class Kursawe : MultiObjectiveTestFunction { … … 61 56 } 62 57 58 public override RealVector[] OptimalParetoFront { 59 get { 60 return PFReader.getFromFile("Kursawe"); 61 } 62 } 63 public override double BestKnownHypervolume { 64 get { 65 return new Hypervolume(base.ReferencePoint, Maximization).GetHypervolume(OptimalParetoFront); 66 } 67 } 68 63 69 [StorableConstructor] 64 70 protected Kursawe(bool deserializing) : base(deserializing) { } … … 75 81 //objective 1 76 82 double f0 = 0.0; 77 for (int i = 0; i < 2; i++) {83 for (int i = 0; i < r.Length-1; i++) { 78 84 f0 += -10 * Math.Exp(-0.2 * Math.Sqrt(r[i] * r[i] + r[i + 1] * r[i + 1])); 79 85 } 80 86 //objective2 81 87 double f1 = 0.0; 82 for (int i = 0; i < 3; i++) {88 for (int i = 0; i < r.Length; i++) { 83 89 f1 += Math.Pow(Math.Abs(r[i]), 0.8) + 5 * Math.Sin(Math.Pow(r[i], 3)); 84 90 }
Note: See TracChangeset
for help on using the changeset viewer.