public class ProportionalSelection extends Object implements SelectionFunction
A Selection function that determines the proportion of individuals in a new population proportionally to their fitness. The population size is not allowed to grow. Individuals are randomly selected for replication, those with greater fitness tend to replicate more often.
SelectionFunction.SelectAll, SelectionFunction.Threshold
DEFAULT
Constructor and Description |
---|
ProportionalSelection() |
Modifier and Type | Method and Description |
---|---|
Population |
select(Population pop,
GeneticAlgorithm genAlg)
Selects a
Population of Organisms for
replication based on their fitness. |
public ProportionalSelection()
public Population select(Population pop, GeneticAlgorithm genAlg) throws ChangeVetoException
SelectionFunction
Population
of Organisms
for
replication based on their fitness.select
in interface SelectionFunction
pop
- the Population
to select from.genAlg
- the parent GeneticAlgorithm
.Organism
s selectedChangeVetoException
- if the function attempts to change the population and it is
vetoed.Copyright © 2014 BioJava. All rights reserved.