JavaGenes, NASA Ames. Written largely by Al Globus

gov.nasa.javaGenes.evolvableDoubleList
Class CrossoverTwoPoints

java.lang.Object
  extended bygov.nasa.javaGenes.core.ChildMaker
      extended bygov.nasa.javaGenes.evolvableDoubleList.ChildMaker
          extended bygov.nasa.javaGenes.evolvableDoubleList.Crossover
              extended bygov.nasa.javaGenes.evolvableDoubleList.CrossoverTwoPoints
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable
Direct Known Subclasses:
CrossoverTwoPointsEach

public class CrossoverTwoPoints
extends Crossover

See Also:
Serialized Form

Field Summary
 
Fields inherited from class gov.nasa.javaGenes.evolvableDoubleList.ChildMaker
selector
 
Fields inherited from class gov.nasa.javaGenes.core.ChildMaker
cumulative, forEvolution, last
 
Constructor Summary
CrossoverTwoPoints()
           
CrossoverTwoPoints(int modulo)
           
CrossoverTwoPoints(int modulo, int offset)
           
CrossoverTwoPoints(SelectTwoNeighboringPairs selector)
           
 
Method Summary
protected  void crossover(EvolvableDoubleList child, EvolvableDoubleList insertIntoList, EvolvableDoubleList takeFromList, int[] insertInto, int[] takeFrom)
          insertInto (the first parent) chooses the elements between the indices to replace, takeFrom (the second parent) insertInto.
protected  boolean isValid(int[] array)
           
 java.lang.String toString()
           
 
Methods inherited from class gov.nasa.javaGenes.evolvableDoubleList.Crossover
getFirstParentIndicesArray, getIndicesArray, getNeighboringPairsSelector, getSecondParentIndicesArray, getSmallerParent, makeChildren, numberOfParents
 
Methods inherited from class gov.nasa.javaGenes.evolvableDoubleList.ChildMaker
getSelector
 
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
 

Constructor Detail

CrossoverTwoPoints

public CrossoverTwoPoints()

CrossoverTwoPoints

public CrossoverTwoPoints(int modulo)

CrossoverTwoPoints

public CrossoverTwoPoints(int modulo,
                          int offset)

CrossoverTwoPoints

public CrossoverTwoPoints(SelectTwoNeighboringPairs selector)
Method Detail

crossover

protected void crossover(EvolvableDoubleList child,
                         EvolvableDoubleList insertIntoList,
                         EvolvableDoubleList takeFromList,
                         int[] insertInto,
                         int[] takeFrom)
insertInto (the first parent) chooses the elements between the indices to replace, takeFrom (the second parent) insertInto. This implies that the first and last value in the first parent will always be in the child

Overrides:
crossover in class Crossover

isValid

protected boolean isValid(int[] array)

toString

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

JavaGenes, NASA Ames. Written largely by Al Globus