Class RandomGenerator
java.lang.Object
eduni.distributions.RandomGenerator
- All Implemented Interfaces:
ContinuousGenerator,Seedable
A random number generator producing pseudorandom numbers based
on the value of a specific seed. The generator is a multiplicative
linear congruential generator. It generates numbers through the
following structure:
Y[1] = (742938285*Y[0]) mod (231-1)
The seed (Y[0]) provided is used to generate a sequence of pseudorandom
numbers uniformly distributed between 0 and 1. The cycle of the generator
is 231-2.
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
RandomGenerator
public RandomGenerator() -
RandomGenerator
public RandomGenerator(long seed)
-
-
Method Details
-
sample
public double sample()- Specified by:
samplein interfaceContinuousGenerator
-
nextLong
public long nextLong()- Returns:
- The next long random number in the sequence
-
setSeed
-
getSeed
-
reseed
-