|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jgap.NaturalSelector
public abstract class NaturalSelector
Natural selectors are responsible for actually selecting a specified number of Chromosome specimens from a population, using the fitness values as a guide. Usually fitness is treated as a statistic probability of survival, not as the sole determining factor. Therefore, Chromosomes with higher fitness values are more likely to survive than those with lesser fitness values, but it's not guaranteed.
Constructor Summary | |
---|---|
NaturalSelector()
|
Method Summary | |
---|---|
protected abstract void |
add(Configuration config,
Chromosome c)
|
void |
add(Configuration config,
java.util.List chroms)
If elitism is enabled, places appropriate chromosomes in elite list. |
void |
empty()
clear pool of candidate chromosomes |
protected abstract void |
emptyImpl()
|
int |
getElitismMinSpecieSize()
|
float |
getSurvivalRate()
|
java.util.List |
select(Configuration config)
Select a given number of Chromosomes from the pool that will move on to the next generation population. |
protected abstract java.util.List |
select(Configuration config,
int numToSurvive)
|
void |
setElitism(boolean b)
|
void |
setElitismMinSpecieSize(int i)
|
void |
setSurvivalRate(float aSurvivalRate)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public NaturalSelector()
Method Detail |
---|
public final void add(Configuration config, java.util.List chroms)
elite
list. Elitism follows
methodolofy in NEAT. Passes
everything else to subclass add( Configuration config, Chromosome c )
method.
config
- chroms
- List
contains Chromosome objectsprotected abstract void add(Configuration config, Chromosome c)
config
- c
- chromosome to add to selection poolpublic java.util.List select(Configuration config)
select( Configuration config, int numToSurvive )
method.
config
-
protected abstract java.util.List select(Configuration config, int numToSurvive)
config
- numToSurvive
-
List
contains Chromosome
objects, those that have survived; size
of this list should be numToSurvive
, unless fewer than that number of chromosomes have
been added to selectorpublic void empty()
emptyImpl()
protected abstract void emptyImpl()
empty()
public float getSurvivalRate()
public void setSurvivalRate(float aSurvivalRate)
aSurvivalRate
- public int getElitismMinSpecieSize()
public void setElitismMinSpecieSize(int i)
i
- minimum size a specie must be to support an elite chromosomepublic void setElitism(boolean b)
b
- true if elitisim is to be enabled
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |