Opus5
Class RandomNumberGenerator
java.lang.Object
|
+--Opus5.RandomNumberGenerator
- public final class RandomNumberGenerator
- extends java.lang.Object
A multiplicative linear congruential pseudo-random number generator.
Adapted from the
minimal standard pseudo-random number generator
described in
Stephen K. Park and Keith W. Miller,
"Random Number Generators: Good Ones Are Hard To Find,"
Communications of the ACM,
Vol. 31, No. 10, Oct. 1988, pp. 1192-1201.
- Version:
- $Id: RandomNumberGenerator.java,v 3.2 1998/07/28 02:09:16 brpreiss Exp $
- Author:
- Bruno R. Preiss, P.Eng.
|
Method Summary |
static double |
nextDouble()
Returns the next pseudo-random number in the sequence. |
static void |
setSeed(int s)
Sets the seed to the specified value. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
setSeed
public static void setSeed(int s)
- Sets the seed to the specified value.
- Parameters:
s - The desired seed.- Throws:
java.lang.IllegalArgumentException - If the specified value is zero.
nextDouble
public static double nextDouble()
- Returns the next pseudo-random number in the sequence.
The numbers returned are uniformly distributed in the interval (0,1].
- Returns:
- The next pseudo-random number in the sequence.