Recombination

This section describes how to recombine individuals. Related classes can be found in the package org.evolvica.core.recombine and appropriate subpackages.

Basics

Recombination is one of the key operations in an evolutionary algorithm and creates a number of child individuals out of a set of parent individuals. The interface for a recombinator and the abstract base class can be found in package org.evolvica.core.recombine. This package contains several subpackages, each indicating the datatype the contained operators work with. For instance the package org.evolvica.core.recombine.Int contains operators to create integer numbers out of other integer numbers. This distinction has been chosen because recombination operators ALWAYS depend on one particular datatype.
The abstract base class requires its subclasses to implement several methods. The most important one is IIndividual[] recombine( IIndividual[] parents ). This method creates an array of children out of a given array of parents. However, there are predefined subclasses of this class, which already already implement this method and specify others. For instance the IntegerRecombinator specifies int[] recombine( int[] parents ) which is basically the same, but lets you deal with plain integer numbers instead of individuals (easier to handle for a developer).
Two other methods are getProducedChildren() and getRequiredParents(). Each recombinator has to indicate via these methods how many individuals are required as parents and how many will be produced as children. This is required to provide a parent array of the correct size in the recombine-method.
Recombination operators are operators that CREATE individuals, therefore an individual builder must be attached. The default is an instance of DefaultIndividualBuilder, but this may be changed by the user.