Changed Description annotation.

Added @Description to all F-Functions
This commit is contained in:
2013-12-10 20:25:22 +01:00
parent 5affc1544c
commit 6f72d70f94
52 changed files with 100 additions and 332 deletions

View File

@@ -638,7 +638,7 @@ public class BeanInspector {
Description description = obj.getClass().getAnnotation(Description.class); Description description = obj.getClass().getAnnotation(Description.class);
if (description != null) { if (description != null) {
infoBf.append("\t"); infoBf.append("\t");
infoBf.append(description.text()); infoBf.append(description.value());
} }
} }

View File

@@ -356,7 +356,7 @@ public class OptimizationEditorPanel extends JPanel implements ItemListener {
if (tip == null || tip.isEmpty()) { if (tip == null || tip.isEmpty()) {
Description description = instances.get(i).getAnnotation(Description.class); Description description = instances.get(i).getAnnotation(Description.class);
if (description != null) { if (description != null) {
tip = description.text(); tip = description.value();
} }
} }

View File

@@ -33,7 +33,7 @@ import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
@eva2.util.annotation.Description(text = "This is a simple example framework for Evolutionary Algorithms.") @eva2.util.annotation.Description(value = "This is a simple example framework for Evolutionary Algorithms.")
public class StandaloneOptimization implements InterfaceStandaloneOptimization, InterfacePopulationChangedEventListener, java.io.Serializable { public class StandaloneOptimization implements InterfaceStandaloneOptimization, InterfacePopulationChangedEventListener, java.io.Serializable {
// Interface GUI Stuff // Interface GUI Stuff

View File

@@ -19,7 +19,7 @@ import java.util.Comparator;
* @author mkron * @author mkron
* @see #AbstractEAIndividual().isDominatingFitness(double[], double[]) * @see #AbstractEAIndividual().isDominatingFitness(double[], double[])
*/ */
@eva2.util.annotation.Description(text = "A comparator class for general EA individuals. Compares individuals based on their fitness in context of minimization.") @eva2.util.annotation.Description(value = "A comparator class for general EA individuals. Compares individuals based on their fitness in context of minimization.")
public class AbstractEAIndividualComparator implements Comparator<Object>, Serializable { public class AbstractEAIndividualComparator implements Comparator<Object>, Serializable {
// flag whether a data field should be used. // flag whether a data field should be used.
private String indyDataKey = ""; private String indyDataKey = "";

View File

@@ -14,7 +14,7 @@ import java.util.BitSet;
* This individual uses a real-valued genotype to code for binary values, either * This individual uses a real-valued genotype to code for binary values, either
* by using a threshold value of by interpreting the double value as probability. * by using a threshold value of by interpreting the double value as probability.
*/ */
@eva2.util.annotation.Description(text = "This is an ES individual adopted to optimize binary values.") @eva2.util.annotation.Description(value = "This is an ES individual adopted to optimize binary values.")
public class ESIndividualBinaryData extends AbstractEAIndividual implements InterfaceESIndividual, InterfaceDataTypeBinary, java.io.Serializable { public class ESIndividualBinaryData extends AbstractEAIndividual implements InterfaceESIndividual, InterfaceDataTypeBinary, java.io.Serializable {
private BitSet m_Phenotype = new BitSet(); private BitSet m_Phenotype = new BitSet();

View File

@@ -15,7 +15,7 @@ import eva2.util.annotation.Description;
/** /**
* This individual uses a real-valued genotype to code for double values. * This individual uses a real-valued genotype to code for double values.
*/ */
@Description(text = "This is an ES individual suited to optimize double values.") @Description(value = "This is an ES individual suited to optimize double values.")
public class ESIndividualDoubleData extends AbstractEAIndividual implements InterfaceESIndividual, InterfaceDataTypeDouble, java.io.Serializable { public class ESIndividualDoubleData extends AbstractEAIndividual implements InterfaceESIndividual, InterfaceDataTypeDouble, java.io.Serializable {
private double[] genotype; private double[] genotype;

View File

@@ -11,7 +11,7 @@ import eva2.util.annotation.Description;
/** /**
* This individual uses a real-valued genotype to code for integer values. * This individual uses a real-valued genotype to code for integer values.
*/ */
@Description(text = "This is an ES individual suited to optimize integer values.") @Description(value = "This is an ES individual suited to optimize integer values.")
public class ESIndividualIntegerData extends AbstractEAIndividual implements InterfaceESIndividual, InterfaceDataTypeInteger, java.io.Serializable { public class ESIndividualIntegerData extends AbstractEAIndividual implements InterfaceESIndividual, InterfaceDataTypeInteger, java.io.Serializable {
private double[] genotype; private double[] genotype;

View File

@@ -12,7 +12,7 @@ import eva2.util.annotation.Description;
* This individual uses a real-valued genotype to code for a permutations, * This individual uses a real-valued genotype to code for a permutations,
* the sorting of the real-valued genotype gives the permutation. * the sorting of the real-valued genotype gives the permutation.
*/ */
@Description(text = "This is an ES individual suited to optimize permutations.") @Description(value = "This is an ES individual suited to optimize permutations.")
public class ESIndividualPermutationData extends AbstractEAIndividual implements InterfaceESIndividual, InterfaceDataTypePermutation, java.io.Serializable { public class ESIndividualPermutationData extends AbstractEAIndividual implements InterfaceESIndividual, InterfaceDataTypePermutation, java.io.Serializable {
private double[][] m_Genotype; private double[][] m_Genotype;

View File

@@ -12,7 +12,7 @@ import java.util.BitSet;
/** /**
* This individual combines a binary and a real-valued phenotype. * This individual combines a binary and a real-valued phenotype.
*/ */
@Description(text = "This is a mixed data type combining a BitSet and a real-valued vector.") @Description(value = "This is a mixed data type combining a BitSet and a real-valued vector.")
public class GAESIndividualBinaryDoubleData extends AbstractEAIndividual implements InterfaceDataTypeBinary, InterfaceDataTypeDouble, java.io.Serializable { public class GAESIndividualBinaryDoubleData extends AbstractEAIndividual implements InterfaceDataTypeBinary, InterfaceDataTypeDouble, java.io.Serializable {
private InterfaceDataTypeDouble m_Numbers = new ESIndividualDoubleData(); private InterfaceDataTypeDouble m_Numbers = new ESIndividualDoubleData();

View File

@@ -14,7 +14,7 @@ import java.util.BitSet;
/** /**
* This individual uses a binary genotype to code for binary values. * This individual uses a binary genotype to code for binary values.
*/ */
@Description(text = "This is a GA individual suited to optimize binary values.") @Description(value = "This is a GA individual suited to optimize binary values.")
public class GAIndividualBinaryData extends AbstractEAIndividual implements InterfaceDataTypeBinary, InterfaceGAIndividual, java.io.Serializable { public class GAIndividualBinaryData extends AbstractEAIndividual implements InterfaceDataTypeBinary, InterfaceGAIndividual, java.io.Serializable {
protected BitSet m_Genotype = new BitSet(); protected BitSet m_Genotype = new BitSet();

View File

@@ -17,7 +17,7 @@ import java.util.BitSet;
* This individual uses a binary genotype to code for double values * This individual uses a binary genotype to code for double values
* using two alternative encodings. * using two alternative encodings.
*/ */
@Description(text = "This is a GA individual suited to optimize double values.") @Description(value = "This is a GA individual suited to optimize double values.")
public class GAIndividualDoubleData extends AbstractEAIndividual implements InterfaceGAIndividual, InterfaceDataTypeDouble, java.io.Serializable { public class GAIndividualDoubleData extends AbstractEAIndividual implements InterfaceGAIndividual, InterfaceDataTypeDouble, java.io.Serializable {
private double[] m_Phenotype; private double[] m_Phenotype;

View File

@@ -16,7 +16,7 @@ import java.util.BitSet;
* This individual uses a binary genotype to code for binary values using * This individual uses a binary genotype to code for binary values using
* two alternative encodings. * two alternative encodings.
*/ */
@Description(text = "This is a GA individual suited to optimize int values.") @Description(value = "This is a GA individual suited to optimize int values.")
public class GAIndividualIntegerData extends AbstractEAIndividual implements InterfaceGAIndividual, InterfaceDataTypeInteger, java.io.Serializable { public class GAIndividualIntegerData extends AbstractEAIndividual implements InterfaceGAIndividual, InterfaceDataTypeInteger, java.io.Serializable {
private int[] phenotype; private int[] phenotype;

View File

@@ -18,7 +18,7 @@ import java.util.BitSet;
* This individual uses a binary genotype to code for a tree-based representation * This individual uses a binary genotype to code for a tree-based representation
* using a BNF grammar, see also Grammatical Evolution. * using a BNF grammar, see also Grammatical Evolution.
*/ */
@Description(text = "This is a GE individual suited to optimize programs.") @Description(value = "This is a GE individual suited to optimize programs.")
public class GEIndividualProgramData extends AbstractEAIndividual implements InterfaceGAIndividual, InterfaceDataTypeProgram, java.io.Serializable { public class GEIndividualProgramData extends AbstractEAIndividual implements InterfaceGAIndividual, InterfaceDataTypeProgram, java.io.Serializable {
protected GPArea[] m_Area; protected GPArea[] m_Area;

View File

@@ -11,7 +11,7 @@ import eva2.util.annotation.Description;
/** /**
* This individual uses a integer genotype to code for integer values. * This individual uses a integer genotype to code for integer values.
*/ */
@Description(text = "This is a GI individual suited to optimize int values.") @Description(value = "This is a GI individual suited to optimize int values.")
public class GIIndividualIntegerData extends AbstractEAIndividual implements InterfaceGIIndividual, InterfaceDataTypeInteger, java.io.Serializable { public class GIIndividualIntegerData extends AbstractEAIndividual implements InterfaceGIIndividual, InterfaceDataTypeInteger, java.io.Serializable {
private int[] m_Phenotype; private int[] m_Phenotype;

View File

@@ -9,7 +9,7 @@ import eva2.util.annotation.Description;
/** /**
* This individual combines a binary and a real-valued phenotype. * This individual combines a binary and a real-valued phenotype.
*/ */
@Description(text = "This is a mixed data type combining an integer vector with a permutation vector.") @Description(value = "This is a mixed data type combining an integer vector with a permutation vector.")
public class GIOBGAIndividualIntegerPermutationData extends AbstractEAIndividual implements InterfaceDataTypeInteger, InterfaceDataTypePermutation, java.io.Serializable { public class GIOBGAIndividualIntegerPermutationData extends AbstractEAIndividual implements InterfaceDataTypeInteger, InterfaceDataTypePermutation, java.io.Serializable {
private InterfaceDataTypeInteger m_Integer = new GIIndividualIntegerData(); private InterfaceDataTypeInteger m_Integer = new GIIndividualIntegerData();

View File

@@ -15,7 +15,7 @@ import eva2.util.annotation.Description;
/** /**
* This individual uses a tree-based genotype to code for program trees. * This individual uses a tree-based genotype to code for program trees.
*/ */
@Description(text = "This is a GP individual suited to optimize Koza style program trees.") @Description(value = "This is a GP individual suited to optimize Koza style program trees.")
public class GPIndividualProgramData extends AbstractEAIndividual implements InterfaceGPIndividual, InterfaceDataTypeProgram, java.io.Serializable { public class GPIndividualProgramData extends AbstractEAIndividual implements InterfaceGPIndividual, InterfaceDataTypeProgram, java.io.Serializable {
protected AbstractGPNode[] genotype; protected AbstractGPNode[] genotype;

View File

@@ -14,7 +14,7 @@ import java.util.ArrayList;
* This individual uses a permutation based genotype to code for * This individual uses a permutation based genotype to code for
* permutations. * permutations.
*/ */
@Description(text = "This is a GA individual coding permutations.") @Description(value = "This is a GA individual coding permutations.")
public class OBGAIndividualPermutationData extends AbstractEAIndividual implements InterfaceDataTypePermutation, InterfaceOBGAIndividual, java.io.Serializable { public class OBGAIndividualPermutationData extends AbstractEAIndividual implements InterfaceDataTypePermutation, InterfaceOBGAIndividual, java.io.Serializable {
int[][] phenotype; int[][] phenotype;

View File

@@ -6,7 +6,7 @@ import eva2.optimization.population.Population;
/** /**
* The non dominated sorting GA archiving method, based on dominace sorting. * The non dominated sorting GA archiving method, based on dominace sorting.
*/ */
@eva2.util.annotation.Description(text="Non-dominating sorting GA revision 1.0.") @eva2.util.annotation.Description(value ="Non-dominating sorting GA revision 1.0.")
public class ArchivingNSGA extends AbstractArchiving implements java.io.Serializable { public class ArchivingNSGA extends AbstractArchiving implements java.io.Serializable {
public InterfaceRemoveSurplusIndividuals m_Cleaner = new RemoveSurplusIndividualsDynamicHyperCube(); public InterfaceRemoveSurplusIndividuals m_Cleaner = new RemoveSurplusIndividualsDynamicHyperCube();

View File

@@ -8,7 +8,7 @@ import eva2.util.annotation.Description;
import java.io.Serializable; import java.io.Serializable;
@Description(text = "Boolean combination of two terminators.") @Description(value = "Boolean combination of two terminators.")
public class CombinedTerminator implements InterfaceTerminator, Serializable { public class CombinedTerminator implements InterfaceTerminator, Serializable {
/** /**
* *

View File

@@ -13,7 +13,7 @@ import java.io.Serializable;
* the exact number of fitness calls, since terminators are only once per * the exact number of fitness calls, since terminators are only once per
* generation. * generation.
*/ */
@Description(text = "Terminates after the given number of fitness calls.") @Description(value = "Terminates after the given number of fitness calls.")
public class EvaluationTerminator implements InterfaceTerminator, public class EvaluationTerminator implements InterfaceTerminator,
Serializable { Serializable {
private String msg = "Not terminated."; private String msg = "Not terminated.";

View File

@@ -10,7 +10,7 @@ import java.io.Serializable;
/** /**
* *
*/ */
@Description(text = "Terminate after the given number of generations") @Description(value = "Terminate after the given number of generations")
public class GenerationTerminator implements InterfaceTerminator, Serializable { public class GenerationTerminator implements InterfaceTerminator, Serializable {
/** /**

View File

@@ -1,14 +1,12 @@
package eva2.optimization.problems; package eva2.optimization.problems;
import eva2.optimization.individuals.ESIndividualDoubleData; import eva2.optimization.individuals.ESIndividualDoubleData;
import eva2.util.annotation.Description;
/** /**
* Created by IntelliJ IDEA. * Weierstrass-Mandelbrot Fractal Function
* User: streiche
* Date: 30.06.2005
* Time: 14:33:07
* To change this template use File | Settings | File Templates.
*/ */
@Description("Weierstrass-Mandelbrot Fractal Function")
public class F10Problem extends AbstractProblemDoubleOffset implements InterfaceMultimodalProblem, java.io.Serializable { public class F10Problem extends AbstractProblemDoubleOffset implements InterfaceMultimodalProblem, java.io.Serializable {
private double m_D = 1.5; private double m_D = 1.5;
@@ -82,9 +80,6 @@ public class F10Problem extends AbstractProblemDoubleOffset implements Interface
return result; return result;
} }
/**********************************************************************************************************************
* These are for GUI
*/
/** /**
* This method allows the CommonJavaObjectEditorPanel to read the * This method allows the CommonJavaObjectEditorPanel to read the
* name to the current object. * name to the current object.
@@ -96,15 +91,6 @@ public class F10Problem extends AbstractProblemDoubleOffset implements Interface
return "F10 Problem"; return "F10 Problem";
} }
/**
* This method returns a global info string
*
* @return description
*/
public static String globalInfo() {
return "Weierstrass-Mandelbrot Fractal Function";
}
/** /**
* This method allows you to set/get d. * This method allows you to set/get d.
* *

View File

@@ -1,14 +1,12 @@
package eva2.optimization.problems; package eva2.optimization.problems;
import eva2.optimization.individuals.ESIndividualDoubleData; import eva2.optimization.individuals.ESIndividualDoubleData;
import eva2.util.annotation.Description;
/** /**
* Created by IntelliJ IDEA. * Griewank Function
* User: streiche
* Date: 30.06.2005
* Time: 14:59:23
* To change this template use File | Settings | File Templates.
*/ */
@Description("Griewank Function")
public class F11Problem extends AbstractProblemDoubleOffset implements InterfaceMultimodalProblem, java.io.Serializable { public class F11Problem extends AbstractProblemDoubleOffset implements InterfaceMultimodalProblem, java.io.Serializable {
private double m_D = 4000; private double m_D = 4000;
@@ -71,9 +69,6 @@ public class F11Problem extends AbstractProblemDoubleOffset implements Interface
return result; return result;
} }
/**********************************************************************************************************************
* These are for GUI
*/
/** /**
* This method allows the CommonJavaObjectEditorPanel to read the * This method allows the CommonJavaObjectEditorPanel to read the
* name to the current object. * name to the current object.
@@ -85,15 +80,6 @@ public class F11Problem extends AbstractProblemDoubleOffset implements Interface
return "F11-Problem"; return "F11-Problem";
} }
/**
* This method returns a global info string
*
* @return description
*/
public static String globalInfo() {
return "Griewank Function";
}
/** /**
* This method allows you to set/get d. * This method allows you to set/get d.
* *

View File

@@ -1,14 +1,13 @@
package eva2.optimization.problems; package eva2.optimization.problems;
import eva2.util.annotation.Description;
import java.io.Serializable; import java.io.Serializable;
/** /**
* Created by IntelliJ IDEA. * Galar Function
* User: streiche
* Date: 30.06.2005
* Time: 14:59:33
* To change this template use File | Settings | File Templates.
*/ */
@Description("Galar Function")
public class F12Problem extends AbstractProblemDoubleOffset implements Serializable { public class F12Problem extends AbstractProblemDoubleOffset implements Serializable {
private final static double f12range = 5.; private final static double f12range = 5.;
@@ -66,9 +65,6 @@ public class F12Problem extends AbstractProblemDoubleOffset implements Serializa
return result; return result;
} }
/**********************************************************************************************************************
* These are for GUI
*/
/** /**
* This method allows the CommonJavaObjectEditorPanel to read the * This method allows the CommonJavaObjectEditorPanel to read the
* name to the current object. * name to the current object.
@@ -79,14 +75,4 @@ public class F12Problem extends AbstractProblemDoubleOffset implements Serializa
public String getName() { public String getName() {
return "F12 Problem"; return "F12 Problem";
} }
/**
* This method returns a global info string
*
* @return description
*/
public static String globalInfo() {
return "Galar Function";
}
} }

View File

@@ -3,11 +3,13 @@ package eva2.optimization.problems;
import eva2.gui.editor.GenericObjectEditor; import eva2.gui.editor.GenericObjectEditor;
import eva2.optimization.individuals.ESIndividualDoubleData; import eva2.optimization.individuals.ESIndividualDoubleData;
import eva2.optimization.operator.postprocess.SolutionHistogram; import eva2.optimization.operator.postprocess.SolutionHistogram;
import eva2.util.annotation.Description;
/** /**
* Schwefels sine root function (1981) with a minimum at 420.9687^n of value 0. * Schwefels sine root function (1981) with a minimum at 420.9687^n of value 0.
* Function f(x) = (418.9829 * n) - sum_n(x_i * sin(sqrt(abs(x_i)))) + (418.9829 * n); * Function f(x) = (418.9829 * n) - sum_n(x_i * sin(sqrt(abs(x_i)))) + (418.9829 * n);
*/ */
@Description("Schwefel's sine-root Function (multimodal, 1981). Remember to use range check! Note that rotating the function may make it easier because new, and better, minima may enter the search space.")
public class F13Problem extends AbstractProblemDoubleOffset implements InterfaceMultimodalProblem, InterfaceInterestingHistogram { public class F13Problem extends AbstractProblemDoubleOffset implements InterfaceMultimodalProblem, InterfaceInterestingHistogram {
public F13Problem() { public F13Problem() {
@@ -101,9 +103,7 @@ public class F13Problem extends AbstractProblemDoubleOffset implements Interface
return new SolutionHistogram(0, 3200, 12); return new SolutionHistogram(0, 3200, 12);
} }
} }
/**********************************************************************************************************************
* These are for GUI
*/
/** /**
* This method allows the CommonJavaObjectEditorPanel to read the * This method allows the CommonJavaObjectEditorPanel to read the
* name to the current object. * name to the current object.
@@ -115,15 +115,6 @@ public class F13Problem extends AbstractProblemDoubleOffset implements Interface
return "F13-Problem"; return "F13-Problem";
} }
/**
* This method returns a global info string
*
* @return description
*/
public static String globalInfo() {
return "Schwefels sine-root Function (multimodal, 1981). Remember to use range check! Note that rotating the function may make it easier because new, and better, minima may enter the search space.";
}
@Override @Override
public void setDefaultAccuracy(double v) { public void setDefaultAccuracy(double v) {
super.SetDefaultAccuracy(v); super.SetDefaultAccuracy(v);

View File

@@ -1,14 +1,12 @@
package eva2.optimization.problems; package eva2.optimization.problems;
import eva2.optimization.individuals.ESIndividualDoubleData; import eva2.optimization.individuals.ESIndividualDoubleData;
import eva2.util.annotation.Description;
/** /**
* Created by IntelliJ IDEA. * F14 function: numerous optima in linear order which may be rotated.
* User: mkron
* Date: 01.09.2007
* Time: 19:15:03
* To change this template use File | Settings | File Templates.
*/ */
@Description("F14 function: numerous optima in linear order which may be rotated")
public class F14Problem extends AbstractProblemDoubleOffset implements InterfaceMultimodalProblem, java.io.Serializable { public class F14Problem extends AbstractProblemDoubleOffset implements InterfaceMultimodalProblem, java.io.Serializable {
double rotation = 0.; double rotation = 0.;
double rotationDX = 2; double rotationDX = 2;
@@ -79,9 +77,6 @@ public class F14Problem extends AbstractProblemDoubleOffset implements Interface
return result; return result;
} }
/**********************************************************************************************************************
* These are for GUI
*/
/** /**
* This method allows the CommonJavaObjectEditorPanel to read the * This method allows the CommonJavaObjectEditorPanel to read the
* name to the current object. * name to the current object.
@@ -92,13 +87,4 @@ public class F14Problem extends AbstractProblemDoubleOffset implements Interface
public String getName() { public String getName() {
return "F14-Problem"; return "F14-Problem";
} }
/**
* This method returns a global info string
*
* @return description
*/
public static String globalInfo() {
return "F14 function: numerous optima in linear order which may be rotated.";
}
} }

View File

@@ -1,6 +1,7 @@
package eva2.optimization.problems; package eva2.optimization.problems;
import eva2.optimization.operator.postprocess.SolutionHistogram; import eva2.optimization.operator.postprocess.SolutionHistogram;
import eva2.util.annotation.Description;
import java.io.Serializable; import java.io.Serializable;
@@ -8,7 +9,7 @@ import java.io.Serializable;
* The Levy-function, from Levy, A., and Montalvo, A. (1985). Also described in * The Levy-function, from Levy, A., and Montalvo, A. (1985). Also described in
* "A Trust-Region Algorithm for Global Optimization", Bernardetta Addisy and Sven Leyfferz, 2004/2006. * "A Trust-Region Algorithm for Global Optimization", Bernardetta Addisy and Sven Leyfferz, 2004/2006.
*/ */
@Description("The Levy-function, from Levy, A., and Montalvo, A. (1985)")
public class F15Problem extends AbstractProblemDouble implements Serializable, InterfaceInterestingHistogram { public class F15Problem extends AbstractProblemDouble implements Serializable, InterfaceInterestingHistogram {
private int problemDimension = 10; private int problemDimension = 10;
@@ -75,9 +76,4 @@ public class F15Problem extends AbstractProblemDouble implements Serializable, I
public String getName() { public String getName() {
return "F15-Problem"; return "F15-Problem";
} }
public static String globalInfo() {
return "The Levy-function, from Levy, A., and Montalvo, A. (1985)";
}
} }

View File

@@ -1,13 +1,13 @@
package eva2.optimization.problems; package eva2.optimization.problems;
import eva2.optimization.operator.postprocess.SolutionHistogram; import eva2.optimization.operator.postprocess.SolutionHistogram;
import eva2.util.annotation.Description;
/** /**
* The Vincent function: Multiple optima with increasing density near the lower bounds, * The Vincent function: Multiple optima with increasing density near the lower bounds,
* therefore decreasing attractor size. All have an equal best fitness of zero. * therefore decreasing attractor size. All have an equal best fitness of zero.
*
* @author mkron
*/ */
@Description("Vincent function: Multiple optima with increasing densitiy near the lower bounds, therefore decreasing attractor size. All have an equal best fitness of zero")
public class F16Problem extends AbstractProblemDouble implements InterfaceMultimodalProblem, Interface2DBorderProblem, InterfaceInterestingHistogram { public class F16Problem extends AbstractProblemDouble implements InterfaceMultimodalProblem, Interface2DBorderProblem, InterfaceInterestingHistogram {
int dim = 10; int dim = 10;
@@ -66,10 +66,6 @@ public class F16Problem extends AbstractProblemDouble implements InterfaceMultim
return "Vincent"; return "Vincent";
} }
public static String globalInfo() {
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.";
}
@Override @Override
public SolutionHistogram getHistogram() { public SolutionHistogram getHistogram() {
return new SolutionHistogram(-0.001, 0.599, 15); return new SolutionHistogram(-0.001, 0.599, 15);

View File

@@ -1,6 +1,7 @@
package eva2.optimization.problems; package eva2.optimization.problems;
import eva2.optimization.operator.postprocess.SolutionHistogram; import eva2.optimization.operator.postprocess.SolutionHistogram;
import eva2.util.annotation.Description;
/** /**
* Bohachevsky function, numerous optima on an oval hyperparabola with similar attractor sizes * Bohachevsky function, numerous optima on an oval hyperparabola with similar attractor sizes
@@ -8,6 +9,7 @@ import eva2.optimization.operator.postprocess.SolutionHistogram;
* "Niche radius adaption in the CMA-ES Niching Algorithm". * "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}) * 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})
*/ */
@Description("Bohachevsky function, numerous optima on an oval hyperparabola with similar attractor sizes but decreasing fitness towards the bounds")
public class F17Problem extends AbstractProblemDouble implements public class F17Problem extends AbstractProblemDouble implements
InterfaceMultimodalProblem, InterfaceInterestingHistogram { InterfaceMultimodalProblem, InterfaceInterestingHistogram {
int dim = 10; int dim = 10;
@@ -59,10 +61,6 @@ public class F17Problem extends AbstractProblemDouble implements
return "F17-Problem"; return "F17-Problem";
} }
public static String globalInfo() {
return "Bohachevsky function, numerous optima on an oval hyperparabola with similar attractor sizes but decreasing fitness towards the bounds.";
}
@Override @Override
public SolutionHistogram getHistogram() { public SolutionHistogram getHistogram() {
if (getProblemDimension() < 15) { if (getProblemDimension() < 15) {

View File

@@ -1,5 +1,11 @@
package eva2.optimization.problems; package eva2.optimization.problems;
import eva2.util.annotation.Description;
/**
* N-Function from Shir&Baeck, PPSN 2006.
*/
@Description("N-Function from Shir&Baeck, PPSN 2006")
public class F18Problem extends AbstractProblemDouble implements public class F18Problem extends AbstractProblemDouble implements
InterfaceMultimodalProblem { InterfaceMultimodalProblem {
int dim = 10; int dim = 10;
@@ -54,10 +60,6 @@ public class F18Problem extends AbstractProblemDouble implements
return "F18-Problem"; return "F18-Problem";
} }
public static String globalInfo() {
return "N-Function from Shir&Baeck, PPSN 2006.";
}
/** /**
* @return the alpha * @return the alpha
*/ */

View File

@@ -2,6 +2,7 @@ package eva2.optimization.problems;
import eva2.optimization.operator.postprocess.SolutionHistogram; import eva2.optimization.operator.postprocess.SolutionHistogram;
import eva2.tools.math.RNG; import eva2.tools.math.RNG;
import eva2.util.annotation.Description;
import java.util.Arrays; import java.util.Arrays;
import java.util.Random; import java.util.Random;
@@ -10,8 +11,8 @@ import java.util.Random;
* Fletcher-Powell function with up to 2^n optima from Shir&Baeck, PPSN 2006, * Fletcher-Powell function with up to 2^n optima from Shir&Baeck, PPSN 2006,
* after Bäck 1996. Alphas and Matrices A and B are randomly created with a fixed seed. * after Bäck 1996. Alphas and Matrices A and B are randomly created with a fixed seed.
* *
* @author mkron
*/ */
@Description("Fletcher-Powell function")
public class F19Problem extends AbstractProblemDouble implements public class F19Problem extends AbstractProblemDouble implements
InterfaceMultimodalProblem, InterfaceInterestingHistogram, InterfaceFirstOrderDerivableProblem { InterfaceMultimodalProblem, InterfaceInterestingHistogram, InterfaceFirstOrderDerivableProblem {
int dim = 10; int dim = 10;
@@ -121,10 +122,6 @@ public class F19Problem extends AbstractProblemDouble implements
return "F19-Problem"; return "F19-Problem";
} }
public static String globalInfo() {
return "Fletcher-Powell function with up to 2^n optima from Shir&Baeck, PPSN 2006, after Bäck 1996. Alphas and Matrices A and B are randomly created with a fixed seed.";
}
@Override @Override
public SolutionHistogram getHistogram() { public SolutionHistogram getHistogram() {
if (getProblemDimension() < 15) { if (getProblemDimension() < 15) {

View File

@@ -7,7 +7,7 @@ import eva2.util.annotation.Description;
/** /**
* F1 Sphere Problem * F1 Sphere Problem
*/ */
@Description(text="Sphere Problem") @Description(value ="Sphere Problem")
public class F1Problem extends AbstractProblemDoubleOffset implements Interface2DBorderProblem, InterfaceHasInitRange, java.io.Serializable, InterfaceFirstOrderDerivableProblem { public class F1Problem extends AbstractProblemDoubleOffset implements Interface2DBorderProblem, InterfaceHasInitRange, java.io.Serializable, InterfaceFirstOrderDerivableProblem {
private double initialRangeRatio = 1.; // reduce to initialize in a smaller subrange of the original range (in the corner box) private double initialRangeRatio = 1.; // reduce to initialize in a smaller subrange of the original range (in the corner box)
@@ -91,15 +91,6 @@ public class F1Problem extends AbstractProblemDoubleOffset implements Interface2
return "F1-Problem"; return "F1-Problem";
} }
/**
* This method returns a global info string
*
* @return description
*/
public static String globalInfo() {
return "F1: multidimensional parabola problem";
}
@Override @Override
public double[] getFirstOrderGradients(double[] x) { public double[] getFirstOrderGradients(double[] x) {
x = rotateMaybe(x); x = rotateMaybe(x);

View File

@@ -1,15 +1,22 @@
package eva2.optimization.problems; package eva2.optimization.problems;
import eva2.optimization.operator.postprocess.SolutionHistogram; import eva2.optimization.operator.postprocess.SolutionHistogram;
import eva2.util.annotation.Description;
import java.io.Serializable; import java.io.Serializable;
/** /**
* The multi-modal, multi-funnel Rana function, f_rana = sum_{i=0}^{n-2} (g(x_i, x_{i+1}) * The multi-modal, multi-funnel Rana function, f_rana = sum_{i=0}^{n-2} (g(x_i, x_{i+1})
* with g(x,y) = x sin(a)cos(b)+(y+1)cos(a)sin(b), a=sqrt(|-x+y+1|), b=sqrt(|x+y+1|). * with g(x,y) = x sin(a)cos(b)+(y+1)cos(a)sin(b), a=sqrt(|-x+y+1|), b=sqrt(|x+y+1|).
*
* The Rana function is non-separable, highly multi-modal and multi-funnel.
* There are diagonal ridges across the search space and the optima are close to the bounds.
* The minimum fitness f(x*) is close to (n-1)*r for dimension n and default range r, by which
* this implementation may be shifted to the positive domain.
* <p/> * <p/>
* For gnuplot: x *sin(sqrt(abs(-x+y+1)))*cos(sqrt(abs(x+y+1)))+(y+1)*cos(sqrt(abs(-x+y+1)))*sin(sqrt(abs(x+y+1))) * For gnuplot: x *sin(sqrt(abs(-x+y+1)))*cos(sqrt(abs(x+y+1)))+(y+1)*cos(sqrt(abs(-x+y+1)))*sin(sqrt(abs(x+y+1)))
*/ */
@Description("Rana function")
public class F20Problem extends AbstractProblemDouble implements Serializable, InterfaceInterestingHistogram { public class F20Problem extends AbstractProblemDouble implements Serializable, InterfaceInterestingHistogram {
private int dim = 10; private int dim = 10;
private boolean shiftFit = false; private boolean shiftFit = false;

View File

@@ -1,6 +1,7 @@
package eva2.optimization.problems; package eva2.optimization.problems;
import eva2.optimization.operator.postprocess.SolutionHistogram; import eva2.optimization.operator.postprocess.SolutionHistogram;
import eva2.util.annotation.Description;
import java.util.Random; import java.util.Random;
@@ -9,8 +10,8 @@ import java.util.Random;
* The number of optima is equal to the number of dimensions. * The number of optima is equal to the number of dimensions.
* The positions and height values of the peaks are initialized randomly with a fixed seed for reproducibility. * The positions and height values of the peaks are initialized randomly with a fixed seed for reproducibility.
* *
* @author mkron
*/ */
@Description("Langerman function")
public class F21Problem extends AbstractProblemDouble implements InterfaceMultimodalProblem, InterfaceInterestingHistogram { public class F21Problem extends AbstractProblemDouble implements InterfaceMultimodalProblem, InterfaceInterestingHistogram {
private double[] heights = null; // will receive random positions within the range private double[] heights = null; // will receive random positions within the range
private double[][] peaks = null; // will receive values in [0,1] as peak height values private double[][] peaks = null; // will receive values in [0,1] as peak height values
@@ -29,10 +30,6 @@ public class F21Problem extends AbstractProblemDouble implements InterfaceMultim
return "Langerman-Function"; return "Langerman-Function";
} }
public static String globalInfo() {
return "The Langerman function, with n peaks each of which surrounded by circular ridges.";
}
@Override @Override
public double getRangeLowerBound(int dim) { public double getRangeLowerBound(int dim) {
return 0; return 0;
@@ -56,8 +53,6 @@ public class F21Problem extends AbstractProblemDouble implements InterfaceMultim
peaks[i][j] = getRangeLowerBound(i) + rnd.nextDouble() * (getRangeUpperBound(i) - getRangeLowerBound(i)); peaks[i][j] = getRangeLowerBound(i) + rnd.nextDouble() * (getRangeUpperBound(i) - getRangeLowerBound(i));
} }
} }
// System.out.println("peaks is " + BeanInspector.toString(peaks));
// System.out.println("heights is " + BeanInspector.toString(heights));
} }
@Override @Override

View File

@@ -3,14 +3,10 @@ package eva2.optimization.problems;
import eva2.optimization.individuals.ESIndividualDoubleData; import eva2.optimization.individuals.ESIndividualDoubleData;
import eva2.optimization.population.Population; import eva2.optimization.population.Population;
import eva2.optimization.strategies.GradientDescentAlgorithm; import eva2.optimization.strategies.GradientDescentAlgorithm;
import eva2.util.annotation.Description;
/** @Description(value ="Generalized Rosenbrock's function.")
* Created by IntelliJ IDEA. @SuppressWarnings("unused")
* User: streiche
* Date: 01.09.2004
* Time: 19:03:09
* To change this template use File | Settings | File Templates.
*/
public class F2Problem extends AbstractProblemDoubleOffset implements InterfaceLocalSearchable, InterfaceMultimodalProblem, java.io.Serializable, InterfaceFirstOrderDerivableProblem { public class F2Problem extends AbstractProblemDoubleOffset implements InterfaceLocalSearchable, InterfaceMultimodalProblem, java.io.Serializable, InterfaceFirstOrderDerivableProblem {
private transient GradientDescentAlgorithm localSearchOptimizer = null; private transient GradientDescentAlgorithm localSearchOptimizer = null;
@@ -96,9 +92,6 @@ public class F2Problem extends AbstractProblemDoubleOffset implements InterfaceL
return result; return result;
} }
/**********************************************************************************************************************
* These are for GUI
*/
/** /**
* This method allows the CommonJavaObjectEditorPanel to read the * This method allows the CommonJavaObjectEditorPanel to read the
* name to the current object. * name to the current object.
@@ -110,15 +103,6 @@ public class F2Problem extends AbstractProblemDoubleOffset implements InterfaceL
return "F2-Problem"; return "F2-Problem";
} }
/**
* This method returns a global info string
*
* @return description
*/
public static String globalInfo() {
return "Generalized Rosenbrock's function.";
}
@Override @Override
public void doLocalSearch(Population pop) { public void doLocalSearch(Population pop) {
if (localSearchOptimizer == null) { if (localSearchOptimizer == null) {

View File

@@ -1,14 +1,12 @@
package eva2.optimization.problems; package eva2.optimization.problems;
import eva2.optimization.individuals.ESIndividualDoubleData; import eva2.optimization.individuals.ESIndividualDoubleData;
import eva2.util.annotation.Description;
/** /**
* Created by IntelliJ IDEA. *
* User: streiche
* Date: 01.09.2004
* Time: 19:15:03
* To change this template use File | Settings | File Templates.
*/ */
@Description("Step function.")
public class F3Problem extends AbstractProblemDoubleOffset implements java.io.Serializable { public class F3Problem extends AbstractProblemDoubleOffset implements java.io.Serializable {
public F3Problem() { public F3Problem() {
@@ -77,13 +75,4 @@ public class F3Problem extends AbstractProblemDoubleOffset implements java.io.Se
public String getName() { public String getName() {
return "F3 Problem"; return "F3 Problem";
} }
/**
* This method returns a global info string
*
* @return description
*/
public static String globalInfo() {
return "Step function.";
}
} }

View File

@@ -1,14 +1,14 @@
package eva2.optimization.problems; package eva2.optimization.problems;
import eva2.util.annotation.Description;
import java.io.Serializable; import java.io.Serializable;
/** /**
* Created by IntelliJ IDEA. *
* User: streiche
* Date: 01.09.2004
* Time: 19:28:33
* To change this template use File | Settings | File Templates.
*/ */
@SuppressWarnings("unused")
@Description("Quadratic Function with noise.")
public class F4Problem extends AbstractProblemDoubleOffset implements Serializable { public class F4Problem extends AbstractProblemDoubleOffset implements Serializable {
final static double f4range = 1.28; final static double f4range = 1.28;
@@ -65,9 +65,6 @@ public class F4Problem extends AbstractProblemDoubleOffset implements Serializab
return result; return result;
} }
/**********************************************************************************************************************
* These are for GUI
*/
/** /**
* This method allows the CommonJavaObjectEditorPanel to read the * This method allows the CommonJavaObjectEditorPanel to read the
* name to the current object. * name to the current object.
@@ -78,13 +75,4 @@ public class F4Problem extends AbstractProblemDoubleOffset implements Serializab
public String getName() { public String getName() {
return "F4 Problem"; return "F4 Problem";
} }
/**
* This method returns a global info string
*
* @return description
*/
public static String globalInfo() {
return "Quadratic Function with noise.";
}
} }

View File

@@ -1,14 +1,13 @@
package eva2.optimization.problems; package eva2.optimization.problems;
import eva2.util.annotation.Description;
import java.io.Serializable; import java.io.Serializable;
/** /**
* Created by IntelliJ IDEA. *
* User: streiche
* Date: 01.09.2004
* Time: 19:30:52
* To change this template use File | Settings | File Templates.
*/ */
@Description("Schwefel's Function.")
public class F5Problem extends AbstractProblemDoubleOffset implements Serializable { public class F5Problem extends AbstractProblemDoubleOffset implements Serializable {
final static double f5range = 65.536; final static double f5range = 65.536;
@@ -70,9 +69,6 @@ public class F5Problem extends AbstractProblemDoubleOffset implements Serializab
return result; return result;
} }
/**********************************************************************************************************************
* These are for GUI
*/
/** /**
* This method allows the CommonJavaObjectEditorPanel to read the * This method allows the CommonJavaObjectEditorPanel to read the
* name to the current object. * name to the current object.
@@ -83,13 +79,4 @@ public class F5Problem extends AbstractProblemDoubleOffset implements Serializab
public String getName() { public String getName() {
return "F5 Problem"; return "F5 Problem";
} }
/**
* This method returns a global info string
*
* @return description
*/
public static String globalInfo() {
return "Schwefel's Function.";
}
} }

View File

@@ -4,12 +4,14 @@ import eva2.optimization.individuals.ESIndividualDoubleData;
import eva2.optimization.operator.postprocess.SolutionHistogram; import eva2.optimization.operator.postprocess.SolutionHistogram;
import eva2.optimization.population.Population; import eva2.optimization.population.Population;
import eva2.optimization.strategies.GradientDescentAlgorithm; import eva2.optimization.strategies.GradientDescentAlgorithm;
import eva2.util.annotation.Description;
import java.io.Serializable; import java.io.Serializable;
/** /**
* Generalized Rastrigin's function. * Generalized Rastrigin's function.
*/ */
@Description("Generalized Rastrigins's function.")
public class F6Problem extends AbstractProblemDoubleOffset public class F6Problem extends AbstractProblemDoubleOffset
implements InterfaceMultimodalProblem, InterfaceFirstOrderDerivableProblem, InterfaceLocalSearchable, Serializable, InterfaceInterestingHistogram { implements InterfaceMultimodalProblem, InterfaceFirstOrderDerivableProblem, InterfaceLocalSearchable, Serializable, InterfaceInterestingHistogram {
private double m_A = 10; private double m_A = 10;
@@ -87,9 +89,6 @@ public class F6Problem extends AbstractProblemDoubleOffset
return result; return result;
} }
/**********************************************************************************************************************
* These are for GUI
*/
/** /**
* This method allows the CommonJavaObjectEditorPanel to read the * This method allows the CommonJavaObjectEditorPanel to read the
* name to the current object. * name to the current object.
@@ -101,15 +100,6 @@ public class F6Problem extends AbstractProblemDoubleOffset
return "F6-Problem"; return "F6-Problem";
} }
/**
* This method returns a global info string
*
* @return description
*/
public static String globalInfo() {
return "Generalized Rastrigins's function.";
}
/** /**
* This method allows you to set/get an offset for decision variables. * This method allows you to set/get an offset for decision variables.
* *

View File

@@ -5,16 +5,14 @@ import eva2.optimization.individuals.ESIndividualDoubleData;
import eva2.optimization.population.Population; import eva2.optimization.population.Population;
import eva2.tools.SelectedTag; import eva2.tools.SelectedTag;
import eva2.tools.Tag; import eva2.tools.Tag;
import eva2.util.annotation.Description;
import java.io.Serializable; import java.io.Serializable;
/** /**
* Created by IntelliJ IDEA. *
* User: streiche
* Date: 30.06.2005
* Time: 13:23:43
* To change this template use File | Settings | File Templates.
*/ */
@Description("Sphere Model, changing Environment.")
public class F7Problem extends AbstractProblemDoubleOffset implements Serializable { public class F7Problem extends AbstractProblemDoubleOffset implements Serializable {
private double m_t = 250; private double m_t = 250;
@@ -112,9 +110,6 @@ public class F7Problem extends AbstractProblemDoubleOffset implements Serializab
return result; return result;
} }
/**********************************************************************************************************************
* These are for GUI
*/
/** /**
* This method allows the CommonJavaObjectEditorPanel to read the * This method allows the CommonJavaObjectEditorPanel to read the
* name to the current object. * name to the current object.
@@ -126,15 +121,6 @@ public class F7Problem extends AbstractProblemDoubleOffset implements Serializab
return "F7 Problem"; return "F7 Problem";
} }
/**
* This method returns a global info string
*
* @return description
*/
public static String globalInfo() {
return "Sphere Model, changing Environment.";
}
/** /**
* Set the lower limit for the mutation step size with this method. * Set the lower limit for the mutation step size with this method.
* *

View File

@@ -7,17 +7,15 @@ import eva2.optimization.population.Population;
import eva2.optimization.population.PopulationInterface; import eva2.optimization.population.PopulationInterface;
import eva2.tools.ToolBox; import eva2.tools.ToolBox;
import eva2.tools.math.Mathematics; import eva2.tools.math.Mathematics;
import eva2.util.annotation.Description;
import java.util.Arrays; import java.util.Arrays;
/** /**
* Created by IntelliJ IDEA. * Ackley's function.
* User: streiche
* Date: 01.09.2004
* Time: 19:40:28
* To change this template use File | Settings | File Templates.
*/ */
@Description("Ackley's function.")
public class F8Problem extends AbstractProblemDoubleOffset public class F8Problem extends AbstractProblemDoubleOffset
implements InterfaceInterestingHistogram, InterfaceMultimodalProblem, //InterfaceFirstOrderDerivableProblem, implements InterfaceInterestingHistogram, InterfaceMultimodalProblem, //InterfaceFirstOrderDerivableProblem,
InterfaceMultimodalProblemKnown, java.io.Serializable { InterfaceMultimodalProblemKnown, java.io.Serializable {
@@ -106,9 +104,6 @@ public class F8Problem extends AbstractProblemDoubleOffset
initListOfOptima(); initListOfOptima();
} }
/**********************************************************************************************************************
* These are for GUI
*/
/** /**
* This method allows the CommonJavaObjectEditorPanel to read the * This method allows the CommonJavaObjectEditorPanel to read the
* name to the current object. * name to the current object.
@@ -120,15 +115,6 @@ public class F8Problem extends AbstractProblemDoubleOffset
return "F8-Problem"; return "F8-Problem";
} }
/**
* This method returns a global info string
*
* @return description
*/
public static String globalInfo() {
return "Ackley's function.";
}
@Override @Override
public SolutionHistogram getHistogram() { public SolutionHistogram getHistogram() {
if (getProblemDimension() < 15) { if (getProblemDimension() < 15) {
@@ -140,27 +126,6 @@ public class F8Problem extends AbstractProblemDoubleOffset
} }
} }
// public double[] getFirstOrderGradients(double[] x) {
// double sum1=0, sum2=0;
// double[] derivs = new double[x.length];
// x = rotateMaybe(x);
// double dim = (double)this.problemDimension;
//
// for (int i = 0; i < x.length; i++) {
// double xi = x[i]-xOffset;
// sum1 += (xi)*(xi);
// sum2 += Math.cos(c * (xi));
// }
//
// for (int i=0; i<x.length; i++) {
// if (sum1==0) derivs[i]=0;
// else derivs[i]=((this.b*2*x[i]*this.a)/(Math.sqrt(sum1/dim)))*Math.exp(-this.b*Math.sqrt(sum1/dim));
// derivs[i]+= ((this.c/dim)*(Math.sin(this.c*x[i])))*Math.exp(sum2/dim);
// }
// System.out.println("at " + BeanInspector.toString(x) + " sum1 " + sum1 + " sum2 " + sum2 + " deriv " + BeanInspector.toString(derivs));
// return derivs;
// }
@Override @Override
public boolean fullListAvailable() { public boolean fullListAvailable() {
return true; return true;
@@ -239,15 +204,11 @@ public class F8Problem extends AbstractProblemDoubleOffset
} }
} }
} }
// System.out.println("Inited " + listOfOptima.size() + " optima, measures: " + BeanInspector.toString(listOfOptima.getPopulationMeasures(new PhenotypeMetric())));
// System.out.println("Inited " + listOfOptima.size() + " optima, measures: " + BeanInspector.toString(listOfOptima.getPopulationMeasures(new EuclideanMetric())));
// System.out.println(listOfOptima.getStringRepresentation());
state_initializing_optima = false; state_initializing_optima = false;
} }
} }
private double[] refineSolution(AbstractProblemDouble prob, double[] pos, double[] vect, double initStep, double thresh, int fitCrit) { private double[] refineSolution(AbstractProblemDouble prob, double[] pos, double[] vect, double initStep, double thresh, int fitCrit) {
// return AbstractProblemDouble.refineSolutionNMS(prob, pos);
// a line search along a vector // a line search along a vector
double[] tmpP = pos.clone(); double[] tmpP = pos.clone();
double[] normedVect = Mathematics.normVect(vect); double[] normedVect = Mathematics.normVect(vect);
@@ -290,36 +251,9 @@ public class F8Problem extends AbstractProblemDoubleOffset
return false; return false;
} }
} }
// else {
// if (listOfOptima.isEmpty()) return true;
// else {
// // test for correctness of the second optimum - if its gradient is nonzero, reinit optima
// AbstractEAIndividual testIndy = listOfOptima.getEAIndividual(1);
// double grad[] = this.getFirstOrderGradients(testIndy.getDoublePosition());
// for (int i=0; i<grad.length; i++) {
// if (Math.abs(grad[i])>1e-20) {
// listOfOptima.clear();
// return true;
// }
// }
// return false;
// }
// }
} }
private void addOptimum(double[] pos) { private void addOptimum(double[] pos) {
AbstractProblemDouble.addUnrotatedOptimum(m_ListOfOptima, this, pos); AbstractProblemDouble.addUnrotatedOptimum(m_ListOfOptima, this, pos);
} }
// private double[] refineSolution(double[] pos) {
// Population population = new Population();
// InterfaceDataTypeDouble tmpIndy;
// tmpIndy = (InterfaceDataTypeDouble)((AbstractEAIndividual)this.template).clone();
// tmpIndy.setDoubleGenotype(pos);
// ((AbstractEAIndividual)tmpIndy).SetFitness(evaluate(pos));
// population.add(tmpIndy);
// FitnessConvergenceTerminator convTerm = new FitnessConvergenceTerminator(1e-15, 10, false, true);
// int calls = PostProcess.processWithGDA(population, this, convTerm, 0, 0.0000000000000001, 0.01);
// return ((InterfaceDataTypeDouble)population.getBestEAIndividual()).getDoubleData();
// }
} }

View File

@@ -1,7 +1,12 @@
package eva2.optimization.problems; package eva2.optimization.problems;
import eva2.optimization.individuals.ESIndividualDoubleData; import eva2.optimization.individuals.ESIndividualDoubleData;
import eva2.util.annotation.Description;
/**
* Weighted Sphere Model
*/
@Description("Weighted Sphere Model")
public class F9Problem extends AbstractProblemDoubleOffset implements java.io.Serializable { public class F9Problem extends AbstractProblemDoubleOffset implements java.io.Serializable {
public F9Problem() { public F9Problem() {
@@ -56,9 +61,6 @@ public class F9Problem extends AbstractProblemDoubleOffset implements java.io.Se
return result; return result;
} }
/**********************************************************************************************************************
* These are for GUI
*/
/** /**
* This method allows the CommonJavaObjectEditorPanel to read the * This method allows the CommonJavaObjectEditorPanel to read the
* name to the current object. * name to the current object.
@@ -69,13 +71,4 @@ public class F9Problem extends AbstractProblemDoubleOffset implements java.io.Se
public String getName() { public String getName() {
return "F9 Problem"; return "F9 Problem";
} }
/**
* This method returns a global info string
*
* @return description
*/
public static String globalInfo() {
return "Weighted Sphere Model";
}
} }

View File

@@ -195,7 +195,7 @@ class MyLensViewer extends JPanel implements InterfaceSolutionViewer {
/** /**
* *
*/ */
@eva2.util.annotation.Description(text="Focussing of a lens is to be optimized.") @eva2.util.annotation.Description("Focusing of a lens is to be optimized.")
public class FLensProblem extends AbstractOptimizationProblem public class FLensProblem extends AbstractOptimizationProblem
implements InterfaceOptimizationProblem, InterfaceHasSolutionViewer, java.io.Serializable { implements InterfaceOptimizationProblem, InterfaceHasSolutionViewer, java.io.Serializable {

View File

@@ -6,7 +6,7 @@ import javax.swing.*;
import java.io.Serializable; import java.io.Serializable;
import java.util.List; import java.util.List;
@eva2.util.annotation.Description(text = "Select statistical values to be calculated and tests to be performed.") @eva2.util.annotation.Description(value = "Select statistical values to be calculated and tests to be performed.")
public class EvAStatisticalEvaluationParams implements Serializable { public class EvAStatisticalEvaluationParams implements Serializable {
private StringSelection singleStats = new StringSelection(StatsOnSingleDataSetEnum.mean, StatsOnSingleDataSetEnum.getInfoStrings()); private StringSelection singleStats = new StringSelection(StatsOnSingleDataSetEnum.mean, StatsOnSingleDataSetEnum.getInfoStrings());

View File

@@ -26,7 +26,7 @@ import java.util.List;
* A selectable list of EvAJobs. Each job contains a OptimizationParameters instance and potentially * A selectable list of EvAJobs. Each job contains a OptimizationParameters instance and potentially
* statistical data. * statistical data.
*/ */
@eva2.util.annotation.Description(text = "Display a set of jobs consisting of a multi-run experiment.") @eva2.util.annotation.Description(value = "Display a set of jobs consisting of a multi-run experiment.")
public class OptimizationJobList extends PropertySelectableList<OptimizationJob> implements Serializable, InterfaceTextListener { public class OptimizationJobList extends PropertySelectableList<OptimizationJob> implements Serializable, InterfaceTextListener {
List<InterfaceTextListener> listeners = null; List<InterfaceTextListener> listeners = null;

View File

@@ -29,7 +29,7 @@ import java.util.logging.Logger;
* *
* @see AbstractStatistics * @see AbstractStatistics
*/ */
@Description(text = "Configure statistics and output of the optimization run. Changes to the data selection state will not take effect during a run.") @Description(value = "Configure statistics and output of the optimization run. Changes to the data selection state will not take effect during a run.")
public class StatisticsParameter implements InterfaceStatisticsParameter, InterfaceNotifyOnInformers, Serializable { public class StatisticsParameter implements InterfaceStatisticsParameter, InterfaceNotifyOnInformers, Serializable {
private static final long serialVersionUID = -8681061379203108390L; private static final long serialVersionUID = -8681061379203108390L;
private static final Logger LOGGER = Logger.getLogger(StatisticsParameter.class.getName()); private static final Logger LOGGER = Logger.getLogger(StatisticsParameter.class.getName());
@@ -272,7 +272,7 @@ public class StatisticsParameter implements InterfaceStatisticsParameter, Interf
} }
public String outputAllFieldsAsTextTipText() { public String outputAllFieldsAsTextTipText() {
return "Output all available data fields or only the selected entries as text."; return "Output all available data fields or only the selected entries as value.";
} }
public void hideHideable() { public void hideHideable() {

View File

@@ -11,7 +11,7 @@ import eva2.util.annotation.Description;
/** /**
* *
*/ */
@Description(text = "Artificial Bee Colony Optimizer") @Description(value = "Artificial Bee Colony Optimizer")
public class ArtificialBeeColony implements InterfaceOptimizer { public class ArtificialBeeColony implements InterfaceOptimizer {
protected AbstractOptimizationProblem optimizationProblem = new F1Problem(); protected AbstractOptimizationProblem optimizationProblem = new F1Problem();

View File

@@ -37,7 +37,7 @@ import java.util.logging.Logger;
* *
* @author seitz * @author seitz
*/ */
@Description(text = "Basic implementation of the Bayesian Optimization Algorithm based on the works by Martin Pelikan and David E. Goldberg.") @Description(value = "Basic implementation of the Bayesian Optimization Algorithm based on the works by Martin Pelikan and David E. Goldberg.")
public class BOA implements InterfaceOptimizer, java.io.Serializable { public class BOA implements InterfaceOptimizer, java.io.Serializable {
private static final Logger LOGGER = Logger.getLogger(BOA.class.getName()); private static final Logger LOGGER = Logger.getLogger(BOA.class.getName());
transient private InterfacePopulationChangedEventListener m_Listener = null; transient private InterfacePopulationChangedEventListener m_Listener = null;

View File

@@ -31,7 +31,7 @@ import java.util.Vector;
* dynamically changing problems. If an individual reaches the age limit, it is * dynamically changing problems. If an individual reaches the age limit, it is
* doomed and replaced by the next challenge vector, even if its worse. * doomed and replaced by the next challenge vector, even if its worse.
*/ */
@Description(text = "Differential Evolution using a steady-state population scheme.") @Description(value = "Differential Evolution using a steady-state population scheme.")
public class DifferentialEvolution implements InterfaceOptimizer, java.io.Serializable { public class DifferentialEvolution implements InterfaceOptimizer, java.io.Serializable {
@Parameter(name = "Population", description = "Edit the properties of the population used.") @Parameter(name = "Population", description = "Edit the properties of the population used.")

View File

@@ -19,7 +19,7 @@ import eva2.util.annotation.Description;
* global to a more local search. But you have to be careful with that else the * global to a more local search. But you have to be careful with that else the
* GA might not converge. This is a implementation of Genetic Algorithms. * GA might not converge. This is a implementation of Genetic Algorithms.
*/ */
@Description(text = "This is a basic generational Genetic Algorithm.") @Description(value = "This is a basic generational Genetic Algorithm.")
public class GeneticAlgorithm implements InterfaceOptimizer, java.io.Serializable { public class GeneticAlgorithm implements InterfaceOptimizer, java.io.Serializable {
private Population population = new Population(); private Population population = new Population();

View File

@@ -75,7 +75,7 @@ import java.util.Vector;
* Yilmaz. Particle Swarms for Multimodal Optimization. In: ICANNGA (1), Seiten * Yilmaz. Particle Swarms for Multimodal Optimization. In: ICANNGA (1), Seiten
* 366<36>375, 2007 * 366<36>375, 2007
*/ */
@Description(text = "A Niching Particle Swarm Optimizer") @Description(value = "A Niching Particle Swarm Optimizer")
public class NichePSO implements InterfaceAdditionalPopulationInformer, InterfaceOptimizer, java.io.Serializable { public class NichePSO implements InterfaceAdditionalPopulationInformer, InterfaceOptimizer, java.io.Serializable {
/** /**

View File

@@ -8,5 +8,5 @@ import java.lang.annotation.RetentionPolicy;
*/ */
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
public @interface Description { public @interface Description {
String text(); String value();
} }