Insertion Filters

This section describes the insertion of individuals into populations via filters.

Filtering Individuals

An important aspect of populations in contrast to normal sets of individuals is that the insertion of individuals can be controlled in a particular. Thinking about this reveals that reinsertion cannot be seen as a stand-alone operator. A reinsertion operator is always bound to a population. That's why in Evolvica reinsertion operators are used as filters in populations. A filter controls which individuals will be inserted, which will be discarded and which will be removed from the population.
. Such a filter is specified by the interface org.evolvica.core.population.IInsertionFilter. Insertion filters must implement one single method: insert( IPopulation pop, IIndividualSet iset ). In this method the insertion is performed, the filter may add and/or remove individuals to/from the population. An abstract base class is org.evolvica.core.population.AbstractInsertionFilter. This class defines two important values that control the insertion process: the generation gap and the insertion rate.
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. A value of 1.0 will replace all individuals, while a value of 0.5 will only replace the half of the individuals.
The reinsertion rate is defined as the quotient of the number of individuals that will be inserted and the size of the insertion pool. A value of 1.0 will insert all individuals of the insertion pool into the population, while a value of 0.5 will only add the half of the individuals. With an appropriate setting a growing or a shrinking population can be achieved. But for both obtains: only the NUMBER of inserted/replaced individuals is determined, but not WHICH individuals are replaced/inserted. This is the task of the insertion filter.
A look a the sources of the provided insertion filters gives you an idea of how to implement own filters.