Changeset 14067
- Timestamp:
- 07/14/16 13:34:21 (8 years ago)
- Location:
- branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3/Testfunctions
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3/Testfunctions/CIGTAB.cs
r13988 r14067 37 37 public override bool[] Maximization(int objecitves) { 38 38 return new bool[2]; 39 }40 41 public override int MinimumSolutionLength {42 get { return 1; }43 }44 public override int MaximumSolutionLength {45 get { return int.MaxValue; }46 }47 48 public override int MinimumObjectives {49 get { return 2; }50 }51 52 public override int MaximumObjectives {53 get { return 2; }54 39 } 55 40 -
branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3/Testfunctions/DTLZ/DTLZ.cs
r13988 r14067 41 41 } 42 42 43 public override int MinimumSolutionLength {44 get { return 2; }45 }46 public override int MaximumSolutionLength {47 get { return int.MaxValue; }48 }49 50 51 public override int MinimumObjectives {52 get { return 2; }53 }54 public override int MaximumObjectives {55 get { return int.MaxValue; }56 }57 58 43 public override double[] ReferencePoint(int objectives) { 59 44 double[] rp = new double[objectives]; … … 67 52 protected DTLZ(bool deserializing) : base(deserializing) { } 68 53 protected DTLZ(DTLZ original, Cloner cloner) : base(original, cloner) { } 69 public DTLZ() : base(minimumObjectives: 2, m inimumSolutionLength: 2, maximumSolutionLength: int.MaxValue) { }54 public DTLZ() : base(minimumObjectives: 2, maximumObjectives: int.MaxValue, minimumSolutionLength: 2, maximumSolutionLength: int.MaxValue) { } 70 55 71 56 public abstract override double[] Evaluate(RealVector r, int objecitves); -
branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3/Testfunctions/DTLZ/DTLZ8.cs
r13988 r14067 29 29 [StorableClass] 30 30 public class DTLZ8 : DTLZ, IConstrainedTestFunction { 31 public static double[] IllegalValue(int size, bool[] maximization) { 32 double[] res = new double[size]; 33 for (int i = 0; i < size; i++) { 34 res[i] = maximization[i] ? Double.MinValue : Double.MaxValue; 35 } 36 return res; 37 } 31 38 32 39 [StorableConstructor] … … 53 60 } 54 61 for (int j = 0; j < M - 1; j++) { 55 if (res[objectives - 1] + 4 * res[j] - 1 < 0) return MultiObjectiveTestFunction.IllegalValue(objectives, Maximization(objectives));62 if (res[objectives - 1] + 4 * res[j] - 1 < 0) return IllegalValue(objectives, Maximization(objectives)); 56 63 } 57 64 double min = Double.PositiveInfinity; … … 63 70 } 64 71 65 if (2 * res[objectives - 1] + min - 1 < 0) return MultiObjectiveTestFunction.IllegalValue(objectives, Maximization(objectives));72 if (2 * res[objectives - 1] + min - 1 < 0) return IllegalValue(objectives, Maximization(objectives)); 66 73 return res; 67 74 } -
branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3/Testfunctions/ELLI1.cs
r13988 r14067 37 37 public override bool[] Maximization(int objecitves) { 38 38 return new bool[2]; 39 }40 41 public override int MinimumSolutionLength {42 get { return 1; }43 }44 public override int MaximumSolutionLength {45 get { return int.MaxValue; }46 }47 48 public override int MinimumObjectives {49 get { return 2; }50 }51 52 public override int MaximumObjectives {53 get { return 2; }54 39 } 55 40 -
branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3/Testfunctions/Fonseca.cs
r13771 r14067 40 40 } 41 41 42 public override int MaximumSolutionLength {43 get { return int.MaxValue; }44 }45 46 public override int MinimumSolutionLength {47 get { return 1; }48 }49 50 public override int MinimumObjectives {51 get { return 2; }52 }53 54 public override int MaximumObjectives {55 get { return 2; }56 }57 58 59 42 public override IEnumerable<double[]> OptimalParetoFront(int objectives) { 60 43 return PFStore.get(this.ItemName); … … 74 57 return new Fonseca(this, cloner); 75 58 } 76 public Fonseca() : base(minimumObjectives: 2, maximumObjectives: 2, minimumSolutionLength: 1 ) { }59 public Fonseca() : base(minimumObjectives: 2, maximumObjectives: 2, minimumSolutionLength: 1, maximumSolutionLength: int.MaxValue) { } 77 60 78 61 -
branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3/Testfunctions/IHR/IHR.cs
r13989 r14067 42 42 } 43 43 44 public override int MinimumSolutionLength {45 get { return 2; }46 }47 public override int MaximumSolutionLength {48 get { return int.MaxValue; }49 }50 51 public override int MinimumObjectives {52 get { return 2; }53 }54 public override int MaximumObjectives {55 get { return 2; }56 }57 58 44 public override double[] ReferencePoint(int objectives) { 59 45 double[] rp = new double[objectives]; … … 67 53 protected IHR(bool deserializing) : base(deserializing) { } 68 54 protected IHR(IHR original, Cloner cloner) : base(original, cloner) { } 69 public IHR() : base(minimumObjectives: 2, m inimumSolutionLength: 2, maximumSolutionLength: int.MaxValue) { }55 public IHR() : base(minimumObjectives: 2, maximumObjectives: 2, minimumSolutionLength: 2, maximumSolutionLength: int.MaxValue) { } 70 56 71 57 public override double[] Evaluate(RealVector r, int objectives) { -
branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3/Testfunctions/Kursawe.cs
r13771 r14067 39 39 } 40 40 41 public override int MinimumObjectives {42 get { return 2; }43 }44 public override int MaximumObjectives {45 get { return 2; }46 }47 48 public override int MinimumSolutionLength {49 get { return 3; }50 }51 public override int MaximumSolutionLength {52 get { return int.MaxValue; }53 }54 55 41 public override IEnumerable<double[]> OptimalParetoFront(int objecitves) { 56 42 return PFStore.get(this.ItemName); … … 69 55 return new Kursawe(this, cloner); 70 56 } 71 public Kursawe() : base(minimumObjectives: 2, maximumObjectives: 2, minimumSolutionLength: 3 ) { }57 public Kursawe() : base(minimumObjectives: 2, maximumObjectives: 2, minimumSolutionLength: 3, maximumSolutionLength: int.MaxValue) { } 72 58 73 59 -
branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3/Testfunctions/MultiObjectiveTestFunction.cs
r13771 r14067 35 35 [StorableClass] 36 36 public abstract class MultiObjectiveTestFunction : ParameterizedNamedItem, IMultiObjectiveTestFunction { 37 public static double[] IllegalValue(int size, bool[] maximization) {38 double[] res = new double[size];39 for (int i = 0; i < size; i++) {40 res[i] = maximization[i] ? double.MinValue : double.MaxValue;41 }42 return res;43 }44 45 37 /// <summary> 46 38 /// These operators should not change their name through the GUI … … 49 41 get { return false; } 50 42 } 43 44 /// <summary> 45 /// Gets the minimum problem size. 46 /// </summary> 47 [Storable] 48 public int MinimumSolutionLength { get; private set; } 49 /// <summary> 50 /// Gets the maximum problem size. 51 /// </summary> 52 [Storable] 53 public int MaximumSolutionLength { get; private set; } 54 55 56 /// <summary> 57 /// Gets the minimum solution size. 58 /// </summary> 59 [Storable] 60 public int MinimumObjectives { get; private set; } 61 /// <summary> 62 /// Gets the maximum solution size. 63 /// </summary> 64 [Storable] 65 public int MaximumObjectives { get; private set; } 66 67 51 68 /// <summary> 52 69 /// Returns whether the actual function constitutes a maximization or minimization problem. … … 57 74 /// </summary> 58 75 public abstract double[,] Bounds(int objectives); 59 /// <summary>60 /// Gets the minimum problem size.61 /// </summary>62 public abstract int MinimumSolutionLength { get; }63 /// <summary>64 /// Gets the maximum problem size.65 /// </summary>66 public abstract int MaximumSolutionLength { get; }67 76 68 69 /// <summary>70 /// Gets and sets the actual solution size.71 /// </summary>72 ///73 [Storable]74 private int objectives;75 /// <summary>76 /// Gets the minimum solution size.77 /// </summary>78 public abstract int MinimumObjectives { get; }79 /// <summary>80 /// Gets the maximum solution size.81 /// </summary>82 public abstract int MaximumObjectives { get; }83 77 84 78 /// <summary> … … 87 81 public abstract IEnumerable<double[]> OptimalParetoFront(int objectives); 88 82 89 90 83 /// <summary> 91 /// returns a Reference Point for Hypervolume calculation ( currentlydefault=(11|11))84 /// returns a Reference Point for Hypervolume calculation (default=(11|11)) 92 85 /// </summary> 93 86 public abstract double[] ReferencePoint(int objectives); … … 95 88 96 89 /// <summary> 97 /// returns the best known Hypervolume for this Problem (currentlydefault=-1)90 /// returns the best known Hypervolume for this test function (default=-1) 98 91 /// </summary> 99 92 public virtual double BestKnownHypervolume(int objectives) { … … 103 96 [StorableConstructor] 104 97 protected MultiObjectiveTestFunction(bool deserializing) : base(deserializing) { } 105 protected MultiObjectiveTestFunction(MultiObjectiveTestFunction original, Cloner cloner) : base(original, cloner) { 106 this.objectives = original.objectives; 98 99 protected MultiObjectiveTestFunction(MultiObjectiveTestFunction original, Cloner cloner) 100 : base(original, cloner) { 101 MinimumObjectives = original.MinimumObjectives; 102 MaximumObjectives = original.MaximumObjectives; 103 MinimumSolutionLength = original.MinimumSolutionLength; 104 MaximumSolutionLength = original.MaximumSolutionLength; 107 105 } 108 protected MultiObjectiveTestFunction(int minimumObjectives = 1, int maximumObjectives = int.MaxValue, int minimumSolutionLength = 1, int maximumSolutionLength = int.MaxValue) : base() { 109 Parameters.Add(new FixedValueParameter<IntValue>("MinimumObjectives", "The dimensionality of the problem instance (number of variables in the function).", new IntValue(minimumObjectives))); 110 Parameters.Add(new FixedValueParameter<IntValue>("MaximumObjectives", "The dimensionality of the problem instance (number of variables in the function).", new IntValue(maximumObjectives))); 111 Parameters.Add(new FixedValueParameter<IntValue>("MinimumSolutionLength", "The dimensionality of the problem instance (number of variables in the function).", new IntValue(minimumSolutionLength))); 112 Parameters.Add(new FixedValueParameter<IntValue>("MaximumSolutionLength", "The dimensionality of the problem instance (number of variables in the function).", new IntValue(maximumSolutionLength))); 106 107 protected MultiObjectiveTestFunction(int minimumObjectives, int maximumObjectives, int minimumSolutionLength, int maximumSolutionLength) 108 : base() { 109 Parameters.Add(new FixedValueParameter<IntValue>("Minimum Objectives", 110 "The dimensionality of the problem instance (number of variables in the function).", 111 (IntValue)new IntValue(minimumObjectives).AsReadOnly()) { GetsCollected = false }); 112 Parameters.Add(new FixedValueParameter<IntValue>("Maximum Objectives", "The dimensionality of the problem instance (number of variables in the function).", (IntValue)new IntValue(maximumObjectives).AsReadOnly()) { GetsCollected = false }); 113 Parameters.Add(new FixedValueParameter<IntValue>("Minimum SolutionLength", "The dimensionality of the problem instance (number of variables in the function).", (IntValue)new IntValue(minimumSolutionLength).AsReadOnly()) { GetsCollected = false }); 114 Parameters.Add(new FixedValueParameter<IntValue>("Maximum SolutionLength", "The dimensionality of the problem instance (number of variables in the function).", (IntValue)new IntValue(maximumSolutionLength).AsReadOnly()) { GetsCollected = false }); 115 116 MinimumObjectives = minimumObjectives; 117 MaximumObjectives = maximumObjectives; 118 MinimumSolutionLength = minimumSolutionLength; 119 MaximumSolutionLength = maximumSolutionLength; 113 120 } 114 121 … … 119 126 /// <returns>The result values of the function at the given point.</returns> 120 127 public abstract double[] Evaluate(RealVector point, int objectives); 121 122 128 } 123 129 } -
branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3/Testfunctions/SchafferN1.cs
r13771 r14067 39 39 } 40 40 41 public override int MinimumSolutionLength {42 get { return 1; }43 }44 public override int MaximumSolutionLength {45 get { return 1; }46 }47 48 49 public override int MinimumObjectives {50 get { return 2; }51 }52 53 public override int MaximumObjectives {54 get { return 2; }55 }56 57 58 41 public override double[] ReferencePoint(int objecitves) { 59 42 return new double[] { 1e5, 1e5 }; -
branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3/Testfunctions/SchafferN2.cs
r13771 r14067 39 39 } 40 40 41 public override int MinimumSolutionLength {42 get { return 1; }43 }44 45 public override int MaximumSolutionLength {46 get { return 1; }47 }48 49 public override int MinimumObjectives {50 get { return 2; }51 }52 53 public override int MaximumObjectives {54 get { return 2; }55 }56 57 41 public override double[] ReferencePoint(int objecitves) { 58 42 return new double[] { 100, 100 }; … … 72 56 73 57 public SchafferN2() : base(minimumObjectives: 2, maximumObjectives: 2, minimumSolutionLength: 1, maximumSolutionLength: 1) { } 74 75 76 77 58 78 59 -
branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3/Testfunctions/ZDT/ZDT.cs
r13989 r14067 41 41 } 42 42 43 public override int MinimumSolutionLength {44 get { return 1; }45 }46 47 public override int MaximumSolutionLength {48 get { return int.MaxValue; }49 }50 51 public override int MinimumObjectives {52 get { return 2; }53 }54 55 public override int MaximumObjectives {56 get { return 2; }57 }58 59 43 public override double[] ReferencePoint(int objecitives) { 60 44 return new double[] { 11.0, 11.0 }; … … 67 51 [StorableConstructor] 68 52 protected ZDT(bool deserializing) : base(deserializing) { } 69 protected ZDT(MultiObjectiveTestFunction original, Cloner cloner) : base(original, cloner) { 53 protected ZDT(MultiObjectiveTestFunction original, Cloner cloner) 54 : base(original, cloner) { 70 55 } 71 protected ZDT() : base(minimumObjectives: 2, maximumObjectives: 2, minimumSolutionLength: 1 ) { }56 protected ZDT() : base(minimumObjectives: 2, maximumObjectives: 2, minimumSolutionLength: 1, maximumSolutionLength: int.MaxValue) { } 72 57 73 58 public override double[] Evaluate(RealVector r, int objectives) {
Note: See TracChangeset
for help on using the changeset viewer.