public final class TruncationSelector<G extends Gene<?,G>,C extends Comparable<? super C>> extends Object implements Selector<G,C>
| Constructor and Description |
|---|
TruncationSelector()
Create a new TruncationSelector object.
|
public TruncationSelector()
public Population<G,C> select(Population<G,C> population, int count, Optimize opt)
Population.sort() is called
by this method.)select in interface Selector<G extends Gene<?,G>,C extends Comparable<? super C>>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.IllegalArgumentException - if the sample size is greater than the
population size or count is greater the the population
size.NullPointerException - if the population is null.© 2007-2013 Franz Wilhelmstötter (2013-12-18 20:17)