gov.nasa.javaGenes.forceFields
Class ChromosomeMutation
java.lang.Object
gov.nasa.javaGenes.core.ChildMaker
gov.nasa.javaGenes.forceFields.ChromosomeMutation
- All Implemented Interfaces:
- java.lang.Cloneable, java.io.Serializable
- Direct Known Subclasses:
- Mutation3Parents
- public class ChromosomeMutation
- extends ChildMaker
Mutates some fraction of the alleles with a random number chosen
from a Gaussian distribution
- 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 |
limitToOriginalInterval
protected boolean limitToOriginalInterval
alleles
protected AlleleTemplate alleles
standardDeviation
protected double standardDeviation
- The standard deviation to use expressed as a fraction of the allele interval
frequency
protected double frequency
- average fraction of the alleles to be used. Whether any alleles is to be used is a randomized event.
If this too small, can get effective infinite loop since at least one change is required
for the makeChildren() method to complete!
Value defaults to 1.
ChromosomeMutation
protected ChromosomeMutation()
ChromosomeMutation
public ChromosomeMutation(AlleleTemplate a)
ChromosomeMutation
public ChromosomeMutation(AlleleTemplate a,
double sd)
- Parameters:
sd
- standard deviation to use
ChromosomeMutation
public ChromosomeMutation(AlleleTemplate a,
double sd,
double f)
- Parameters:
sd
- standard deviation to usef
- average fraction of the alleles to be used. Whether any alleles is to be used is a randomized event.
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).
setLimitToOriginalInterval
public void setLimitToOriginalInterval(boolean limit)
toString
public java.lang.String toString()
- Overrides:
toString
in class ChildMaker
makeChildren
public Evolvable[] makeChildren(Evolvable[] parents)
- If this.fraction too small, can get effective infinite loop since at least one change is required
for the method to complete!
- 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()
forceInsideAlleleLimits
protected double forceInsideAlleleLimits(Allele allele,
double value,
double parentValue)
getNewChromosome
protected Chromosome getNewChromosome(AlleleTemplate alleles)