psimjava
Class Normalp

java.lang.Object
  extended by java.util.Random
      extended by psimjava.Normalp
All Implemented Interfaces:
java.io.Serializable, RandomGenerator

public class Normalp
extends java.util.Random
implements RandomGenerator

Normal Distribution random number generator

PsimJ Java package for OO simulation

Object-oriented simulation package, process interaction approach.

(C) J. M. Garrido. June 2000, 2003, 2004

Random number generator, Normal distribution

See Also:
Serialized Form

Constructor Summary
Normalp(double rmean, double rstd)
          Constructor using values of type double
Normalp(double rmean, double rstd, int seed)
          Constructor using values of type double
Normalp(long mean, long stdev)
          Constructor for random number generator object - Normal dist
Normalp(long mean, long stdev, int seed)
          Constructor for random number generator object - Normal dist
 
Method Summary
 long draw()
          This function generates a random number of type 'long' from the Normal distribution set up by the constructor
 double fdraw()
          This function generates a random number from Normal distribution set up by the constructor
 
Methods inherited from class java.util.Random
next, nextBoolean, nextBytes, nextDouble, nextFloat, nextGaussian, nextInt, nextInt, nextLong, setSeed
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Normalp

public Normalp(long mean,
               long stdev,
               int seed)
Constructor for random number generator object - Normal dist

Parameters:
mean - long the mean value for the distribution
stdev - long the value of the standard deviation
seed - int the value to set the random stream.

Normalp

public Normalp(long mean,
               long stdev)
Constructor for random number generator object - Normal dist

Parameters:
mean - long the mean value for the distribution
stdev - long the value of the standard deviation

Normalp

public Normalp(double rmean,
               double rstd,
               int seed)
Constructor using values of type double

Parameters:
rmean - double - Mean of the distribution
rstd - double - Standard Deviation of the distribution
seed - int - seed for the distribution

Normalp

public Normalp(double rmean,
               double rstd)
Constructor using values of type double

Parameters:
rmean - double - Mean of the distribution
rstd - double - Standard Deviation of the distribution
Method Detail

draw

public long draw()
This function generates a random number of type 'long' from the Normal distribution set up by the constructor

Specified by:
draw in interface RandomGenerator
Returns:
long, a random number.

fdraw

public double fdraw()
This function generates a random number from Normal distribution set up by the constructor

Returns:
double, a pseudo-random number.