Free cookie consent management tool by TermsFeed Policy Generator

source: branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3/Testfunctions/ZDT/ZDT3.cs @ 13620

Last change on this file since 13620 was 13620, checked in by bwerth, 8 years ago

#1087 regorganized testfunctions, added view for qualities

File size: 1.1 KB
Line 
1using System;
2using HeuristicLab.Common;
3using HeuristicLab.Core;
4using HeuristicLab.Encodings.RealVectorEncoding;
5using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
6
7namespace HeuristicLab.Problems.MultiObjectiveTestFunctions {
8  [Item("ZDT3", "ZDT3 function as defined in http://www.tik.ee.ethz.ch/sop/download/supplementary/testproblems/ [30.11.2015]")]
9  [StorableClass]
10  public class ZDT3 : ZDT {
11
12    public override double BestKnownHypervolume(int objectives) {
13      return 128.77811613069076060;
14    }
15
16    [StorableConstructor]
17    protected ZDT3(bool deserializing) : base(deserializing) { }
18    protected ZDT3(ZDT3 original, Cloner cloner) : base(original, cloner) { }
19    public override IDeepCloneable Clone(Cloner cloner) {
20      return new ZDT3(this, cloner);
21    }
22
23    public ZDT3() : base() { }
24
25    public override double[] Evaluate(RealVector r) {
26      double g = 0;
27      for (int i = 1; i < r.Length; i++) g += r[i];
28      g = 1.0 + 9.0 * g / (r.Length - 1);
29      double d = r[0] / g;
30      return new double[] { r[0], g * (1.0 - Math.Sqrt(d) - d * Math.Sin(10 * Math.PI * r[0])) };
31    }
32  }
33}
Note: See TracBrowser for help on using the repository browser.