gov.nasa.javaGenes.forceFields
Class Allele
java.lang.Object
gov.nasa.javaGenes.forceFields.Allele
- All Implemented Interfaces:
- java.io.Serializable
- public class Allele
- extends java.lang.Object
- implements java.io.Serializable
Used to control a single double value in a chromosome. Includes a name
and the minimum and maximum allowed values (in a DoubleInterval)
- See Also:
- Serialized Form
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
name
protected java.lang.String name
noEvolution
protected boolean noEvolution
valueToSet
protected double valueToSet
interval
protected DoubleInterval interval
- holds the maximum and minimum values for this allele
Allele
public Allele(DoubleInterval i)
Allele
public Allele(double low,
double high)
Allele
public Allele(java.lang.String n,
DoubleInterval i)
- Parameters:
n
- name of the allele
getInterval
public DoubleInterval getInterval()
setNoEvolution
public void setNoEvolution(double value)
dontEvolve
public boolean dontEvolve()
getNoEvolutionValue
public double getNoEvolutionValue()
setInterval
public void setInterval(double value)
- set the interval to only include value
valueFits
public boolean valueFits(double value)
- Parameters:
value
- is value within the allowed interval?
isLegal
public boolean isLegal()
- is there any value that can fit in the interval?
getRandomValue
public double getRandomValue()
- Returns:
- a random value within the interval (flat distribution)
getRandomValueAbove
public double getRandomValueAbove(double value)
getRandomValueBelow
public double getRandomValueBelow(double value)
getRandomLogValue
public double getRandomLogValue()
- Returns:
- a random value within the interval (log distribution)
getRandomGaussianValue
public double getRandomGaussianValue(double center,
double sd)
- Parameters:
center
- the center of the Gaussian curvesd
- standard deviation as a fraction of the interval
- Returns:
- a random value within the interval (Gaussian distribution)
getName
public java.lang.String getName()
toString
public java.lang.String toString()