Class ThreadIDRNG
- java.lang.Object
-
- dev.nm.stat.random.rng.concurrent.context.ContextRNG<Long>
-
- dev.nm.stat.random.rng.concurrent.context.ThreadIDRNG
-
- All Implemented Interfaces:
RandomNumberGenerator
,Seedable
- Direct Known Subclasses:
ThreadIDRLG
public class ThreadIDRNG extends ContextRNG<Long>
This random number generator generates independent sequences of random numbers per thread, hence thread-safe.
-
-
Constructor Summary
Constructors Constructor Description ThreadIDRNG(int N, long seed)
Constructs a per-context repeatable RNG.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
setContext(long context)
Sets the context of this thread.-
Methods inherited from class dev.nm.stat.random.rng.concurrent.context.ContextRNG
getRNG, nextDouble, removeContext, seed
-
-