diff --git a/src/eva2/server/go/problems/F16Problem.java b/src/eva2/server/go/problems/F16Problem.java index d207f451..f0ae0f4c 100644 --- a/src/eva2/server/go/problems/F16Problem.java +++ b/src/eva2/server/go/problems/F16Problem.java @@ -1,6 +1,15 @@ package eva2.server.go.problems; -public class F16Problem extends AbstractProblemDouble implements InterfaceMultimodalProblem, Interface2DBorderProblem { +import eva2.server.go.operators.postprocess.SolutionHistogram; + +/** + * The Vincent function: Multiple optima with increasing density near the lower bounds, + * therefore decreasing attractor size. All have an equal best fitness of zero. + * + * @author mkron + * + */ +public class F16Problem extends AbstractProblemDouble implements InterfaceMultimodalProblem, Interface2DBorderProblem, InterfaceInterestingHistogram { int dim = 10; public F16Problem() { @@ -11,6 +20,10 @@ public class F16Problem extends AbstractProblemDouble implements InterfaceMultim dim = other.dim; } + public F16Problem(int theDim) { + this.dim=theDim; + } + @Override public double[] eval(double[] x) { x = rotateMaybe(x); @@ -47,10 +60,15 @@ public class F16Problem extends AbstractProblemDouble implements InterfaceMultim } public String getName() { - return "Vincent function"; + return "Vincent"; } public static String globalInfo() { - return "Multiple optima with increasing densitiy near the lower bounds, therefore decreasing attractor size."; + return "The Vincent function: Multiple optima with increasing densitiy near the lower bounds, therefore decreasing attractor size. All have an equal best fitness of zero."; + } + + public SolutionHistogram getHistogram() { + return new SolutionHistogram(-0.001, 0.599, 15); +// return new SolutionHistogram(-0.001, 0.099, 5); } } diff --git a/src/eva2/server/go/problems/F17Problem.java b/src/eva2/server/go/problems/F17Problem.java index 6aa6c691..c1a4cf37 100644 --- a/src/eva2/server/go/problems/F17Problem.java +++ b/src/eva2/server/go/problems/F17Problem.java @@ -5,7 +5,7 @@ import eva2.server.go.operators.postprocess.SolutionHistogram; * Bohachevsky function, numerous optima on an oval hyperparabola with similar attractor sizes * but decreasing fitness towards the bounds. Described e.g. in Shir&Bäck, PPSN 2006, * "Niche radius adaption in the CMA-ES Niching Algorithm". - * + * f_B(\vec{x})=\sum_{i=1}^{n-1} x_i^2+2(x_{i+1}^2)+0.7-0.3 cos (3 \pi x_i)-0.4 cos (4 \pi x_{i+1}) */ public class F17Problem extends AbstractProblemDouble implements InterfaceMultimodalProblem, InterfaceInterestingHistogram{ diff --git a/src/eva2/server/go/problems/F19Problem.java b/src/eva2/server/go/problems/F19Problem.java index 9043a1e2..b1189e58 100644 --- a/src/eva2/server/go/problems/F19Problem.java +++ b/src/eva2/server/go/problems/F19Problem.java @@ -13,7 +13,7 @@ import eva2.tools.math.RNG; * */ public class F19Problem extends AbstractProblemDouble implements -InterfaceMultimodalProblem, InterfaceInterestingHistogram { +InterfaceMultimodalProblem, InterfaceInterestingHistogram, InterfaceFirstOrderDerivableProblem { int dim = 10; transient private double[] alphas, As; transient private int[] A,B; @@ -57,6 +57,17 @@ InterfaceMultimodalProblem, InterfaceInterestingHistogram { } return v; } + + /** + * Calculate partial derivation of the B_i function by the j-th coordinate + * @param x + * @param i + * @return + */ + private double derivedTransform(double[] x, int i, int j) { + double v = get(A, i, j)*Math.cos(x[j])-get(B, i, j)*Math.sin(x[j]); + return v; + } /** * Get a value in row i, col j, from matrix M (represented as vector). @@ -111,5 +122,21 @@ InterfaceMultimodalProblem, InterfaceInterestingHistogram { if (getProblemDimension()<15) return new SolutionHistogram(0, 8, 16); else return new SolutionHistogram(0, 40000, 16); } + + public double[] getFirstOrderGradients(double[] x) { + x = rotateMaybe(x); + double[] res = new double[x.length]; + double[] Bs = transform(x); + + for (int k=0; k