Class UniformRNG
java.lang.Object
dev.nm.stat.random.rng.univariate.uniform.UniformRNG
- All Implemented Interfaces:
RandomLongGenerator
,RandomNumberGenerator
,Seedable
A pseudo uniform random number generator samples numbers from the unit interval, [0, 1],
in such a way that there are equal probabilities of them falling in any same length sub-interval.
Sampling from the unit interval is the most basic building block of most pseudo random number
generation algorithms.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
the pseudo uniform random number generators available -
Constructor Summary
ConstructorsConstructorDescriptionConstruct a pseudo uniform random number generator.UniformRNG
(long... seeds) Construct a seeded pseudo uniform random number generator.UniformRNG
(UniformRNG.Method method) Construct a pseudo uniform random number generator. -
Method Summary
-
Constructor Details
-
UniformRNG
Construct a pseudo uniform random number generator.- Parameters:
method
- the uniform random number generation algorithm to use
-
UniformRNG
public UniformRNG()Construct a pseudo uniform random number generator. -
UniformRNG
public UniformRNG(long... seeds) Construct a seeded pseudo uniform random number generator.- Parameters:
seeds
- the seed(s)
-
-
Method Details
-
seed
public void seed(long... seeds) Description copied from interface:Seedable
Seed the random number/vector/scenario generator to produce repeatable experiments. -
nextDouble
public double nextDouble()Description copied from interface:RandomNumberGenerator
Get the next randomdouble
.- Specified by:
nextDouble
in interfaceRandomNumberGenerator
- Returns:
- the next random number
-
nextLong
public long nextLong()Description copied from interface:RandomLongGenerator
Get the next randomlong
.- Specified by:
nextLong
in interfaceRandomLongGenerator
- Returns:
- the next random
long
-