1 | using System;
|
---|
2 | using System.Collections.Generic;
|
---|
3 | using HeuristicLab.Common;
|
---|
4 | using HeuristicLab.Encodings.RealVectorEncoding;
|
---|
5 | using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
|
---|
6 |
|
---|
7 | namespace HeuristicLab.Problems.MultiObjectiveTestFunctions {
|
---|
8 | [StorableClass]
|
---|
9 | public abstract class DTLZ : MultiObjectiveTestFunction {
|
---|
10 |
|
---|
11 |
|
---|
12 | public override IEnumerable<double[]> OptimalParetoFront(int objectives) {
|
---|
13 | if (objectives == 2) return PFStore.get(this.ItemName);
|
---|
14 | throw new NotImplementedException();
|
---|
15 | }
|
---|
16 |
|
---|
17 | public override double[,] Bounds(int objectives) {
|
---|
18 | return new double[,] { { 0, 1 } };
|
---|
19 | }
|
---|
20 |
|
---|
21 | public override bool[] Maximization(int objectives) {
|
---|
22 | return new bool[objectives];
|
---|
23 | }
|
---|
24 |
|
---|
25 | public override int MinimumSolutionLength {
|
---|
26 | get { return 2; }
|
---|
27 | }
|
---|
28 | public override int MaximumSolutionLength {
|
---|
29 | get {return int.MaxValue;}
|
---|
30 | }
|
---|
31 |
|
---|
32 |
|
---|
33 | public override int MinimumObjectives {
|
---|
34 | get { return 2; }
|
---|
35 | }
|
---|
36 | public override int MaximumObjectives {
|
---|
37 | get {return int.MaxValue;}
|
---|
38 | }
|
---|
39 |
|
---|
40 | public override double[] ReferencePoint(int objectives) {
|
---|
41 | double[] rp = new double[objectives];
|
---|
42 | for(int i = 0; i< objectives; i++) {
|
---|
43 | rp[i] = 11;
|
---|
44 | }
|
---|
45 | return rp;
|
---|
46 | }
|
---|
47 |
|
---|
48 | [StorableConstructor]
|
---|
49 | protected DTLZ(bool deserializing) : base(deserializing) { }
|
---|
50 | protected DTLZ(DTLZ original, Cloner cloner) : base(original, cloner) {}
|
---|
51 | public DTLZ() : base() {
|
---|
52 | }
|
---|
53 |
|
---|
54 | public abstract override double[] Evaluate(RealVector r, int objecitves);
|
---|
55 |
|
---|
56 | }
|
---|
57 | }
|
---|