Class TournamentSelector<T extends Comparable<T>>
java.lang.Object
net.bmahe.genetics4j.core.selection.TournamentSelector<T>
- All Implemented Interfaces:
Selector<T>
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final org.apache.logging.log4j.Logger
private final RandomGenerator
private final SelectionPolicy
-
Constructor Summary
ConstructorsConstructorDescriptionTournamentSelector
(SelectionPolicy _selectionPolicy, RandomGenerator _randomGenerator) -
Method Summary
-
Field Details
-
logger
public static final org.apache.logging.log4j.Logger logger -
selectionPolicy
-
randomGenerator
-
-
Constructor Details
-
TournamentSelector
-
-
Method Details
-
select
public Population<T> select(AbstractEAConfiguration<T> eaConfiguration, int numIndividuals, List<Genotype> population, List<T> fitnessScore) Description copied from interface:Selector
Selects a specified number of individuals from the given population based on their fitness values.This method implements the core selection logic, choosing individuals according to the specific selection strategy. The selection process typically involves evaluating fitness values and applying probabilistic or deterministic rules to choose parents for reproduction.
The selection process should:
- Consider fitness values when making selection decisions
- Return exactly the requested number of individuals
- Allow for the possibility of selecting the same individual multiple times
- Maintain the integrity of the original population
- Specified by:
select
in interfaceSelector<T extends Comparable<T>>
- Parameters:
eaConfiguration
- the evolutionary algorithm configuration containing selection parametersnumIndividuals
- the number of individuals to select from the populationpopulation
- the list of genotypes in the current populationfitnessScore
- the list of fitness values corresponding to each genotype- Returns:
- a new population containing the selected individuals
-