Class SelectiveRefinementTournamentSelector<T extends Comparable<T>>
java.lang.Object
net.bmahe.genetics4j.core.selection.SelectiveRefinementTournamentSelector<T>
- All Implemented Interfaces:
Selector<T>
public class SelectiveRefinementTournamentSelector<T extends Comparable<T>>
extends Object
implements Selector<T>
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final org.apache.logging.log4j.Logger
private final RandomGenerator
private final SelectiveRefinementTournament
<T> -
Constructor Summary
ConstructorsConstructorDescriptionSelectiveRefinementTournamentSelector
(SelectiveRefinementTournament<T> _selectiveRefinementTournament, RandomGenerator _randomGenerator) -
Method Summary
Modifier and TypeMethodDescriptionprotected Individual
<T> randomIndividual
(List<Genotype> population, List<T> fitnessScore) select
(AbstractEAConfiguration<T> eaConfiguration, long generation, int numIndividuals, List<Genotype> population, List<T> fitnessScore) Selects a specified number of individuals from the given population based on their fitness values.protected Individual
<T> selectForFitness
(AbstractEAConfiguration<T> eaConfiguration, Comparator<Individual<T>> fitnessComparator, int numCandidates, List<Genotype> population, List<T> fitnessScore) protected Individual
<T> selectForRefinement
(Comparator<Individual<T>> refinementComparator, Individual<T> candidateA, Individual<T> candidateB)
-
Field Details
-
logger
public static final org.apache.logging.log4j.Logger logger -
selectiveRefinementTournament
-
randomGenerator
-
-
Constructor Details
-
SelectiveRefinementTournamentSelector
public SelectiveRefinementTournamentSelector(SelectiveRefinementTournament<T> _selectiveRefinementTournament, RandomGenerator _randomGenerator)
-
-
Method Details
-
randomIndividual
-
selectForFitness
protected Individual<T> selectForFitness(AbstractEAConfiguration<T> eaConfiguration, Comparator<Individual<T>> fitnessComparator, int numCandidates, List<Genotype> population, List<T> fitnessScore) -
selectForRefinement
protected Individual<T> selectForRefinement(Comparator<Individual<T>> refinementComparator, Individual<T> candidateA, Individual<T> candidateB) -
select
public Population<T> select(AbstractEAConfiguration<T> eaConfiguration, long generation, 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 parametersgeneration
- the current generationnumIndividuals
- 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
-