org.jgap
Class CrossoverReproductionOperator
java.lang.Object
org.jgap.ReproductionOperator
org.jgap.CrossoverReproductionOperator
- Direct Known Subclasses:
- NeatCrossoverReproductionOperator
public abstract class CrossoverReproductionOperator
- extends ReproductionOperator
Abstract crossover reporduction operator handles iteration over population to determine pairs
of parent chromosomes. Subclass determines specific crossover logic by implementing
reproduce(Configuration config,
Chromosome dominantChrom, Chromosome recessiveChrom).
- Author:
- Philip Tucker
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CrossoverReproductionOperator
public CrossoverReproductionOperator()
reproduce
protected abstract ChromosomeMaterial reproduce(Configuration config,
Chromosome dominantChrom,
Chromosome recessiveChrom)
- Parameters:
config - dominantChrom - recessiveChrom -
- Returns:
- offspring of
dominantChrom and recessiveChrom
reproduce
protected final void reproduce(Configuration config,
java.util.List parentChroms,
int numOffspring,
java.util.List offspring)
- Adds new children of
parents to offspring. Chromosomes "mate"
only within their species, and the number of offspring for each specie is determined by the
size and average fitness of that specie. Species containing only 1 chromosome generate
offspring via cloning.
- Specified by:
reproduce in class ReproductionOperator
- Parameters:
config - parentChroms - List contains Chromosome objectsoffspring - List contains ChromosomeMaterial objects,
offspring of parents; total number of chromosomes in parents and offspring should equal
config.getPopulationSize()numOffspring - # Chromosomes to return in List- See Also:
ReproductionOperator.reproduce(Configuration, List, int, List)