org.jgap
Class ReproductionOperator
java.lang.Object
org.jgap.ReproductionOperator
- Direct Known Subclasses:
- CloneReproductionOperator, CrossoverReproductionOperator, DummyReproductionOperator
public abstract class ReproductionOperator
- extends java.lang.Object
Abstract class for reproduction operators. Handles intra-species breeding and someday will handle
inter-species breeding. Each specie gets a number of offspring relative to its fitness, following
NEAT paradigm.
- Author:
- Philip Tucker
Method Summary |
float |
getSlice()
|
protected abstract void |
reproduce(Configuration config,
java.util.List parents,
int numOffspring,
java.util.List offspring)
|
void |
reproduce(Configuration config,
java.util.List parentSpecies,
java.util.List offspring)
The reproduce method will be invoked on each of the reproduction operators referenced by the current
Configuration object during the evolution phase. |
void |
setSlice(float aSlice)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ReproductionOperator
public ReproductionOperator()
reproduce
public final void reproduce(Configuration config,
java.util.List parentSpecies,
java.util.List offspring)
throws InvalidConfigurationException
- The reproduce method will be invoked on each of the reproduction operators referenced by the current
Configuration object during the evolution phase. Operators are given an opportunity to run in the order
they are added to the Configuration. Iterates over species and determines each one's number of offspring
based on fitness, then passes control to subclass
reproduce( final Configuration config,
final List parents, int numOffspring, List offspring )
method to perform specific reproduction.
- Parameters:
config
- The current active genetic configuration.parentSpecies
- List
contains Specie
objects containing parent
chromosomes from which to produce offspring.offspring
- List
contains offspring ChromosomeMaterial
objects; this
method adds new offspring to this list
- Throws:
InvalidConfigurationException
- See Also:
reproduce(Configuration, List, int, List)
reproduce
protected abstract void reproduce(Configuration config,
java.util.List parents,
int numOffspring,
java.util.List offspring)
throws InvalidConfigurationException
- Parameters:
config
- parents
- List contains chromosome objectsnumOffspring
- # Chromosomes to return in Listoffspring
- List contains ChromosomeMaterial objects
- Throws:
InvalidConfigurationException
- See Also:
reproduce(Configuration, List, List)
getSlice
public final float getSlice()
- Returns:
- float slice of population this reproduction operator will fill with offspring
setSlice
public final void setSlice(float aSlice)
- Parameters:
aSlice
- slice of population this reproduction operator will fill with offspring