public class RngUtils
extends java.lang.Object
RandomNumberGenerator rng = RngUtils.synchronizedRNG(new Gaussian());
or
RandomLongGenerator rlg = RngUtils.synchronizedRLG(new MersenneTwister());
| Modifier and Type | Method and Description |
|---|---|
static RandomLongGenerator |
synchronizedRLG(RandomLongGenerator rng)
Return a synchronized (thread-safe)
RandomLongGenerator
backed by a specified generator. |
static RandomNumberGenerator |
synchronizedRNG(RandomNumberGenerator rng)
Return a synchronized (thread-safe)
RandomNumberGenerator
backed by a specified generator. |
static RandomVectorGenerator |
synchronizedRVG(RandomVectorGenerator rng)
Return a synchronized (thread-safe)
RandomVectorGenerator
backed by a specified generator. |
public static RandomNumberGenerator synchronizedRNG(RandomNumberGenerator rng)
RandomNumberGenerator
backed by a specified generator.rng - the generator to be "wrapped" in a synchronized generatorpublic static RandomLongGenerator synchronizedRLG(RandomLongGenerator rng)
RandomLongGenerator
backed by a specified generator.rng - the generator to be "wrapped" in a synchronized generatorpublic static RandomVectorGenerator synchronizedRVG(RandomVectorGenerator rng)
RandomVectorGenerator
backed by a specified generator.rng - the generator to be "wrapped" in a synchronized generator