Changeset 13448
- Timestamp:
- 12/11/15 11:21:44 (9 years ago)
- Location:
- branches/HeuristicLab.Problems.MultiObjectiveTestFunctions
- Files:
-
- 16 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3/HeuristicLab.Problems.MultiObjectiveTestFunctions-3.3.csproj
r13421 r13448 99 99 <Compile Include="Plugin.cs" /> 100 100 <Compile Include="Properties\AssemblyInfo.cs" /> 101 <Compile Include="Testfunctions\DTLZ7.cs" /> 102 <Compile Include="Testfunctions\DTLZ6.cs" /> 103 <Compile Include="Testfunctions\DTLZ5.cs" /> 104 <Compile Include="Testfunctions\DTLZ4.cs" /> 105 <Compile Include="Testfunctions\DTLZ3.cs" /> 106 <Compile Include="Testfunctions\DTLZ2.cs" /> 101 107 <Compile Include="Testfunctions\Evaluators.cs" /> 108 <Compile Include="Testfunctions\Kursawe.cs" /> 109 <Compile Include="Testfunctions\DTLZ1.cs" /> 110 <Compile Include="Testfunctions\ZDT6.cs" /> 111 <Compile Include="Testfunctions\ZDT4.cs" /> 112 <Compile Include="Testfunctions\ZDT3.cs" /> 113 <Compile Include="Testfunctions\ZDT2.cs" /> 114 <Compile Include="Testfunctions\ZDT1.cs" /> 115 <Compile Include="Testfunctions\SchafferN2.cs" /> 116 <Compile Include="Testfunctions\SchafferN1.cs" /> 102 117 <Compile Include="Testfunctions\Fonseca.cs" /> 103 118 <Compile Include="Testfunctions\MultiObjectiveTestFunction.cs" /> -
branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3/Interfaces/IMultiObjectiveTestFunction.cs
r13421 r13448 36 36 int MinimumSolutionSize { get; } 37 37 int MaximumSolutionSize { get; } 38 int ActualSolutionSize { get; set; } 38 39 39 40 //double Evaluate2D(double x, double y); -
branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3/MultiObjectiveTestFunctionProblem.cs
r13421 r13448 21 21 get { 22 22 return Parameters.ContainsKey("TestFunction") ? TestFunction.Maximization : new bool[2]; 23 } //TODO shady23 } 24 24 } 25 25 26 26 #region Parameter Properties 27 28 27 29 private IFixedValueParameter<IntValue> ProblemSizeParameter { 28 30 get { return (IFixedValueParameter<IntValue>)Parameters["ProblemSize"]; } … … 73 75 Parameters.Add(new FixedValueParameter<IntValue>("ProblemSize", "The dimensionality of the problem instance (number of variables in the function).", new IntValue(2))); 74 76 Parameters.Add(new FixedValueParameter<IntValue>("SolutionSize", "The dimensionality of the solution vector (number of objectives).", new IntValue(2))); 75 Parameters.Add(new ValueParameter<DoubleMatrix>("Bounds", "The bounds of the solution given as either one line for all variables or a line for each variable. The first column specifies lower bound, the second upper bound.", new DoubleMatrix(new double[,] { { - 100, 100} })));77 Parameters.Add(new ValueParameter<DoubleMatrix>("Bounds", "The bounds of the solution given as either one line for all variables or a line for each variable. The first column specifies lower bound, the second upper bound.", new DoubleMatrix(new double[,] { { -4, 4 } }))); 76 78 Parameters.Add(new ValueParameter<IMultiObjectiveTestFunction>("TestFunction", "The function that is to be optimized.", new Fonseca())); 77 79 … … 97 99 TestFunctionParameter.ValueChanged += TestFunctionParameterOnValueChanged; 98 100 ProblemSizeParameter.Value.ValueChanged += ProblemSizeOnValueChanged; 101 SolutionSizeParameter.Value.ValueChanged += SolutionSizeOnValueChanged; 99 102 BoundsParameter.ValueChanged += BoundsParameterOnValueChanged; 100 103 } 101 104 102 public double[] Evaluate(RealVector vector, IRandom random) {103 return TestFunction.Evaluate( vector);105 public double[] Evaluate(RealVector individual, IRandom random) { 106 return TestFunction.Evaluate(individual); 104 107 } 105 public sealed override double[] Evaluate(Individual individual, IRandom random) { 108 109 public override double[] Evaluate(Individual individual, IRandom random) { 106 110 return Evaluate(individual.RealVector(), random); 107 111 } 112 108 113 109 114 #region Events … … 114 119 protected override void OnEvaluatorChanged() { 115 120 base.OnEvaluatorChanged(); 116 // Evaluator.QualityParameter.ActualNameChanged += Evaluator_QualityParameter_ActualNameChanged;121 // Evaluator.QualityParameter.ActualNameChanged += Evaluator_QualityParameter_ActualNameChanged; 117 122 Parameterize(); 118 123 } 124 119 125 //private void Evaluator_QualityParameter_ActualNameChanged(object sender, EventArgs e) { 120 126 // Parameterize(); … … 134 140 ProblemSize = Math.Max(TestFunction.MinimumSolutionSize, Math.Min(SolutionSize, TestFunction.MaximumSolutionSize)); 135 141 } 136 137 142 Bounds = (DoubleMatrix)TestFunction.Bounds.Clone(); 138 143 OnReset(); … … 143 148 || ProblemSize > TestFunction.MaximumProblemSize) 144 149 ProblemSize = Math.Min(TestFunction.MaximumProblemSize, Math.Max(TestFunction.MinimumProblemSize, ProblemSize)); 150 //TODO problemsize dominates solutionSize 151 SolutionSizeOnValueChanged(sender, eventArgs); 145 152 } 146 153 147 154 private void SolutionSizeOnValueChanged(object sender, EventArgs eventArgs) { 148 155 if (SolutionSize < TestFunction.MinimumSolutionSize 149 || ProblemSize > TestFunction.MaximumSolutionSize) 150 ProblemSize = Math.Min(TestFunction.MaximumSolutionSize, Math.Max(TestFunction.MinimumSolutionSize, SolutionSize)); 156 || SolutionSize > TestFunction.MaximumSolutionSize) 157 SolutionSize = Math.Min(TestFunction.MaximumSolutionSize, Math.Max(TestFunction.MinimumSolutionSize, SolutionSize)); 158 TestFunction.ActualSolutionSize = SolutionSize; 159 OnReset(); 151 160 } 152 161 … … 163 172 164 173 private void Parameterize() { 165 //empty for now166 174 } 175 176 167 177 #endregion 168 169 170 178 } 171 179 } -
branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3/Testfunctions/Evaluators.cs
r13421 r13448 226 226 //original paper not accessible + wikipedia definition works only with fixed (3) dimensions 227 227 //http://darwin.di.uminho.pt/jecoli/index.php/Multiobjective_example [30.11.2015] 228 private double[] Kursawe(RealVector r) { // no Bounds??228 private double[] Kursawe(RealVector r) { //-5,5 229 229 //objective 1 230 230 double f0 = 0.0; … … 241 241 return res; 242 242 } 243 244 243 //http://www.eng.buffalo.edu/Research/MODEL/mdo.test.orig/class2prob4/descr.html 245 244 //TODO this is not multi-objective … … 305 304 return res; 306 305 } 307 private double[] Schaffer1(RealVector r) { //- 5,10??306 private double[] Schaffer1(RealVector r) { //-A,A 308 307 if (r.Length != 1) return null; 309 308 double x = r[0]; -
branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3/Testfunctions/Fonseca.cs
r13421 r13448 13 13 namespace HeuristicLab.Problems.TestFunctions { 14 14 [Item("Fonseca", "from // https://en.wikipedia.org/wiki/Test_functions_for_optimization [30.11.2015]")] 15 [Creatable(CreatableAttribute.Categories.CombinatorialProblems, Priority = 210)]16 15 [StorableClass] 17 16 public class Fonseca : MultiObjectiveTestFunction { … … 53 52 } 54 53 54 public override int ActualSolutionSize { 55 get { 56 return 2; 57 } 58 59 set { 60 } 61 } 62 55 63 [StorableConstructor] 56 64 protected Fonseca(bool deserializing) : base(deserializing) { } -
branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3/Testfunctions/MultiObjectiveTestFunction.cs
r13421 r13448 57 57 public abstract int MaximumProblemSize { get; } 58 58 /// <summary> 59 /// Gets the minimum problem size. 59 /// Gets and sets the actual solution size. 60 /// </summary> 61 public abstract int ActualSolutionSize { get; set; } 62 /// <summary> 63 /// Gets the minimum solution size. 60 64 /// </summary> 61 65 public abstract int MinimumSolutionSize { get; } 62 66 /// <summary> 63 /// Gets the maximum problemsize.67 /// Gets the maximum solution size. 64 68 /// </summary> 65 69 public abstract int MaximumSolutionSize { get; } -
branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3/Testfunctions/SchafferN1.cs
r13421 r13448 13 13 namespace HeuristicLab.Problems.TestFunctions { 14 14 [Item("SchafferN1", "from // https://en.wikipedia.org/wiki/Test_functions_for_optimization [30.11.2015]")] 15 [Creatable(CreatableAttribute.Categories.CombinatorialProblems, Priority = 210)]16 15 [StorableClass] 17 16 public class SchafferN1 : MultiObjectiveTestFunction { … … 53 52 } 54 53 54 public override int ActualSolutionSize { 55 get { 56 return 2; 57 } 58 59 set { 60 } 61 } 62 55 63 [StorableConstructor] 56 64 protected SchafferN1(bool deserializing) : base(deserializing) { } -
branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3/Testfunctions/SchafferN2.cs
r13421 r13448 13 13 namespace HeuristicLab.Problems.TestFunctions { 14 14 [Item("SchafferN2", "from // https://en.wikipedia.org/wiki/Test_functions_for_optimization [30.11.2015]")] 15 [Creatable(CreatableAttribute.Categories.CombinatorialProblems, Priority = 210)]16 15 [StorableClass] 17 16 public class SchafferN2 : MultiObjectiveTestFunction { … … 53 52 } 54 53 54 public override int ActualSolutionSize { 55 get { 56 return 2; 57 } 58 59 set { 60 } 61 } 62 55 63 [StorableConstructor] 56 64 protected SchafferN2(bool deserializing) : base(deserializing) { }
Note: See TracChangeset
for help on using the changeset viewer.