gov.nasa.javaGenes.permutation
Class PermutationKCutMutation
java.lang.Object
gov.nasa.javaGenes.core.ChildMaker
gov.nasa.javaGenes.permutation.PermutationChildMaker
gov.nasa.javaGenes.permutation.PermutationKCutMutation
- All Implemented Interfaces:
- java.lang.Cloneable, java.io.Serializable
- public class PermutationKCutMutation
- extends PermutationChildMaker
Think of a permutation as a graph where the nodes are the integers and neighboring
nodes share an edge. Generate a child by cutting the graph in k places then
putting the pieces together in some other order.
- See Also:
- Serialized Form
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 |
numberOfSegments
protected int numberOfSegments
PermutationKCutMutation
public PermutationKCutMutation(int numberOfCuts)
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()
makeChildren
protected Evolvable[] makeChildren(Evolvable[] parents,
int[] segments,
PermutationEvolvable order)
indexInPrevious
protected boolean indexInPrevious(int index,
int[] array)
toString
public java.lang.String toString()
- Overrides:
toString
in class ChildMaker