|
Evolvica Core API Version 0.6.2 Last Modified: June 29 2004 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.evolvica.core.population.AbstractInsertionFilter
Abstract base class for an insertion filter.
Make sure to read the descriptions of generation gap and insertion rate.
These two values define whether a population grows or shrinks. Example:
population size: 100
insertion pool size: 20
generation gap: 0.1
insertion rate: 0.5
generation gap size = 100 * 0.1 = 10; 10 individuals will be removed from the population
insertion rate size = 20 * 0.5 = 10; 10 individuals from the insertion pool will be inserted into
the population.
Therefore the new population size is 100 - 10 + 10 = 100 (and stays the same).
Field Summary | |
protected float |
generationGap
Generation Gap. |
protected float |
insertionRate
Insertion Rate. |
Constructor Summary | |
AbstractInsertionFilter()
|
Method Summary | |
int |
generationGapSize(IPopulation population)
Gets the number of individuals to be replaced. |
float |
getGenerationGap()
Gets the value of the generation gap. |
float |
getInsertionRate()
Gets the value of the reinsertion rate. |
abstract void |
insert(IPopulation population,
IIndividualSet pool)
Inserts individuals into the given population. |
int |
insertionRateSize(IIndividualSet pool)
Gets the number of indivdiuals to be inserted. |
void |
setGenerationGap(float gap)
Sets the generation gap. |
void |
setInsertionRate(float rate)
Sets the insertion rate. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected float generationGap
protected float insertionRate
Constructor Detail |
public AbstractInsertionFilter()
Method Detail |
public float getGenerationGap()
public float getInsertionRate()
public void setGenerationGap(float gap) throws java.beans.PropertyVetoException
gap
- new value of generation gap
java.beans.PropertyVetoException
- thrown in case the property cannot be setpublic void setInsertionRate(float rate) throws java.beans.PropertyVetoException
rate
- new value of insertion rate
java.beans.PropertyVetoException
- thrown in case the property cannot be setpublic int generationGapSize(IPopulation population)
population
- the population used to calculate the generation gap
public int insertionRateSize(IIndividualSet pool)
pool
- the insertion pool used to calculate the insertion rate size
public abstract void insert(IPopulation population, IIndividualSet pool)
IInsertionFilter
insert
in interface IInsertionFilter
population
- population to insert individuals intopool
- set containing individuals to be added to the given populationIInsertionFilter.insert(org.evolvica.core.population.IPopulation, org.evolvica.core.IIndividualSet)
|
Evolvica Core API Version 0.6.2 Last Modified: June 29 2004 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |