public class TournamentSelector<G extends Gene<?,G>,C extends Comparable<? super C>> extends Object implements Selector<G,C>
Constructor and Description |
---|
TournamentSelector()
Create a tournament selector with sample size two.
|
TournamentSelector(int sampleSize)
Create a tournament selector with the give sample size.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
int |
hashCode() |
Population<G,C> |
select(Population<G,C> population,
int count,
Optimize opt)
Select phenotypes from the Population.
|
String |
toString() |
static <SG extends Gene<?,SG>,SC extends Comparable<SC>> |
valueOf()
Deprecated.
Will be removed.
|
static <SG extends Gene<?,SG>,SC extends Comparable<SC>> |
valueOf(int sampleSize)
Deprecated.
Will be removed.
|
public TournamentSelector(int sampleSize)
IllegalArgumentException
- if the sample size is smaller than two.public TournamentSelector()
public Population<G,C> select(Population<G,C> population, int count, Optimize opt)
Selector
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 or the _sampleSize is greater the the population size.NullPointerException
- if the population
is null
.@Deprecated public static <SG extends Gene<?,SG>,SC extends Comparable<SC>> TournamentSelector<SG,SC> valueOf(int sampleSize)
@Deprecated public static <SG extends Gene<?,SG>,SC extends Comparable<SC>> TournamentSelector<SG,SC> valueOf()
© 2007-2014 Franz Wilhelmstötter (2014-03-07 19:35)