public class LexicographicTournamentSelection extends TournamentSelection
Tournament selection works like this: first, size individuals are chosen at random from the population. Then of those individuals, the one with the best fitness is selected. If two individuals have the same fitness, the one with smaller size is prefered. The default tournament size is 7.
Typical Number of Individuals Produced Per produce(...) call
Always 1.
Parameters
base.size int >= 1 |
(the tournament size) |
base.pick-worst bool = true or false (default) |
(should we pick the worst individual in the tournament instead of the best?) |
Default Base
select.lexicographic-tournament
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
P_TOURNAMENT
default base
|
P_PICKWORST, P_SIZE, pickWorst, probabilityOfPickingSizePlusOne
INDS_PRODUCED
NO_PROBABILITY, P_PROB, probability
Constructor and Description |
---|
LexicographicTournamentSelection() |
Modifier and Type | Method and Description |
---|---|
boolean |
betterThan(Individual first,
Individual second,
int subpopulation,
EvolutionState state,
int thread)
Returns true if *first* is a better (fitter, whatever) individual than *second*.
|
Parameter |
defaultBase()
Returns the default base for this prototype.
|
getRandomIndividual, getTournamentSizeToUse, individualReplaced, produce, setup, sourcesAreProperForm
finishProducing, prepareToProduce, produce, produces, typicalIndsProduced
clone, getProbability, pickRandom, preparePipeline, setProbability, setupProbabilities
public static final java.lang.String P_TOURNAMENT
public Parameter defaultBase()
Prototype
defaultBase
in interface Prototype
defaultBase
in class TournamentSelection
public boolean betterThan(Individual first, Individual second, int subpopulation, EvolutionState state, int thread)
TournamentSelection
betterThan
in class TournamentSelection