public interface Selector<G extends Gene<?,G>,C extends Comparable<? super C>>
final GeneticAlgorithm<DoubleGene, Double> ga = ...
ga.setOffspringFraction(0.7);
ga.setSurvivorSelector(
new RouletteWheelSelector<DoubleGene, Double>()
);
ga.setOffspringSelector(
new TournamentSelector<DoubleGene, Double>()
);
Modifier and Type | Method and Description |
---|---|
Population<G,C> |
select(Population<G,C> population,
int count,
Optimize opt)
Select phenotypes from the Population.
|
Population<G,C> select(Population<G,C> population, int count, Optimize opt)
population
- The population to select from.count
- The number of phenotypes to select.opt
- Determines whether the individuals with higher fitness values
or lower fitness values must be selected. This parameter determines
whether the GA maximizes or minimizes the fitness function.NullPointerException
- if the arguments is null
.IllegalArgumentException
- if the select count is smaller than zero.© 2007-2014 Franz Wilhelmstötter (2014-03-07 19:35)