|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.artoflife.util.RandomGenerator
Each Thread gets its own RandomGenerator to use, which wraps a Random to generate pseudo-random numbers.
Method Summary | |
static float |
nextFloat()
|
static float |
nextGaussian()
|
static int |
nextInt(int limit)
|
static java.lang.Object |
randomEntry(java.util.List list)
|
static void |
restore(java.io.ObjectInputStream stream)
Persist the random number generator to a stream. |
static void |
save(java.io.ObjectOutputStream stream)
Persist the random number generator to a stream. |
static void |
setSeed(long seed)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static void setSeed(long seed)
MersenneTwisterFast#setSeed(long)
public static float nextGaussian()
float
value with mean 0.0
and standard
deviation 1.0
from this random number generator's sequence.Random.nextGaussian()
public static float nextFloat()
float
value between 0.0
and
1.0
from this random number generator's sequence.Random.nextDouble()
public static int nextInt(int limit)
limit
- (exclusive) for the int returned, for example
if 4, the returned int will be 0, 1, 2 or 3Random.nextInt(int)
public static java.lang.Object randomEntry(java.util.List list)
list
- to choose a random entry from
public static void save(java.io.ObjectOutputStream stream) throws java.io.IOException
java.io.IOException
restore(java.io.ObjectInputStream)
public static void restore(java.io.ObjectInputStream stream) throws java.io.IOException, java.lang.ClassNotFoundException
java.io.IOException
java.lang.ClassNotFoundException
save(java.io.ObjectOutputStream)
|
artoflife pre0.1.0-dev | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |