org.jgap
Class CrossoverReproductionOperator

java.lang.Object
  extended by org.jgap.ReproductionOperator
      extended by 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

Constructor Summary
CrossoverReproductionOperator()
           
 
Method Summary
protected abstract  ChromosomeMaterial reproduce(Configuration config, Chromosome dominantChrom, Chromosome recessiveChrom)
           
protected  void reproduce(Configuration config, java.util.List parentChroms, int numOffspring, java.util.List offspring)
          Adds new children of parents to offspring.
 
Methods inherited from class org.jgap.ReproductionOperator
getSlice, reproduce, setSlice
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CrossoverReproductionOperator

public CrossoverReproductionOperator()
Method Detail

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 objects
offspring - 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)