JavaGenes, NASA Ames. Written largely by Al Globus

gov.nasa.javaGenes.permutation
Class PermutationOrderMutation

java.lang.Object
  extended bygov.nasa.javaGenes.core.ChildMaker
      extended bygov.nasa.javaGenes.permutation.PermutationChildMaker
          extended bygov.nasa.javaGenes.permutation.PermutationOrderMutation
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable
Direct Known Subclasses:
OrderMutation, SqueakyWheelTournamentSwapMutation

public class PermutationOrderMutation
extends PermutationChildMaker

Gilbert Sysweda's order based mutation

See Also:
Serialized Form

Field Summary
protected  int numberOfSwaps
           
 
Fields inherited from class gov.nasa.javaGenes.core.ChildMaker
cumulative, forEvolution, last
 
Constructor Summary
PermutationOrderMutation()
           
PermutationOrderMutation(int inNumberOfSwaps)
           
 
Method Summary
protected  int getFirstIndex(PermutationEvolvable kid)
           
protected  int getSecondIndex(PermutationEvolvable kid, int firstIndex)
           
 Evolvable[] makeChildren(Evolvable[] parents)
          Defaults to mutation, any subclass wanting more than one parent must over-ride.
 void mutate(int index1, int index2, PermutationEvolvable kid)
          made public only for testing
 int numberOfParents()
           
 java.lang.String toString()
           
 
Methods inherited from class gov.nasa.javaGenes.permutation.PermutationChildMaker
copyIndex
 
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

numberOfSwaps

protected int numberOfSwaps
Constructor Detail

PermutationOrderMutation

public PermutationOrderMutation()

PermutationOrderMutation

public PermutationOrderMutation(int inNumberOfSwaps)
Method Detail

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

mutate

public void mutate(int index1,
                   int index2,
                   PermutationEvolvable kid)
made public only for testing


getFirstIndex

protected int getFirstIndex(PermutationEvolvable kid)

getSecondIndex

protected int getSecondIndex(PermutationEvolvable kid,
                             int firstIndex)

toString

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

JavaGenes, NASA Ames. Written largely by Al Globus