|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.apache.commons.math.genetics.TournamentSelection
public class TournamentSelection
Tournament selection scheme. Each of the two selected chromosomes is selected
based on n-ary tournament -- this is done by drawing arity random
chromosomes without replacement from the population, and then selecting the
fittest chromosome among them.
| Field Summary | |
|---|---|
private int |
arity
number of chromosomes included in the tournament selections |
| Constructor Summary | |
|---|---|
TournamentSelection(int arity)
Creates a new TournamentSelection instance. |
|
| Method Summary | |
|---|---|
int |
getArity()
Gets the arity (number of chromosomes drawn to the tournament). |
ChromosomePair |
select(Population population)
Select two chromosomes from the population. |
void |
setArity(int arity)
Sets the arity (number of chromosomes drawn to the tournament). |
private Chromosome |
tournament(ListPopulation population)
Helper for select(Population). |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private int arity
| Constructor Detail |
|---|
public TournamentSelection(int arity)
arity - how many chromosomes will be drawn to the tournament| Method Detail |
|---|
public ChromosomePair select(Population population)
arity random chromosomes without replacement from the
population, and then selecting the fittest chromosome among them.
select in interface SelectionPolicypopulation - the population from which the chromosomes are choosen.
private Chromosome tournament(ListPopulation population)
select(Population). Draw arity random
chromosomes without replacement from the population, and then select the
fittest chromosome among them.
population - the population from which the chromosomes are choosen.
public int getArity()
public void setArity(int arity)
arity - arity of the tournament
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||