|
JGAP | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jgap.NaturalSelector
org.jgap.NaturalSelectorExt
org.jgap.impl.BestChromosomesSelector
public class BestChromosomesSelector
Implementation of a NaturalSelector that takes the top n chromosomes into the next generation. n can be specified. Which chromosomes are the best is decided by evaluating their fitness value.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.jgap.NaturalSelector |
---|
NaturalSelector.AgeFitnessValueComparator, NaturalSelector.FitnessAgeValueComparator, NaturalSelector.FitnessValueComparator |
Field Summary |
---|
Fields inherited from class org.jgap.NaturalSelector |
---|
m_monitor, m_monitorActive |
Constructor Summary | |
---|---|
BestChromosomesSelector()
Default constructor. |
|
BestChromosomesSelector(Configuration a_config)
Using original rate of 1.0 |
|
BestChromosomesSelector(Configuration a_config,
double a_originalRate)
|
Method Summary | |
---|---|
protected void |
add(IChromosome a_chromosomeToAdd)
Add a Chromosome instance to this selector's working pool of Chromosomes. |
java.lang.Object |
clone()
|
void |
empty()
Empties out the working pool of Chromosomes. |
boolean |
equals(java.lang.Object a_o)
|
double |
getOriginalRate()
|
boolean |
returnsUniqueChromosomes()
|
void |
selectChromosomes(int a_howManyToSelect,
Population a_to_pop)
Selects a given number of chromosomes from the pool that will move on to the next generation population. |
void |
setOriginalRate(double a_originalRate)
Setting this parameter controls how many chromosomes of the original population will be considered for selection to the next population. |
Methods inherited from class org.jgap.NaturalSelectorExt |
---|
getDoubletteChromosomesAllowed, init, select, selectChromosome, setDoubletteChromosomesAllowed |
Methods inherited from class org.jgap.NaturalSelector |
---|
getConfiguration |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BestChromosomesSelector() throws InvalidConfigurationException
InvalidConfigurationException
public BestChromosomesSelector(Configuration a_config) throws InvalidConfigurationException
a_config
- the configuration to use
InvalidConfigurationException
public BestChromosomesSelector(Configuration a_config, double a_originalRate) throws InvalidConfigurationException
InvalidConfigurationException
Method Detail |
---|
protected void add(IChromosome a_chromosomeToAdd)
add
in class NaturalSelectorExt
a_chromosomeToAdd
- the specimen to add to the poolpublic void selectChromosomes(int a_howManyToSelect, Population a_to_pop)
selectChromosomes
in class NaturalSelectorExt
a_to_pop
- the population the chromosomes will be added toa_howManyToSelect
- the number of chromosomes to selectpublic void empty()
empty
in interface INaturalSelector
public boolean returnsUniqueChromosomes()
returnsUniqueChromosomes
in interface INaturalSelector
public void setOriginalRate(double a_originalRate)
a_originalRate
- the rate of how many of the original chromosomes
will be selected according to BestChromosomeSelector's strategy. The rest
(non-original) of the chromosomes is added as duplicatespublic double getOriginalRate()
public boolean equals(java.lang.Object a_o)
equals
in class NaturalSelectorExt
a_o
- the object to compare
public java.lang.Object clone()
clone
in interface ICloneable
clone
in class java.lang.Object
|
JGAP | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |