|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jgap.NaturalSelector
org.jgap.impl.WeightedRouletteSelector
A basic implementation of NaturalSelector that models a roulette wheel. When a Chromosome is added, it gets a number of "slots" on the wheel equal to its fitness value. When the select method is invoked, the wheel is "spun" and the Chromosome occupying the spot on which it lands is selected. Then the wheel is spun again and again until the requested number of Chromosomes have been selected. Since Chromosomes with higher fitness values get more slots on the wheel, there's a higher statistical probability that they'll be chosen, but it's not guaranteed.
| Constructor Summary | |
WeightedRouletteSelector()
|
|
| Method Summary | |
void |
empty()
Empty out the working pool of Chromosomes. |
boolean |
getDoubletteChromosomesAllowed()
|
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 |
setDoubletteChromosomesAllowed(boolean a_doublettesAllowed)
Determines whether doublette chromosomes may be added to the selector or will be ignored. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public WeightedRouletteSelector()
| Method Detail |
public void select(int a_howManyToSelect,
Population a_from_pop,
Population a_to_pop)
a_howManyToSelect - The number of Chromosomes to select.a_from_pop - the population the Chromosomes will be selected from.a_to_pop - the population the Chromosomes will be added to.public void empty()
public boolean returnsUniqueChromosomes()
public void setDoubletteChromosomesAllowed(boolean a_doublettesAllowed)
a_doublettesAllowed - true: doublette chromosomes allowed to be
added to the selector. FALSE: doublettes will be ignored and not
addedpublic boolean getDoubletteChromosomesAllowed()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||