JavaGenes, NASA Ames. Written largely by Al Globus

gov.nasa.javaGenes.core
Class ChildMaker

java.lang.Object
  extended bygov.nasa.javaGenes.core.ChildMaker
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable
Direct Known Subclasses:
ChildMaker, ChildMaker, ChildMakerChain, ChromosomeCrossover, ChromosomeIntervalCrossover, ChromosomeMutation, GraphGenerator, gov.nasa.javaGenes.graph.GraphMutation, PermutationChildMaker, TwoVertexGraphCrossover

public class ChildMaker
extends java.lang.Object
implements java.lang.Cloneable, java.io.Serializable

This is the superclass for all transmission operators. All mutation and crossover classes must be subclasses of ChildMaker. Class is designed to default to mutation to simplify mutation code. See doc on individual methods for what needs to be over-ridden.

See Also:
Serialized Form

Field Summary
protected  LogComparisons cumulative
           
protected  LogComparisons forEvolution
           
protected  LogComparisons last
           
 
Constructor Summary
ChildMaker()
           
 
Method Summary
protected  boolean checkLastResults(int index, int upv, int downv, int samev)
           
protected  boolean checkResults(int index, int upv, int downv, int samev)
          for testing only
 void clearLast()
           
 java.lang.String getAndClearLastTabSeparatedResults()
           
 java.lang.String[] getFitnessFunctionNames()
           
 java.lang.String getLastTabSeparatedResults()
           
 java.lang.String headerFragment()
           
 Evolvable[] makeChildren(Evolvable[] parents)
          Defaults to mutation, any subclass wanting more than one parent must over-ride.
 Evolvable[] makeChildren(Individual[] parents)
          only used when the variation operator need the fitness value
protected  Evolvable mutate(Evolvable chld)
          mutators should over-ride, subclasses with multiple parents can ignore.
 boolean neverUsed()
           
 int numberOfParents()
           
 double proportionDown()
           
 void results(Individual child, Individual[] parents)
           
 void setFitnessFunction(FitnessFunction ff)
           
 void setFitnessFunctionNames(java.lang.String[] fitnessNames)
           
 java.lang.String subClassMeasures()
           
 java.lang.String tabSeparatedResults()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

cumulative

protected LogComparisons cumulative

last

protected LogComparisons last

forEvolution

protected LogComparisons forEvolution
Constructor Detail

ChildMaker

public ChildMaker()
Method Detail

neverUsed

public boolean neverUsed()

proportionDown

public double proportionDown()

numberOfParents

public int numberOfParents()
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)
Defaults to mutation, any subclass wanting more than one parent must over-ride. Mutators can over-ride mutate(Evovlable)

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

makeChildren

public Evolvable[] makeChildren(Individual[] parents)
only used when the variation operator need the fitness value


mutate

protected Evolvable mutate(Evolvable chld)
mutators should over-ride, subclasses with multiple parents can ignore. This method should never be called from anywhere but makeChildren(Evolvable[]) in this class.

Returns:
the input Evolvable in mutated condition

setFitnessFunction

public void setFitnessFunction(FitnessFunction ff)

setFitnessFunctionNames

public void setFitnessFunctionNames(java.lang.String[] fitnessNames)

getFitnessFunctionNames

public java.lang.String[] getFitnessFunctionNames()

checkResults

protected boolean checkResults(int index,
                               int upv,
                               int downv,
                               int samev)
for testing only


checkLastResults

protected boolean checkLastResults(int index,
                                   int upv,
                                   int downv,
                                   int samev)

results

public void results(Individual child,
                    Individual[] parents)

tabSeparatedResults

public java.lang.String tabSeparatedResults()

getAndClearLastTabSeparatedResults

public java.lang.String getAndClearLastTabSeparatedResults()

getLastTabSeparatedResults

public java.lang.String getLastTabSeparatedResults()

clearLast

public void clearLast()

headerFragment

public java.lang.String headerFragment()

subClassMeasures

public java.lang.String subClassMeasures()

toString

public java.lang.String toString()

JavaGenes, NASA Ames. Written largely by Al Globus