|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.grogra.blocks.arrangeBlock.RandomGenerator
public class RandomGenerator
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 | |
---|---|
RandomGenerator()
|
|
RandomGenerator(long seed)
|
Method Summary | |
---|---|
long |
getSeed()
Get the random number generator's seed. |
long |
nextLong()
|
void |
reseed()
Get another seed well-spaced (from the default SeedGenerator ) |
double |
sample()
|
void |
setSeed(long seed)
Set the random number generator's seed. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RandomGenerator()
public RandomGenerator(long seed)
Method Detail |
---|
public long getSeed()
Seedable
getSeed
in interface Seedable
public long nextLong()
public void reseed()
Seedable
SeedGenerator
)
reseed
in interface Seedable
public double sample()
sample
in interface ContinuousGenerator
public void setSeed(long seed)
Seedable
setSeed
in interface Seedable
seed
- The new seed for the generator
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |