JavaGenes, NASA Ames. Written largely by Al Globus

gov.nasa.javaGenes.forceFields
Class ChromosomeMutation

java.lang.Object
  extended bygov.nasa.javaGenes.core.ChildMaker
      extended bygov.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

Field Summary
protected  AlleleTemplate alleles
           
protected  double frequency
          average fraction of the alleles to be used.
protected  boolean limitToOriginalInterval
           
protected  double standardDeviation
          The standard deviation to use expressed as a fraction of the allele interval
 
Fields inherited from class gov.nasa.javaGenes.core.ChildMaker
cumulative, forEvolution, last
 
Constructor Summary
protected ChromosomeMutation()
           
  ChromosomeMutation(AlleleTemplate a)
           
  ChromosomeMutation(AlleleTemplate a, double sd)
           
  ChromosomeMutation(AlleleTemplate a, double sd, double f)
           
 
Method Summary
protected  double forceInsideAlleleLimits(Allele allele, double value, double parentValue)
           
protected  Chromosome getNewChromosome(AlleleTemplate alleles)
           
 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!
 int numberOfParents()
           
 void setLimitToOriginalInterval(boolean limit)
           
 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

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.

Constructor Detail

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 use
f - average fraction of the alleles to be used. Whether any alleles is to be used is a randomized event.
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).

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)

JavaGenes, NASA Ames. Written largely by Al Globus