- Timestamp:
- 01/15/16 16:07:14 (9 years ago)
- Location:
- branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3
- Files:
-
- 21 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3/HeuristicLab.Problems.MultiObjectiveTestFunctions-3.3.csproj
r13448 r13515 95 95 </ItemGroup> 96 96 <ItemGroup> 97 <Compile Include="Comparators\Spacing.cs" /> 98 <Compile Include="Comparators\HyperVolume.cs" /> 99 <Compile Include="Comparators\InvertedGenerationalDistance.cs" /> 100 <Compile Include="Comparators\GenerationalDistance.cs" /> 101 <Compile Include="NonDominatedSelect.cs" /> 97 102 <Compile Include="Interfaces\IMultiObjectiveTestFunction.cs" /> 103 <Compile Include="Interfaces\IMultiObjectiveDistance.cs" /> 98 104 <Compile Include="MultiObjectiveTestFunctionProblem.cs" /> 105 <Compile Include="PFReader.cs" /> 99 106 <Compile Include="Plugin.cs" /> 100 107 <Compile Include="Properties\AssemblyInfo.cs" /> -
branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3/Interfaces/IMultiObjectiveTestFunction.cs
r13448 r13515 24 24 using HeuristicLab.Encodings.RealVectorEncoding; 25 25 26 namespace HeuristicLab.Problems. TestFunctions {26 namespace HeuristicLab.Problems.MultiObjectiveTestFunctions { 27 27 /// <summary> 28 28 /// An interface which represents an evaluation operator for multi objective test functions. … … 31 31 bool[] Maximization { get; } 32 32 DoubleMatrix Bounds { get; } 33 //double BestKnownQuality { get; }34 33 int MinimumProblemSize { get; } 35 34 int MaximumProblemSize { get; } … … 38 37 int ActualSolutionSize { get; set; } 39 38 40 //double Evaluate2D(double x, double y); 39 40 RealVector[] OptimalParetoFront { get; } 41 RealVector ReferencePoint { get; } 42 double BestKnownHypervolume { get; } 43 44 41 45 double[] Evaluate(RealVector point); 42 //RealVector GetBestKnownSolution(int dimension);43 46 } 44 47 } -
branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3/MultiObjectiveTestFunctionProblem.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; … … 11 7 using HeuristicLab.Parameters; 12 8 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 13 using HeuristicLab.Problems.MultiObjectiveTestFunctions.Testfunctions; 14 using HeuristicLab.Problems.TestFunctions; 9 using HeuristicLab.Problems.MultiObjectiveTestFunctions; 15 10 16 11 namespace HeuristicLab.Problems.MultiObjectiveTestFunction { … … 18 13 public class MultiObjectiveTestFunctionProblem : MultiObjectiveBasicProblem<RealVectorEncoding> { 19 14 15 16 //TODO update of Maximisatzion when SolutionSize or TestFunction changes 20 17 public override bool[] Maximization { 21 18 get { … … 26 23 #region Parameter Properties 27 24 28 25 /// <summary> 26 /// The dimensionality of the solution candidates 27 /// </summary> 29 28 private IFixedValueParameter<IntValue> ProblemSizeParameter { 30 29 get { return (IFixedValueParameter<IntValue>)Parameters["ProblemSize"]; } 31 30 } 31 32 /// <summary> 33 /// The number of objectives that are to be optimized 34 /// </summary> 32 35 private IFixedValueParameter<IntValue> SolutionSizeParameter { 33 36 get { return (IFixedValueParameter<IntValue>)Parameters["SolutionSize"]; } 34 37 } 38 39 /// <summary> 40 /// The bounds for the entries of the solution candidate 41 /// </summary> 35 42 private IValueParameter<DoubleMatrix> BoundsParameter { 36 43 get { return (IValueParameter<DoubleMatrix>)Parameters["Bounds"]; } 37 44 } 38 public OptionalValueParameter<RealVector> BestKnownSolutionParameter { 39 get { return (OptionalValueParameter<RealVector>)Parameters["BestKnownSolution"]; } 40 } 45 46 /// <summary> 47 /// The testfunction 48 /// </summary> 41 49 public IValueParameter<IMultiObjectiveTestFunction> TestFunctionParameter { 42 50 get { return (IValueParameter<IMultiObjectiveTestFunction>)Parameters["TestFunction"]; } … … 63 71 #endregion 64 72 65 73 public override void Analyze(Individual[] individuals, double[][] qualities, ResultCollection results, IRandom random) { 74 base.Analyze(individuals, qualities, results, random); 75 if (qualities[0].Length != 2) { throw new Exception(); } 76 if (!results.ContainsKey("Hypervolume")) { 77 results.Add(new Result("Hypervolume", typeof(DoubleValue))); 78 } 79 if (!results.ContainsKey("BestKnownHypervolume")) { 80 results.Add(new Result("BestKnownHypervolume", typeof(DoubleValue))); 81 } 82 if (!results.ContainsKey("Absolute Distance to BestKnownHypervolume")) { 83 results.Add(new Result("Absolute Distance to BestKnownHypervolume", typeof(DoubleValue))); 84 } 85 Hypervolume comp = new Hypervolume(TestFunction.ReferencePoint, Maximization); 86 RealVector[] front = NonDominatedSelect.selectNonDominatedRows(qualities, Maximization, true); 87 88 double hv = comp.GetHypervolume(front); 89 double best = TestFunction.BestKnownHypervolume; 90 results["Hypervolume"].Value = new DoubleValue(hv); 91 results["BestKnownHypervolume"].Value = new DoubleValue(best); 92 results["Absolute Distance to BestKnownHypervolume"].Value = new DoubleValue(best - hv); 93 } 66 94 67 95 [StorableConstructor] … … 72 100 } 73 101 public MultiObjectiveTestFunctionProblem() 74 : base() { //former: base(new RealVectorEncoding("Point"))102 : base() { 75 103 Parameters.Add(new FixedValueParameter<IntValue>("ProblemSize", "The dimensionality of the problem instance (number of variables in the function).", new IntValue(2))); 76 104 Parameters.Add(new FixedValueParameter<IntValue>("SolutionSize", "The dimensionality of the solution vector (number of objectives).", new IntValue(2))); … … 80 108 Encoding.LengthParameter = ProblemSizeParameter; 81 109 Encoding.BoundsParameter = BoundsParameter; 82 //BestKnownQuality = TestFunction.BestKnownQuality;83 110 84 111 InitializeOperators(); 85 112 RegisterEventHandlers(); 86 113 } 114 115 87 116 88 117 public override IDeepCloneable Clone(Cloner cloner) { … … 96 125 97 126 private void RegisterEventHandlers() { 98 //Evaluator.QualityParameter.ActualNameChanged += Evaluator_QualityParameter_ActualNameChanged;99 127 TestFunctionParameter.ValueChanged += TestFunctionParameterOnValueChanged; 100 128 ProblemSizeParameter.Value.ValueChanged += ProblemSizeOnValueChanged; … … 119 147 protected override void OnEvaluatorChanged() { 120 148 base.OnEvaluatorChanged(); 121 // Evaluator.QualityParameter.ActualNameChanged += Evaluator_QualityParameter_ActualNameChanged; 122 Parameterize(); 123 } 124 125 //private void Evaluator_QualityParameter_ActualNameChanged(object sender, EventArgs e) { 126 // Parameterize(); 127 //} 128 149 Parameterize(); 150 } 129 151 130 152 private void TestFunctionParameterOnValueChanged(object sender, EventArgs eventArgs) { … … 176 198 177 199 private void Parameterize() { 178 }179 200 //empty for now 201 } 180 202 181 203 #endregion -
branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3/Testfunctions/DTLZ1.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; 8 4 using HeuristicLab.Data; 9 5 using HeuristicLab.Encodings.RealVectorEncoding; 10 using HeuristicLab.Parameters;11 6 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 12 using HeuristicLab.Problems.MultiObjectiveTestFunction;13 7 14 namespace HeuristicLab.Problems. TestFunctions {15 [Item("DTLZ1", " http://repository.ias.ac.in/81671/ [30.11.15]")]8 namespace HeuristicLab.Problems.MultiObjectiveTestFunctions { 9 [Item("DTLZ1", "Testfunction as defined as DTLZ1 in http://repository.ias.ac.in/81671/ [30.11.15]")] 16 10 [StorableClass] 17 11 public class DTLZ1 : MultiObjectiveTestFunction { … … 65 59 } 66 60 61 public override RealVector[] OptimalParetoFront { 62 get { 63 throw new NotImplementedException(); 64 } 65 } 66 67 public override RealVector ReferencePoint { 68 get { return new RealVector(new double[] { 11.0, 11.0 }); } 69 } 70 71 public override double BestKnownHypervolume { 72 get { return 120 + 7.0 / 8; } 73 } 74 67 75 [StorableConstructor] 68 76 protected DTLZ1(bool deserializing) : base(deserializing) { } -
branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3/Testfunctions/DTLZ2.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; 8 4 using HeuristicLab.Data; 9 5 using HeuristicLab.Encodings.RealVectorEncoding; 10 using HeuristicLab.Parameters;11 6 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 12 using HeuristicLab.Problems.MultiObjectiveTestFunction;13 7 14 namespace HeuristicLab.Problems. TestFunctions {15 [Item("DTLZ2", " http://repository.ias.ac.in/81671/ [30.11.15]")]8 namespace HeuristicLab.Problems.MultiObjectiveTestFunctions { 9 [Item("DTLZ2", "Testfunction as defined as DTLZ2 in http://repository.ias.ac.in/81671/ [30.11.15]")] 16 10 [StorableClass] 17 11 public class DTLZ2 : MultiObjectiveTestFunction { … … 65 59 } 66 60 61 public override RealVector[] OptimalParetoFront { 62 get { 63 throw new NotImplementedException(); 64 } 65 } 66 67 public override RealVector ReferencePoint { 68 get { return new RealVector(new double[] { 11.0, 11.0 }); } 69 } 70 71 public override double BestKnownHypervolume { 72 get { return 121.0 - 1.0 / 4.0 *Math.PI; } 73 } 74 67 75 [StorableConstructor] 68 76 protected DTLZ2(bool deserializing) : base(deserializing) { } -
branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3/Testfunctions/DTLZ3.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; 8 4 using HeuristicLab.Data; 9 5 using HeuristicLab.Encodings.RealVectorEncoding; 10 using HeuristicLab.Parameters;11 6 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 12 using HeuristicLab.Problems.MultiObjectiveTestFunction;13 7 14 namespace HeuristicLab.Problems. TestFunctions {15 [Item("DTLZ3", " http://repository.ias.ac.in/81671/ [30.11.15]")]8 namespace HeuristicLab.Problems.MultiObjectiveTestFunctions { 9 [Item("DTLZ3", "Testfunction as defined as DTLZ3 in http://repository.ias.ac.in/81671/ [30.11.15]")] 16 10 [StorableClass] 17 11 public class DTLZ3 : MultiObjectiveTestFunction { … … 65 59 } 66 60 61 public override RealVector[] OptimalParetoFront { 62 get { 63 throw new NotImplementedException(); 64 } 65 } 66 67 public override RealVector ReferencePoint { 68 get { return new RealVector(new double[] { 11.0, 11.0 }); } 69 } 70 71 public override double BestKnownHypervolume { 72 get { return 121.0 - 1.0 / 4.0 * Math.PI; } 73 } 74 67 75 [StorableConstructor] 68 76 protected DTLZ3(bool deserializing) : base(deserializing) { } -
branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3/Testfunctions/DTLZ4.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; 8 4 using HeuristicLab.Data; 9 5 using HeuristicLab.Encodings.RealVectorEncoding; 10 using HeuristicLab.Parameters;11 6 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 12 using HeuristicLab.Problems.MultiObjectiveTestFunction;13 7 14 namespace HeuristicLab.Problems. TestFunctions {15 [Item("DTLZ4", " http://repository.ias.ac.in/81671/ [30.11.15]")]8 namespace HeuristicLab.Problems.MultiObjectiveTestFunctions { 9 [Item("DTLZ4", "Testfunction as defined as DTLZ4 in http://repository.ias.ac.in/81671/ [30.11.15]")] 16 10 [StorableClass] 17 11 public class DTLZ4 : MultiObjectiveTestFunction { … … 65 59 } 66 60 61 public override RealVector[] OptimalParetoFront { 62 get { 63 throw new NotImplementedException(); 64 } 65 } 66 67 public override RealVector ReferencePoint { 68 get { return new RealVector(new double[] { 11.0, 11.0 }); } 69 } 70 71 public override double BestKnownHypervolume { 72 get { return 121.0 - 1.0 / 4.0 * Math.PI; } 73 } 74 67 75 [StorableConstructor] 68 76 protected DTLZ4(bool deserializing) : base(deserializing) { } -
branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3/Testfunctions/DTLZ5.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; 8 4 using HeuristicLab.Data; 9 5 using HeuristicLab.Encodings.RealVectorEncoding; 10 using HeuristicLab.Parameters;11 6 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 12 using HeuristicLab.Problems.MultiObjectiveTestFunction;13 7 14 namespace HeuristicLab.Problems. TestFunctions {15 [Item("DTLZ5", " http://repository.ias.ac.in/81671/ [30.11.15]")]8 namespace HeuristicLab.Problems.MultiObjectiveTestFunctions { 9 [Item("DTLZ5", "Testfunction as defined as DTLZ5 in http://repository.ias.ac.in/81671/ [30.11.15]")] 16 10 [StorableClass] 17 11 public class DTLZ5 : MultiObjectiveTestFunction { … … 65 59 } 66 60 61 public override RealVector[] OptimalParetoFront { 62 get { 63 throw new NotImplementedException(); 64 } 65 } 66 67 67 [StorableConstructor] 68 68 protected DTLZ5(bool deserializing) : base(deserializing) { } … … 94 94 //phi definition 95 95 Func<double, double> phi; 96 phi = (double x) => { return Math.PI / (4 * 1 + g) * (1 + 2 * g * x); };96 phi = (double x) => { return Math.PI / (4 * (1 + g)) * (1 + 2 * g * x); }; 97 97 98 98 //calculating f0...fM-1 -
branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3/Testfunctions/DTLZ6.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; 8 4 using HeuristicLab.Data; 9 5 using HeuristicLab.Encodings.RealVectorEncoding; 10 using HeuristicLab.Parameters;11 6 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 12 using HeuristicLab.Problems.MultiObjectiveTestFunction;13 7 14 namespace HeuristicLab.Problems. TestFunctions {15 [Item("DTLZ6", " http://repository.ias.ac.in/81671/ [30.11.15]")]8 namespace HeuristicLab.Problems.MultiObjectiveTestFunctions { 9 [Item("DTLZ6", "Testfunction as defined as DTLZ6 in http://repository.ias.ac.in/81671/ [30.11.15] NOTE: The website http://people.ee.ethz.ch/~sop/download/supplementary/testproblems/dtlz7/index.php [16.12.2015] lables this function as DTLZ7")] 16 10 [StorableClass] 17 11 public class DTLZ6 : MultiObjectiveTestFunction { … … 65 59 } 66 60 61 public override RealVector[] OptimalParetoFront { 62 get { 63 throw new NotImplementedException(); 64 } 65 } 66 public override RealVector ReferencePoint { 67 get { return new RealVector(new double[] { 11.0, 11.0 }); } 68 } 69 70 public override double BestKnownHypervolume { 71 get { return 116.1138716447221; } 72 } 73 74 67 75 [StorableConstructor] 68 76 protected DTLZ6(bool deserializing) : base(deserializing) { } -
branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3/Testfunctions/DTLZ7.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; 8 4 using HeuristicLab.Data; 9 5 using HeuristicLab.Encodings.RealVectorEncoding; 10 using HeuristicLab.Parameters;11 6 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 12 using HeuristicLab.Problems.MultiObjectiveTestFunction;13 7 14 namespace HeuristicLab.Problems. TestFunctions {15 [Item("DTLZ7", " http://repository.ias.ac.in/81671/ [30.11.15]")]8 namespace HeuristicLab.Problems.MultiObjectiveTestFunctions { 9 [Item("DTLZ7", "Testfunction as defined as DTLZ7 in http://repository.ias.ac.in/81671/ [30.11.15]")] 16 10 [StorableClass] 17 11 public class DTLZ7 : MultiObjectiveTestFunction { … … 65 59 } 66 60 61 public override RealVector[] OptimalParetoFront { 62 get { 63 throw new NotImplementedException(); 64 } 65 } 66 67 public override RealVector ReferencePoint { 68 get { return new RealVector(new double[] { 11.0, 11.0 }); } 69 } 70 71 67 72 [StorableConstructor] 68 73 protected DTLZ7(bool deserializing) : base(deserializing) { } -
branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3/Testfunctions/Evaluators.cs
r13448 r13515 7 7 8 8 namespace HeuristicLab.Problems.MultiObjectiveTestFunctions.Testfunctions { 9 10 /// <summary> 11 /// unused class 12 /// </summary> 9 13 class Evaluators { 10 14 -
branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3/Testfunctions/Fonseca.cs
r13448 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("Fonseca", " from // https://en.wikipedia.org/wiki/Test_functions_for_optimization [30.11.2015]")]8 namespace HeuristicLab.Problems.MultiObjectiveTestFunctions { 9 [Item("Fonseca", "Fonseca and Flemming function from // https://en.wikipedia.org/wiki/Test_functions_for_optimization [30.11.2015]")] 15 10 [StorableClass] 16 11 public class Fonseca : MultiObjectiveTestFunction { … … 61 56 } 62 57 58 public override RealVector[] OptimalParetoFront { 59 get { 60 return PFReader.getFromFile("Fonseca"); 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 Fonseca(bool deserializing) : base(deserializing) { } -
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 } -
branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3/Testfunctions/MultiObjectiveTestFunction.cs
r13451 r13515 27 27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 28 28 29 namespace HeuristicLab.Problems. TestFunctions {29 namespace HeuristicLab.Problems.MultiObjectiveTestFunctions { 30 30 /// <summary> 31 31 /// Base class for a test function evaluator. … … 77 77 public abstract int MaximumSolutionSize { get; } 78 78 79 /// <summary> 80 /// retrieves the optimal pareto front (if known from a file) 81 /// </summary> 82 public abstract RealVector[] OptimalParetoFront { get; } 83 84 public virtual RealVector ReferencePoint { 85 get { 86 return new RealVector(new double[]{ 11,11}); 87 } 88 } 89 90 public virtual double BestKnownHypervolume { 91 get { 92 return 0; 93 } 94 } 95 79 96 [StorableConstructor] 80 97 protected MultiObjectiveTestFunction(bool deserializing) : base(deserializing) { } -
branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3/Testfunctions/SchafferN1.cs
r13448 r13515 1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Text; 5 using System.Threading.Tasks; 6 using HeuristicLab.Common; 1 using HeuristicLab.Common; 7 2 using HeuristicLab.Core; 8 3 using HeuristicLab.Data; 9 4 using HeuristicLab.Encodings.RealVectorEncoding; 10 5 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 11 using HeuristicLab.Problems.MultiObjectiveTestFunction;12 6 13 namespace HeuristicLab.Problems. TestFunctions {14 [Item("SchafferN1", " from // https://en.wikipedia.org/wiki/Test_functions_for_optimization [30.11.2015]")]7 namespace HeuristicLab.Problems.MultiObjectiveTestFunctions { 8 [Item("SchafferN1", "Schaffer function N.1 for mulitobjective optimization from // https://en.wikipedia.org/wiki/Test_functions_for_optimization [30.11.2015]")] 15 9 [StorableClass] 16 10 public class SchafferN1 : MultiObjectiveTestFunction { … … 61 55 } 62 56 57 public override RealVector[] OptimalParetoFront { 58 get { 59 return PFReader.getFromFile("SchafferN1"); 60 } 61 } 62 public override double BestKnownHypervolume { 63 get { 64 return new Hypervolume(base.ReferencePoint, Maximization).GetHypervolume(OptimalParetoFront); 65 } 66 } 67 63 68 [StorableConstructor] 64 69 protected SchafferN1(bool deserializing) : base(deserializing) { } -
branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3/Testfunctions/SchafferN2.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("SchafferN2", " from // https://en.wikipedia.org/wiki/Test_functions_for_optimization [30.11.2015]")]8 namespace HeuristicLab.Problems.MultiObjectiveTestFunctions { 9 [Item("SchafferN2", "Schaffer function N.2 for mulitobjective optimization from // https://en.wikipedia.org/wiki/Test_functions_for_optimization [30.11.2015]")] 15 10 [StorableClass] 16 11 public class SchafferN2 : MultiObjectiveTestFunction { … … 61 56 } 62 57 58 public override RealVector[] OptimalParetoFront { 59 get { 60 throw new NotImplementedException(); 61 } 62 } 63 63 64 [StorableConstructor] 64 65 protected SchafferN2(bool deserializing) : base(deserializing) { } -
branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3/Testfunctions/ZDT1.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("ZDT1", " //http://www.tik.ee.ethz.ch/sop/download/supplementary/testproblems/ [30.11.2015]")]8 namespace HeuristicLab.Problems.MultiObjectiveTestFunctions { 9 [Item("ZDT1", "ZDT1 function as defined in http://www.tik.ee.ethz.ch/sop/download/supplementary/testproblems/ [30.11.2015]")] 15 10 [StorableClass] 16 11 public class ZDT1 : MultiObjectiveTestFunction { … … 61 56 } 62 57 58 public override RealVector[] OptimalParetoFront { 59 get { 60 throw new NotImplementedException(); 61 } 62 } 63 64 public override RealVector ReferencePoint { 65 get { return new RealVector(new double[]{ 11.0, 11.0}); } 66 } 67 68 public override double BestKnownHypervolume { 69 get { return 120 + 2.0 / 3; } 70 } 71 63 72 [StorableConstructor] 64 73 protected ZDT1(bool deserializing) : base(deserializing) { } -
branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3/Testfunctions/ZDT2.cs
r13448 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("ZDT2", " //http://www.tik.ee.ethz.ch/sop/download/supplementary/testproblems/ [30.11.2015]")]8 namespace HeuristicLab.Problems.MultiObjectiveTestFunctions { 9 [Item("ZDT2", "ZDT2 function as defined in http://www.tik.ee.ethz.ch/sop/download/supplementary/testproblems/ [30.11.2015]")] 15 10 [StorableClass] 16 11 public class ZDT2 : MultiObjectiveTestFunction { … … 60 55 } 61 56 57 public override RealVector[] OptimalParetoFront { 58 get { 59 throw new NotImplementedException(); 60 } 61 } 62 public override RealVector ReferencePoint { 63 get { return new RealVector(new double[] { 11.0, 11.0 }); } 64 } 65 66 public override double BestKnownHypervolume { 67 get { return 120+1.0/3; } 68 } 69 62 70 [StorableConstructor] 63 71 protected ZDT2(bool deserializing) : base(deserializing) { } -
branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3/Testfunctions/ZDT3.cs
r13448 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("ZDT3", " //http://www.tik.ee.ethz.ch/sop/download/supplementary/testproblems/ [30.11.2015]")]8 namespace HeuristicLab.Problems.MultiObjectiveTestFunctions { 9 [Item("ZDT3", "ZDT3 function as defined in http://www.tik.ee.ethz.ch/sop/download/supplementary/testproblems/ [30.11.2015]")] 15 10 [StorableClass] 16 11 public class ZDT3 : MultiObjectiveTestFunction { … … 61 56 } 62 57 58 public override RealVector[] OptimalParetoFront { 59 get { 60 throw new NotImplementedException(); 61 } 62 } 63 64 public override RealVector ReferencePoint { 65 get { return new RealVector(new double[] { 11.0, 11.0 }); } 66 } 67 68 public override double BestKnownHypervolume { 69 get { return 128.77811613069076060; } 70 } 71 63 72 [StorableConstructor] 64 73 protected ZDT3(bool deserializing) : base(deserializing) { } -
branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3/Testfunctions/ZDT4.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("ZDT4", " //http://www.tik.ee.ethz.ch/sop/download/supplementary/testproblems/ [30.11.2015]")]8 namespace HeuristicLab.Problems.MultiObjectiveTestFunctions { 9 [Item("ZDT4", "ZDT4 function as defined in http://www.tik.ee.ethz.ch/sop/download/supplementary/testproblems/ [30.11.2015]")] 15 10 [StorableClass] 16 11 public class ZDT4 : MultiObjectiveTestFunction { … … 61 56 } 62 57 58 public override RealVector[] OptimalParetoFront { 59 get { 60 throw new NotImplementedException(); 61 } 62 } 63 64 public override RealVector ReferencePoint { 65 get { return new RealVector(new double[] { 11.0, 11.0 }); } 66 } 67 68 public override double BestKnownHypervolume { 69 get { return 120+2.0/3; } 70 } 71 63 72 [StorableConstructor] 64 73 protected ZDT4(bool deserializing) : base(deserializing) { } -
branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3/Testfunctions/ZDT6.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("ZDT6", " //http://www.tik.ee.ethz.ch/sop/download/supplementary/testproblems/ [30.11.2015]")]8 namespace HeuristicLab.Problems.MultiObjectiveTestFunctions { 9 [Item("ZDT6", "ZDT6 function as defined in http://www.tik.ee.ethz.ch/sop/download/supplementary/testproblems/ [30.11.2015]")] 15 10 [StorableClass] 16 11 public class ZDT6 : MultiObjectiveTestFunction { … … 61 56 } 62 57 58 public override RealVector[] OptimalParetoFront { 59 get { 60 throw new NotImplementedException(); 61 } 62 } 63 64 public override RealVector ReferencePoint { 65 get { return new RealVector(new double[] { 11.0, 11.0 }); } 66 } 67 68 69 public override double BestKnownHypervolume { 70 get{ return 119.51857519692037009; } 71 } 72 63 73 [StorableConstructor] 64 74 protected ZDT6(bool deserializing) : base(deserializing) { }
Note: See TracChangeset
for help on using the changeset viewer.