public class RouletteWheelSelection extends java.lang.Object implements SelectionStrategy<HigherOrderMutant>
Implements selection of n candidates from a population by selecting n candidates at random where the probability of each candidate getting selected is proportional to its fitness score. This is analogous to each candidate being assigned an area on a roulette wheel proportionate to its fitness and the wheel being spun i times. Candidates may be selected more than once.
In some instances, particularly with small population sizes, the randomness of selection may result in excessively high occurrences of particular candidates.
| Constructor and Description |
|---|
RouletteWheelSelection() |
| Modifier and Type | Method and Description |
|---|---|
java.util.List<HigherOrderMutant> |
select(Population<HigherOrderMutant> population,
int selectionSize)
Select the specified number of candidates from the population.
|
public java.util.List<HigherOrderMutant> select(Population<HigherOrderMutant> population, int selectionSize)
SelectionStrategySelect the specified number of candidates from the population. Implementations may assume that the population is sorted in descending order according to fitness (so the fittest individual is the first item in the list).
It is an error to call this method with an empty or null population.
select in interface SelectionStrategy<HigherOrderMutant>population - The Population from which to select.selectionSize - The number of individual selections to make.