ec.app.ecsuite
Class ECSuite
- java.lang.Object
-
- ec.Problem
-
- ec.app.ecsuite.ECSuite
-
- All Implemented Interfaces:
- Prototype, Setup, SimpleProblemForm, java.io.Serializable, java.lang.Cloneable
- Direct Known Subclasses:
- CoevolutionaryECSuite
public class ECSuite extends Problem implements SimpleProblemForm
Several standard Evolutionary Computation functions are implemented. As the SimpleFitness is used for maximization problems, the mapping f(x) --> -f(x) is used to transform the problems into maximization ones.Parameters
base.type
String, one of: rosenbrock rastrigin sphere step noisy-quartic kdj-f1 kdj-f2 kdj-f3 kdj-f4 booth griewank median sum product schwefel min rotated-rastrigin rotated-schwefel rotated-griewank langerman lennard-jones lunacek(The vector problem to test against. Some of the types are synonyms: kdj-f1 = sphere, kdj-f2 = rosenbrock, kdj-f3 = step, kdj-f4 = noisy-quartic. "kdj" stands for "Ken DeJong", and the numbers are the problems in his test suite) base.seed
int > 0(Random number seed for rotated problems) - See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field and Description static double[]maxRangestatic double[]minRangestatic java.lang.StringP_SEEDstatic java.lang.StringP_WHICH_PROBLEMstatic intPROB_BOOTHstatic intPROB_GRIEWANKstatic intPROB_LANGERMANstatic intPROB_LENNARDJONESstatic intPROB_LUNACEKstatic intPROB_MEDIANstatic intPROB_MINstatic intPROB_NOISY_QUARTICstatic intPROB_PRODUCTstatic intPROB_RASTRIGINstatic intPROB_ROSENBROCKstatic intPROB_ROTATED_GRIEWANKstatic intPROB_ROTATED_RASTRIGINstatic intPROB_ROTATED_SCHWEFELstatic intPROB_SCHWEFELstatic intPROB_SPHEREstatic intPROB_STEPstatic intPROB_SUMstatic java.lang.String[]problemNameintproblemTypestatic longROTATION_SEEDFixed rotation seed so all jobs use exactly the same rotation space.static double[][][]rotationMatrixlongseedstatic java.lang.StringV_BOOTHstatic java.lang.StringV_F1static java.lang.StringV_F2static java.lang.StringV_F3static java.lang.StringV_F4static java.lang.StringV_GRIEWANGKstatic java.lang.StringV_GRIEWANKstatic java.lang.StringV_LANGERMANstatic java.lang.StringV_LENNARDJONESstatic java.lang.StringV_LUNACEKstatic java.lang.StringV_MEDIANstatic java.lang.StringV_MINstatic java.lang.StringV_NOISY_QUARTICstatic java.lang.StringV_PRODUCTstatic java.lang.StringV_RASTRIGINstatic java.lang.StringV_ROSENBROCKstatic java.lang.StringV_ROTATED_GRIEWANKstatic java.lang.StringV_ROTATED_RASTRIGINstatic java.lang.StringV_ROTATED_SCHWEFELstatic java.lang.StringV_SCHWEFELstatic java.lang.StringV_SPHEREstatic java.lang.StringV_STEPstatic java.lang.StringV_SUM
-
Constructor Summary
Constructors Constructor and Description ECSuite()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description static double[][]buildRotationMatrix(EvolutionState state, long rotationSeed, int N)Build an NxN rotation matrix[row][column] with a given seed.voidcheckRange(EvolutionState state, int problem, double[] genome)static doubledot(double[] x, double[] y)Dot product between two column vectors.voidevaluate(EvolutionState state, Individual ind, int subpopulation, int threadnum)Evaluates the individual in ind, if necessary (perhaps not evaluating them if their evaluated flags are true), and sets their fitness appropriately.doublefunction(EvolutionState state, int function, double[] genome, int threadnum)booleanisOptimal(int function, double fitness)static double[]mul(double[][] matrix, double[] x)Multiply a column vector against a matrix[row][column].static double[]normalize(double[] x)Normalize a column vector.static double[]scalarMul(double scalar, double[] x)Scalar multiply against a column vector.voidsetup(EvolutionState state, Parameter base)Sets up the object by reading it from the parameters stored in state, built off of the parameter base base.static double[]sub(double[] x, double[] y)Subtract two column vectors.-
Methods inherited from class ec.Problem
canEvaluate, clone, closeContacts, defaultBase, describe, describe, finishEvaluating, initializeContacts, prepareToEvaluate, reinitializeContacts
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface ec.simple.SimpleProblemForm
describe
-
-
-
-
Field Detail
-
P_SEED
public static final java.lang.String P_SEED
- See Also:
- Constant Field Values
-
P_WHICH_PROBLEM
public static final java.lang.String P_WHICH_PROBLEM
- See Also:
- Constant Field Values
-
V_ROSENBROCK
public static final java.lang.String V_ROSENBROCK
- See Also:
- Constant Field Values
-
V_RASTRIGIN
public static final java.lang.String V_RASTRIGIN
- See Also:
- Constant Field Values
-
V_SPHERE
public static final java.lang.String V_SPHERE
- See Also:
- Constant Field Values
-
V_STEP
public static final java.lang.String V_STEP
- See Also:
- Constant Field Values
-
V_NOISY_QUARTIC
public static final java.lang.String V_NOISY_QUARTIC
- See Also:
- Constant Field Values
-
V_F1
public static final java.lang.String V_F1
- See Also:
- Constant Field Values
-
V_F2
public static final java.lang.String V_F2
- See Also:
- Constant Field Values
-
V_F3
public static final java.lang.String V_F3
- See Also:
- Constant Field Values
-
V_F4
public static final java.lang.String V_F4
- See Also:
- Constant Field Values
-
V_BOOTH
public static final java.lang.String V_BOOTH
- See Also:
- Constant Field Values
-
V_GRIEWANGK
public static final java.lang.String V_GRIEWANGK
- See Also:
- Constant Field Values
-
V_GRIEWANK
public static final java.lang.String V_GRIEWANK
- See Also:
- Constant Field Values
-
V_MEDIAN
public static final java.lang.String V_MEDIAN
- See Also:
- Constant Field Values
-
V_SUM
public static final java.lang.String V_SUM
- See Also:
- Constant Field Values
-
V_PRODUCT
public static final java.lang.String V_PRODUCT
- See Also:
- Constant Field Values
-
V_SCHWEFEL
public static final java.lang.String V_SCHWEFEL
- See Also:
- Constant Field Values
-
V_MIN
public static final java.lang.String V_MIN
- See Also:
- Constant Field Values
-
V_ROTATED_RASTRIGIN
public static final java.lang.String V_ROTATED_RASTRIGIN
- See Also:
- Constant Field Values
-
V_ROTATED_SCHWEFEL
public static final java.lang.String V_ROTATED_SCHWEFEL
- See Also:
- Constant Field Values
-
V_ROTATED_GRIEWANK
public static final java.lang.String V_ROTATED_GRIEWANK
- See Also:
- Constant Field Values
-
V_LANGERMAN
public static final java.lang.String V_LANGERMAN
- See Also:
- Constant Field Values
-
V_LENNARDJONES
public static final java.lang.String V_LENNARDJONES
- See Also:
- Constant Field Values
-
V_LUNACEK
public static final java.lang.String V_LUNACEK
- See Also:
- Constant Field Values
-
PROB_ROSENBROCK
public static final int PROB_ROSENBROCK
- See Also:
- Constant Field Values
-
PROB_RASTRIGIN
public static final int PROB_RASTRIGIN
- See Also:
- Constant Field Values
-
PROB_SPHERE
public static final int PROB_SPHERE
- See Also:
- Constant Field Values
-
PROB_STEP
public static final int PROB_STEP
- See Also:
- Constant Field Values
-
PROB_NOISY_QUARTIC
public static final int PROB_NOISY_QUARTIC
- See Also:
- Constant Field Values
-
PROB_BOOTH
public static final int PROB_BOOTH
- See Also:
- Constant Field Values
-
PROB_GRIEWANK
public static final int PROB_GRIEWANK
- See Also:
- Constant Field Values
-
PROB_MEDIAN
public static final int PROB_MEDIAN
- See Also:
- Constant Field Values
-
PROB_SUM
public static final int PROB_SUM
- See Also:
- Constant Field Values
-
PROB_PRODUCT
public static final int PROB_PRODUCT
- See Also:
- Constant Field Values
-
PROB_SCHWEFEL
public static final int PROB_SCHWEFEL
- See Also:
- Constant Field Values
-
PROB_MIN
public static final int PROB_MIN
- See Also:
- Constant Field Values
-
PROB_ROTATED_RASTRIGIN
public static final int PROB_ROTATED_RASTRIGIN
- See Also:
- Constant Field Values
-
PROB_ROTATED_SCHWEFEL
public static final int PROB_ROTATED_SCHWEFEL
- See Also:
- Constant Field Values
-
PROB_ROTATED_GRIEWANK
public static final int PROB_ROTATED_GRIEWANK
- See Also:
- Constant Field Values
-
PROB_LANGERMAN
public static final int PROB_LANGERMAN
- See Also:
- Constant Field Values
-
PROB_LENNARDJONES
public static final int PROB_LENNARDJONES
- See Also:
- Constant Field Values
-
PROB_LUNACEK
public static final int PROB_LUNACEK
- See Also:
- Constant Field Values
-
problemType
public int problemType
-
problemName
public static final java.lang.String[] problemName
-
minRange
public static final double[] minRange
-
maxRange
public static final double[] maxRange
-
seed
public long seed
-
rotationMatrix
public static double[][][] rotationMatrix
-
ROTATION_SEED
public static final long ROTATION_SEED
Fixed rotation seed so all jobs use exactly the same rotation space.- See Also:
- Constant Field Values
-
-
Method Detail
-
checkRange
public void checkRange(EvolutionState state, int problem, double[] genome)
-
setup
public void setup(EvolutionState state, Parameter base)
Description copied from interface:PrototypeSets up the object by reading it from the parameters stored in state, built off of the parameter base base. If an ancestor implements this method, be sure to call super.setup(state,base); before you do anything else.For prototypes, setup(...) is typically called once for the prototype instance; cloned instances do not receive the setup(...) call. setup(...) may be called more than once; the only guarantee is that it will get called at least once on an instance or some "parent" object from which it was ultimately cloned.
-
evaluate
public void evaluate(EvolutionState state, Individual ind, int subpopulation, int threadnum)
Description copied from interface:SimpleProblemFormEvaluates the individual in ind, if necessary (perhaps not evaluating them if their evaluated flags are true), and sets their fitness appropriately.- Specified by:
evaluatein interfaceSimpleProblemForm
-
isOptimal
public boolean isOptimal(int function, double fitness)
-
function
public double function(EvolutionState state, int function, double[] genome, int threadnum)
-
dot
public static double dot(double[] x, double[] y)Dot product between two column vectors. Does not modify the original vectors.
-
mul
public static double[] mul(double[][] matrix, double[] x)Multiply a column vector against a matrix[row][column]. Does not modify the original vector or matrix.
-
scalarMul
public static double[] scalarMul(double scalar, double[] x)Scalar multiply against a column vector. Does not modify the original vector.
-
sub
public static double[] sub(double[] x, double[] y)Subtract two column vectors. Does not modify the original vectors.
-
normalize
public static double[] normalize(double[] x)
Normalize a column vector. Does not modify the original vector.
-
buildRotationMatrix
public static double[][] buildRotationMatrix(EvolutionState state, long rotationSeed, int N)
Build an NxN rotation matrix[row][column] with a given seed.
-
-
DMelt 3.0 © DataMelt by jWork.ORG