JavaGenes, NASA Ames. Written largely by Al Globus

gov.nasa.javaGenes.forceFields
Class Allele

java.lang.Object
  extended bygov.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

Field Summary
protected  DoubleInterval interval
          holds the maximum and minimum values for this allele
protected  java.lang.String name
           
protected  boolean noEvolution
           
protected  double valueToSet
           
 
Constructor Summary
Allele(double low, double high)
           
Allele(DoubleInterval i)
           
Allele(java.lang.String n, DoubleInterval i)
           
 
Method Summary
 boolean dontEvolve()
           
 DoubleInterval getInterval()
           
 java.lang.String getName()
           
 double getNoEvolutionValue()
           
 double getRandomGaussianValue(double center, double sd)
           
 double getRandomLogValue()
           
 double getRandomValue()
           
 double getRandomValueAbove(double value)
           
 double getRandomValueBelow(double value)
           
 boolean isLegal()
          is there any value that can fit in the interval?
 void setInterval(double value)
          set the interval to only include value
 void setNoEvolution(double value)
           
 java.lang.String toString()
           
 boolean valueFits(double value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

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

Constructor Detail

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
Method Detail

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

JavaGenes, NASA Ames. Written largely by Al Globus