public interface GroupedProblemForm
GroupedProblemForm is an interface which defines methods for Problems to implement simple coevolutionary evaluation. In particular, the evaluate method receives as parameters a set of individuals that need to be evaluated. An additional vector-parameter (updateFitness) marks which individual fitnesses need to be updated during the evaluation process.
Modifier and Type | Method and Description |
---|---|
void |
evaluate(EvolutionState state,
Individual[] ind,
boolean[] updateFitness,
boolean countVictoriesOnly,
int[] subpops,
int threadnum)
Evaluates the individuals found in ind together.
|
int |
postprocessPopulation(EvolutionState state,
Population pop,
boolean[] assessFitness,
boolean countVictoriesOnly)
Finish processing the population (such as fitness information) after evaluation.
|
void |
preprocessPopulation(EvolutionState state,
Population pop,
boolean[] prepareForFitnessAssessment,
boolean countVictoriesOnly)
Set up the population pop (such as fitness information) prior to evaluation.
|
void preprocessPopulation(EvolutionState state, Population pop, boolean[] prepareForFitnessAssessment, boolean countVictoriesOnly)
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.
int postprocessPopulation(EvolutionState state, Population pop, boolean[] assessFitness, boolean countVictoriesOnly)
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(...).
Should return the number of individuals evaluated (not tested: but actually had their fitnesses modified -- or would have if the evaluated flag wasn't set).
void evaluate(EvolutionState state, Individual[] ind, boolean[] updateFitness, boolean countVictoriesOnly, int[] subpops, int threadnum)
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.