Class CoevolutionaryECSuite
- java.lang.Object
-
- ec.Problem
-
- ec.app.ecsuite.ECSuite
-
- ec.app.coevolve2.CoevolutionaryECSuite
-
- All Implemented Interfaces:
- GroupedProblemForm, Prototype, Setup, SimpleProblemForm, java.io.Serializable, java.lang.Cloneable
public class CoevolutionaryECSuite extends ECSuite implements GroupedProblemForm
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field and Description static java.lang.StringP_SHOULD_SET_CONTEXT-
Fields inherited from class ec.app.ecsuite.ECSuite
maxRange, minRange, P_SEED, P_WHICH_PROBLEM, PROB_BOOTH, PROB_GRIEWANK, PROB_LANGERMAN, PROB_LENNARDJONES, PROB_LUNACEK, PROB_MEDIAN, PROB_MIN, PROB_NOISY_QUARTIC, PROB_PRODUCT, PROB_RASTRIGIN, PROB_ROSENBROCK, PROB_ROTATED_GRIEWANK, PROB_ROTATED_RASTRIGIN, PROB_ROTATED_SCHWEFEL, PROB_SCHWEFEL, PROB_SPHERE, PROB_STEP, PROB_SUM, problemName, problemType, ROTATION_SEED, rotationMatrix, seed, V_BOOTH, V_F1, V_F2, V_F3, V_F4, V_GRIEWANGK, V_GRIEWANK, V_LANGERMAN, V_LENNARDJONES, V_LUNACEK, V_MEDIAN, V_MIN, V_NOISY_QUARTIC, V_PRODUCT, V_RASTRIGIN, V_ROSENBROCK, V_ROTATED_GRIEWANK, V_ROTATED_RASTRIGIN, V_ROTATED_SCHWEFEL, V_SCHWEFEL, V_SPHERE, V_STEP, V_SUM
-
-
Constructor Summary
Constructors Constructor and Description CoevolutionaryECSuite()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidevaluate(EvolutionState state, Individual[] ind, boolean[] updateFitness, boolean countVictoriesOnly, int[] subpops, int threadnum)Evaluates the individuals found in ind together.voidpostprocessPopulation(EvolutionState state, Population pop, boolean[] assessFitness, boolean countVictoriesOnly)Finish processing the population (such as fitness information) after evaluation.voidpreprocessPopulation(EvolutionState state, Population pop, boolean[] prepareForAssessment, boolean countVictoriesOnly)Set up the population pop (such as fitness information) prior to evaluation.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.-
Methods inherited from class ec.app.ecsuite.ECSuite
buildRotationMatrix, checkRange, dot, evaluate, function, isOptimal, mul, normalize, scalarMul, sub
-
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_SHOULD_SET_CONTEXT
public static final java.lang.String P_SHOULD_SET_CONTEXT
- See Also:
- Constant Field Values
-
-
Method Detail
-
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.
-
preprocessPopulation
public void preprocessPopulation(EvolutionState state, Population pop, boolean[] prepareForAssessment, boolean countVictoriesOnly)
Description copied from interface:GroupedProblemFormSet up the population pop (such as fitness information) prior to evaluation. Although this method is not static, you should not use it to write to any instance variables in the GroupedProblem instance; this is because it's possible that the instance used is in fact the prototype, and you will have no guarantees that your instance variables will remain valid during the evaluate(...) process. Do not assume that pop will be the same as state.pop -- it may not. state is only provided to give you access to EvolutionState features. Typically you'd use this method to set the Fitness values of all Individuals to 0.countVictoriesOnly will be set if Individuals' fitness is to be based on whether they're the winner of a test, instead of based on the specifics of the scores in the tests. This really only happens for Single-Elimination Tournament one-population competitive coevolution.
prepareForFitnessAssessment will indicate which subpopulations will have their fitness values updated this time around, during postprocessPopulation. It may not be the same as updateFitness[] in evaluate(...).
If you are basing fitness on trials, this method should create the initial trials if the prepareForFitnessAssessment[...] is true for that subpopulation.
- Specified by:
preprocessPopulationin interfaceGroupedProblemForm
-
postprocessPopulation
public void postprocessPopulation(EvolutionState state, Population pop, boolean[] assessFitness, boolean countVictoriesOnly)
Description copied from interface:GroupedProblemFormFinish processing the population (such as fitness information) after evaluation. Although this method is not static, you should not use it to write to any instance variables in the GroupedProblem instance; this is because it's possible that the instance used is in fact the prototype, and you will have no guarantees that your instance variables will remain valid during the evaluate(...) process. Do not assume that pop will be the same as state.pop -- it may not. state is only provided to give you access to EvolutionState features.countVictoriesOnly will be set if Individuals' fitness is to be based on whether they're the winner of a test, instead of based on the specifics of the scores in the tests. This really only happens for Single-Elimination Tournament one-population competitive coevolution. If this is set, probably would leave the Fitnesses as they are here (they've been set and incremented in evaluate(...)), but if it's not set, you may want to set the Fitnesses to the maximum or average or the various trials performed.
assessFitness will indicate which subpopulations should have their final fitness values assessed. You should not clear the trials of individuals for which assessFitness[] is false. Instead allow trials to accumulate and ultimately update the fitnesses later when the flag is set. assessFitness[] may not be the same as updateFitness[] in evaluate(...).
- Specified by:
postprocessPopulationin interfaceGroupedProblemForm
-
evaluate
public void evaluate(EvolutionState state, Individual[] ind, boolean[] updateFitness, boolean countVictoriesOnly, int[] subpops, int threadnum)
Description copied from interface:GroupedProblemFormEvaluates the individuals found in ind together. If updateFitness[i] is true, then you should use this evaluation to update the fitness of the individual in ind[i]. Individuals which are updated should have their fitnesses modified so that immediately after evaluation (and prior to postprocessPopulation(...) being called) individuals' fitnesses can be checked to see which is better than which. Do not assume that the individuals in ind will actually be in state.pop (they may not -- this method may be called at the end of a run to determine the best individual of the run in some kind of contest).countVictoriesOnly will be set if Individuals' fitness is to be based on whether they're the winner of a test, instead of based on the specifics of the scores in the tests. This really only happens for Single-Elimination Tournament one-population competitive coevolution. If this is set, you should increment the Fitness of the winner each time. If it's not set, you should update Fitness as you see fit, then set the final Fitness in preprocessPopulation.
- Specified by:
evaluatein interfaceGroupedProblemForm
-
-
DMelt 3.0 © DataMelt by jWork.ORG