public class StandardRandom extends java.lang.Object implements IRandomNumberGenerator
| Constructor and Description |
|---|
StandardRandom() |
StandardRandom(long seed) |
| Modifier and Type | Method and Description |
|---|---|
int |
nextBits(int numbits)
Returns up to 32 random bits.
|
double |
nextDouble()
Returns the next pseudorandom, uniformly distributed double value
between 0.0 and 1.0 from this random number generator's sequence.
|
void |
nextDoubles(double[] d)
Returns a vector of pseudorandom, uniformly distributed double values
between 0.0 and 1.0 from this random number generator's sequence.
|
int |
nextInt()
Returns the next pseudorandom, uniformly distributed int value
from this random number generator's sequence.
|
int |
nextInt(int n)
Returns a pseudorandom, uniformly distributed int value
between 0 (inclusive) and the specified value (exclusive),
drawn from this random number generator's sequence.
|
long |
nextLong()
Returns the next pseudorandom, uniformly distributed long value
from this random number generator's sequence.
|
void |
setSeed(long seed)
Set seed.
|
public StandardRandom()
public StandardRandom(long seed)
public void setSeed(long seed)
IRandomNumberGeneratorsetSeed in interface IRandomNumberGeneratorseed - Seed.public int nextBits(int numbits)
IRandomNumberGeneratornextBits in interface IRandomNumberGeneratorpublic int nextInt()
IRandomNumberGeneratornextInt in interface IRandomNumberGeneratorpublic int nextInt(int n)
IRandomNumberGeneratornextInt in interface IRandomNumberGeneratorpublic long nextLong()
IRandomNumberGeneratornextLong in interface IRandomNumberGeneratorpublic double nextDouble()
IRandomNumberGeneratornextDouble in interface IRandomNumberGeneratorpublic void nextDoubles(double[] d)
IRandomNumberGeneratornextDoubles in interface IRandomNumberGenerator