JavaGenes, NASA Ames. Written largely by Al Globus

gov.nasa.javaGenes.core
Class ChildMakerChain

java.lang.Object
  extended bygov.nasa.javaGenes.core.ChildMaker
      extended bygov.nasa.javaGenes.core.ChildMakerChain
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable

public class ChildMakerChain
extends ChildMaker

probabalistically mutates the children of a ChildMaker. Can chain mutators for an unlimited length.

See Also:
Serialized Form

Nested Class Summary
protected  class ChildMakerChain.ChainElement
           
 
Field Summary
protected  java.util.Vector chain
           
protected  ChildMaker initialChildMaker
           
 
Fields inherited from class gov.nasa.javaGenes.core.ChildMaker
cumulative, forEvolution, last
 
Constructor Summary
ChildMakerChain(ChildMaker childMaker)
           
 
Method Summary
 void addMutator(ChildMaker mutator, double probability)
          mutator must take one parent only
protected  ChildMakerChain.ChainElement getFromChain(int index)
           
 Evolvable[] makeChildren(Evolvable[] parents)
          Defaults to mutation, any subclass wanting more than one parent must over-ride.
 int numberOfParents()
           
 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

initialChildMaker

protected ChildMaker initialChildMaker

chain

protected java.util.Vector chain
Constructor Detail

ChildMakerChain

public ChildMakerChain(ChildMaker childMaker)
Method Detail

addMutator

public void addMutator(ChildMaker mutator,
                       double probability)
mutator must take one parent only


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).

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()

getFromChain

protected ChildMakerChain.ChainElement getFromChain(int index)

toString

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

JavaGenes, NASA Ames. Written largely by Al Globus