Class MultiTournamentsSelectionPolicyHandler<T extends Comparable<T>>
java.lang.Object
net.bmahe.genetics4j.core.selection.MultiTournamentsSelectionPolicyHandler<T>
- All Implemented Interfaces:
SelectionPolicyHandler<T>
public class MultiTournamentsSelectionPolicyHandler<T extends Comparable<T>>
extends Object
implements SelectionPolicyHandler<T>
-
Field Summary
Modifier and TypeFieldDescriptionstatic final org.apache.logging.log4j.Logger
private final RandomGenerator
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
canHandle
(SelectionPolicy selectionPolicy) private List
<Individual<T>> pickRandomCandidates
(RandomGenerator randomGenerator, List<Genotype> population, List<T> fitnessScore, int numCandidates) resolve
(AbstractEAExecutionContext<T> eaExecutionContext, AbstractEAConfiguration<T> eaConfiguration, SelectionPolicyHandlerResolver<T> selectionPolicyHandlerResolver, SelectionPolicy selectionPolicy) private Individual
<T> runTournament
(RandomGenerator randomGenerator, List<Tournament<T>> tournaments, List<Genotype> population, List<T> fitnessScore, int tournamentIndex) private Individual
<T> runTournament
(Tournament<T> tournament, List<Genotype> population, List<T> fitnessScore, List<Individual<T>> candidates)
-
Field Details
-
logger
public static final org.apache.logging.log4j.Logger logger -
randomGenerator
-
-
Constructor Details
-
MultiTournamentsSelectionPolicyHandler
-
-
Method Details
-
pickRandomCandidates
private List<Individual<T>> pickRandomCandidates(RandomGenerator randomGenerator, List<Genotype> population, List<T> fitnessScore, int numCandidates) -
runTournament
private Individual<T> runTournament(Tournament<T> tournament, List<Genotype> population, List<T> fitnessScore, List<Individual<T>> candidates) -
runTournament
private Individual<T> runTournament(RandomGenerator randomGenerator, List<Tournament<T>> tournaments, List<Genotype> population, List<T> fitnessScore, int tournamentIndex) -
canHandle
- Specified by:
canHandle
in interfaceSelectionPolicyHandler<T extends Comparable<T>>
-
resolve
public Selector<T> resolve(AbstractEAExecutionContext<T> eaExecutionContext, AbstractEAConfiguration<T> eaConfiguration, SelectionPolicyHandlerResolver<T> selectionPolicyHandlerResolver, SelectionPolicy selectionPolicy) - Specified by:
resolve
in interfaceSelectionPolicyHandler<T extends Comparable<T>>
-