Line | |
---|
1 | using System;
|
---|
2 | using HeuristicLab.Common;
|
---|
3 | using HeuristicLab.Core;
|
---|
4 | using HeuristicLab.Encodings.RealVectorEncoding;
|
---|
5 | using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
|
---|
6 |
|
---|
7 | namespace 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.