org.simnet.util
Class RandomSource

java.lang.Object
  extended by org.simnet.util.RandomSource

public class RandomSource
extends Object

RandomSource produces random numbers according to a set of user-specified parameters.


Field Summary
static int GAUSSIAN
          A gaussian distribution.
static int UNIFORM
          A uniform distribution.
 
Constructor Summary
RandomSource()
           
 
Method Summary
 RandomSource duplicate(RandomSource dup)
          Returns a duplicate random source.
 boolean getClipping()
           
 int getDistributionIndex()
           
static String[] getFunctionList()
           
 double getLowerBound()
           
 double getMean()
           
 double getRandom()
          Returns a random number.
 double getStandardDeviation()
           
 double getUpperBound()
           
 void setClipping(boolean clipping)
           
 void setDistributionIndex(int distributionIndex)
           
 void setLowerBound(double lowerBound)
           
 void setMean(double mean)
           
 void setStandardDeviation(double standardDeviation)
           
 void setUpperBound(double upperBound)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

UNIFORM

public static final int UNIFORM
A uniform distribution.

See Also:
Constant Field Values

GAUSSIAN

public static final int GAUSSIAN
A gaussian distribution.

See Also:
Constant Field Values
Constructor Detail

RandomSource

public RandomSource()
Method Detail

getRandom

public double getRandom()
Returns a random number.

Returns:
the next random number

duplicate

public RandomSource duplicate(RandomSource dup)
Returns a duplicate random source.

Parameters:
dup - the RandomSource to duplicate.
Returns:
the duplicated RandomSource object.

getMean

public double getMean()
Returns:
Returns the mean.

setMean

public void setMean(double mean)
Parameters:
mean - The mean to set.

getStandardDeviation

public double getStandardDeviation()
Returns:
Returns the standardDeviation.

setStandardDeviation

public void setStandardDeviation(double standardDeviation)
Parameters:
standardDeviation - The standardDeviation to set.

getClipping

public boolean getClipping()
Returns:
Returns the clipping.

setClipping

public void setClipping(boolean clipping)
Parameters:
clipping - The useBounds to set.

getFunctionList

public static String[] getFunctionList()
Returns:
Returns the functionList.

getDistributionIndex

public int getDistributionIndex()
Returns:
Returns the distributionIndex.

setDistributionIndex

public void setDistributionIndex(int distributionIndex)
Parameters:
distributionIndex - The distributionIndex to set.

getLowerBound

public double getLowerBound()
Returns:
Returns the lowerBound.

setLowerBound

public void setLowerBound(double lowerBound)
Parameters:
lowerBound - The lowerBound to set.

getUpperBound

public double getUpperBound()
Returns:
Returns the upperBound.

setUpperBound

public void setUpperBound(double upperBound)
Parameters:
upperBound - The upperBound to set.