Evolvica Core API Version 0.6.2
Last Modified: June 29 2004

org.evolvica.core.population
Class AbstractInsertionFilter

java.lang.Object
  extended byorg.evolvica.core.population.AbstractInsertionFilter
All Implemented Interfaces:
IInsertionFilter
Direct Known Subclasses:
DefaultInsertionFilter, DiscreteInsertion, EliteInsertion, PureInsertion, UniformInsertion

public abstract class AbstractInsertionFilter
extends java.lang.Object
implements IInsertionFilter

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).

Since:
0.4.0
Version:
$Revision: 1.10 $ $Date: 2004/05/26 11:58:11 $
Author:
Andreas Rummler

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

generationGap

protected float generationGap
Generation Gap. The generation gap is defined as the quotient of the number of individuals in a population that are to be replaced and the size of the population. The default value is 1.0, this will replace all individuals.


insertionRate

protected float insertionRate
Insertion Rate. The reinsertion rate is defined as the quotient of the number of individuals that will be inserted and the size of the insertion pool. The default value is 1.0.

Constructor Detail

AbstractInsertionFilter

public AbstractInsertionFilter()
Method Detail

getGenerationGap

public float getGenerationGap()
Gets the value of the generation gap.

Returns:
generation gap

getInsertionRate

public float getInsertionRate()
Gets the value of the reinsertion rate.

Returns:
reinsertion rate

setGenerationGap

public void setGenerationGap(float gap)
                      throws java.beans.PropertyVetoException
Sets the generation gap. The given value must be between 0.0 and 1.0.

Parameters:
gap - new value of generation gap
Throws:
java.beans.PropertyVetoException - thrown in case the property cannot be set

setInsertionRate

public void setInsertionRate(float rate)
                      throws java.beans.PropertyVetoException
Sets the insertion rate. The given value must be between 0.0 and 1.0.

Parameters:
rate - new value of insertion rate
Throws:
java.beans.PropertyVetoException - thrown in case the property cannot be set

generationGapSize

public int generationGapSize(IPopulation population)
Gets the number of individuals to be replaced. This value depends on generation gap and population size and indicates how many individuals will be replaced.

Parameters:
population - the population used to calculate the generation gap
Returns:
number of individuals to be replaced

insertionRateSize

public int insertionRateSize(IIndividualSet pool)
Gets the number of indivdiuals to be inserted. This value depends on reinsertion rate and insertion pool size and indicates how many individuals will be inserted into the population. If the pool is null this method returns 0.

Parameters:
pool - the insertion pool used to calculate the insertion rate size
Returns:
number of individuals to be inserted

insert

public abstract void insert(IPopulation population,
                            IIndividualSet pool)
Description copied from interface: IInsertionFilter
Inserts individuals into the given population.

Specified by:
insert in interface IInsertionFilter
Parameters:
population - population to insert individuals into
pool - set containing individuals to be added to the given population
See Also:
IInsertionFilter.insert(org.evolvica.core.population.IPopulation, org.evolvica.core.IIndividualSet)

Evolvica Core API Version 0.6.2
Last Modified: June 29 2004

Copyright © 2000-2004 Technical University of Ilmenau, Department Electronic Circuits and Systems