public class ConcurrentCachedRNG extends Object implements RandomNumberGenerator
ConcurrentCachedGenerator.| Constructor and Description |
|---|
ConcurrentCachedRNG(RandomNumberGenerator rng)
Construct a new instance which wraps the given random number generator
and
uses a cache which has 8 entries per available core.
|
ConcurrentCachedRNG(RandomNumberGenerator rng,
int cacheSize)
Constructs a new instance which wraps the given random number generator
and uses a cache of the specified size.
|
| Modifier and Type | Method and Description |
|---|---|
double |
nextDouble()
Get the next random
double. |
void |
seed(long... seeds)
Delegate to the underlying random number generator.
|
public ConcurrentCachedRNG(RandomNumberGenerator rng, int cacheSize)
rng - the underlying generatorcacheSize - the cache sizeConcurrentCachedGenerator.ConcurrentCachedGenerator(dev.nm.stat.random.rng.concurrent.cache.ConcurrentCachedGenerator.Generator,
int)public ConcurrentCachedRNG(RandomNumberGenerator rng)
rng - the underlying generatorpublic double nextDouble()
RandomNumberGeneratordouble.nextDouble in interface RandomNumberGeneratorCopyright © 2010-2020 NM FinTech Ltd.. All Rights Reserved.