JavaGenes, NASA Ames. Written largely by Al Globus

gov.nasa.javaGenes.forceFields
Class ChromosomeIntervalCrossover

java.lang.Object
  extended bygov.nasa.javaGenes.core.ChildMaker
      extended bygov.nasa.javaGenes.forceFields.ChromosomeIntervalCrossover
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable
Direct Known Subclasses:
ChromosomeXoverWithMutation

public class ChromosomeIntervalCrossover
extends ChildMaker

Implements a form of crossover were each allele in the child is a function of a random number and values in the mother and father. An interval is constructed between the values in the mother and father. That interval is extended by the value in this.extension. Values larger than 1 will result in the interval becoming larger. The value for the child is then chosen at random from within the interval. However, if the father and mother double values for a particular allele are equal, then an interval centered around this value with a size this.whenEqualExtension * alleles-interval-size and then truncated by the limits of the allele will be used to choose a random number.

See Also:
Serialized Form

Field Summary
protected  AlleleTemplate alleles
           
protected  double extension
          interval crossover fraction of distance between
protected  boolean limitToOriginalInterval
           
 
Fields inherited from class gov.nasa.javaGenes.core.ChildMaker
cumulative, forEvolution, last
 
Constructor Summary
ChromosomeIntervalCrossover(AlleleTemplate a)
           
 
Method Summary
protected  Chromosome getNewChromosome(AlleleTemplate alleles)
           
 Evolvable[] makeChildren(Evolvable[] parents)
          Defaults to mutation, any subclass wanting more than one parent must over-ride.
 int numberOfParents()
           
 void setExtension(double e)
           
 void setLimitToOriginalInterval(boolean limit)
           
 java.lang.String toString()
           
 
Methods inherited from class gov.nasa.javaGenes.core.ChildMaker
checkLastResults, checkResults, clearLast, getAndClearLastTabSeparatedResults, getFitnessFunctionNames, getLastTabSeparatedResults, headerFragment, makeChildren, mutate, neverUsed, proportionDown, results, setFitnessFunction, setFitnessFunctionNames, subClassMeasures, tabSeparatedResults
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

alleles

protected AlleleTemplate alleles

extension

protected double extension
interval crossover fraction of distance between


limitToOriginalInterval

protected boolean limitToOriginalInterval
Constructor Detail

ChromosomeIntervalCrossover

public ChromosomeIntervalCrossover(AlleleTemplate a)
Method Detail

setLimitToOriginalInterval

public void setLimitToOriginalInterval(boolean limit)

setExtension

public void setExtension(double e)

numberOfParents

public int numberOfParents()
Overrides:
numberOfParents in class ChildMaker
Returns:
the number of parents makeChildren expects. I.e., the length of the array passed to makeChildren. If not implemented by subclass, defaults to 1 (mutation).

toString

public java.lang.String toString()
Overrides:
toString in class ChildMaker

makeChildren

public Evolvable[] makeChildren(Evolvable[] parents)
Description copied from class: ChildMaker
Defaults to mutation, any subclass wanting more than one parent must over-ride. Mutators can over-ride mutate(Evovlable)

Overrides:
makeChildren in class ChildMaker
Parameters:
parents - the evolvables from which children will be created. By convention, the parents are not modified.
Returns:
the children created. Subclass must implement copyForEvolution()

getNewChromosome

protected Chromosome getNewChromosome(AlleleTemplate alleles)

JavaGenes, NASA Ames. Written largely by Al Globus