gap
Class TheRandomGenerator
java.lang.Object
|
+--gap.TheRandomGenerator
- public class TheRandomGenerator
- extends java.lang.Object
Implementation of the Park-Miller multiplicative congruential
randomizer (CACM, October 88, Page 1195).*
- Author:
- Pietro Berkes, Samuele Pedroni
Method Summary |
static long |
getParkMillerSeed(long seed)
|
static float |
random()
Return a pseudo random float in the range 0.0 <= x < 1.0 |
static float |
randomFloat(float range)
Compute a pseudo random float in the range 0.0 <= x < range. |
static float |
randomFloat(float min,
float max)
Compute a pseudo random float in the range min <= x < max. |
static float |
randomGaussian()
Return a pseudo random Gaussian distributed float with mean 0.0 and standard
deviation 1.0 . |
static int |
randomInt(int range)
Compute a pseudo random int in the range 0 <= x < range. |
static int |
randomInt(int min,
int max)
Compute a pseudo random int in the range min <= x < max. |
static void |
setParkMillerSeed(long seed)
|
static void |
setRandomGenerator(RandomGenerator rg)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TheRandomGenerator
public TheRandomGenerator()
setParkMillerSeed
public static void setParkMillerSeed(long seed)
getParkMillerSeed
public static long getParkMillerSeed(long seed)
setRandomGenerator
public static void setRandomGenerator(RandomGenerator rg)
random
public static float random()
- Return a pseudo random float in the range 0.0 <= x < 1.0
randomGaussian
public static float randomGaussian()
- Return a pseudo random Gaussian distributed float with mean 0.0 and standard
deviation 1.0 .
randomFloat
public static float randomFloat(float range)
- Compute a pseudo random float in the range 0.0 <= x < range.
randomFloat
public static float randomFloat(float min,
float max)
- Compute a pseudo random float in the range min <= x < max.
randomInt
public static int randomInt(int range)
- Compute a pseudo random int in the range 0 <= x < range.
randomInt
public static int randomInt(int min,
int max)
- Compute a pseudo random int in the range min <= x < max.