JavaGenes, NASA Ames. Written largely by Al Globus

gov.nasa.alsUtility
Class RandomDistribution

java.lang.Object
  extended bygov.nasa.alsUtility.Distribution
      extended bygov.nasa.alsUtility.RandomDistribution

public class RandomDistribution
extends Distribution

this class produces random numbers from an interval.


Field Summary
protected  DoubleInterval interval
          the interval from within which random numbers are produced
protected  int size
          the number of numbers in the distribution.
 
Constructor Summary
RandomDistribution(int s, DoubleInterval i)
           
 
Method Summary
 double get(int i)
           
 int size()
          number of values available
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

size

protected int size
the number of numbers in the distribution. Actually, this is ignored by the code.


interval

protected DoubleInterval interval
the interval from within which random numbers are produced

Constructor Detail

RandomDistribution

public RandomDistribution(int s,
                          DoubleInterval i)
Parameters:
s - the size of the distribution
i - the interval
Method Detail

size

public int size()
Description copied from class: Distribution
number of values available

Specified by:
size in class Distribution

get

public double get(int i)
Specified by:
get in class Distribution
Parameters:
i - for this particular distribution class, this is ignored
Returns:
a random number from within the interval

JavaGenes, NASA Ames. Written largely by Al Globus