Package edu.cnu.mdi.sim.ga.triimage
Class TournamentSelection<C extends GASolution<C>>
java.lang.Object
edu.cnu.mdi.sim.ga.triimage.TournamentSelection<C>
- All Implemented Interfaces:
SelectionOperator<C>
public final class TournamentSelection<C extends GASolution<C>>
extends Object
implements SelectionOperator<C>
Tournament selection operator for genetic algorithms. This operator selects parents by running a
"tournament" among a random subset of the population.
The tournament size is a parameter that controls the selection pressure: larger tournaments
favor fitter individuals more strongly.
-
Constructor Summary
ConstructorsConstructorDescriptionTournamentSelection(int tournamentSize) Create a tournament selection operator with the given tournament size. -
Method Summary
-
Constructor Details
-
TournamentSelection
public TournamentSelection(int tournamentSize) Create a tournament selection operator with the given tournament size.- Parameters:
tournamentSize- the number of individuals to compete in each tournament
-
-
Method Details
-
select
Description copied from interface:SelectionOperatorSelect one parent from an aligned population and fitness array.- Specified by:
selectin interfaceSelectionOperator<C extends GASolution<C>>- Parameters:
population- candidate individualsfitnesses- fitness at each corresponding population indexrng- source of randomness- Returns:
- selected individual
-