|
JGAP | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jgap.NaturalSelector
org.jgap.impl.TournamentSelector
public class TournamentSelector
Implementation of a NaturalSelector that plays tournaments to determine the chromosomes to be taken to the next generation.
The tournament size can be adjusted as well as the probability for selecting an individual.
| Constructor Summary | |
|---|---|
TournamentSelector()
Default constructor. |
|
TournamentSelector(Configuration a_config,
int a_tournament_size,
double a_probability)
|
|
| Method Summary | |
|---|---|
protected void |
add(IChromosome a_chromosomeToAdd)
Add a Chromosome instance to this selector's working pool of Chromosomes. |
void |
empty()
Empty out the working pool of Chromosomes. |
double |
getProbability()
|
int |
getTournamentSize()
|
boolean |
returnsUniqueChromosomes()
|
void |
select(int a_howManyToSelect,
Population a_from_pop,
Population a_to_pop)
Select a given number of Chromosomes from the pool that will move on to the next generation population. |
void |
setProbability(double a_probability)
|
void |
setTournamentSize(int a_tournament_size)
|
| Methods inherited from class org.jgap.NaturalSelector |
|---|
getConfiguration |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TournamentSelector()
Attention: The configuration used is the one set with the static method Genotype.setConfiguration.
public TournamentSelector(Configuration a_config,
int a_tournament_size,
double a_probability)
a_config - the configuration to usea_tournament_size - the size of each tournament to playa_probability - probability for selecting the best individuals| Method Detail |
|---|
public void setTournamentSize(int a_tournament_size)
public int getTournamentSize()
public double getProbability()
public void setProbability(double a_probability)
public void select(int a_howManyToSelect,
Population a_from_pop,
Population a_to_pop)
a_howManyToSelect - inta_from_pop - the population the Chromosomes will be selected froma_to_pop - the population the Chromosomes will be added topublic boolean returnsUniqueChromosomes()
public void empty()
INaturalSelector
protected void add(IChromosome a_chromosomeToAdd)
NaturalSelector
add in class NaturalSelectora_chromosomeToAdd - the Chromosome to add
|
JGAP | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||