Class ThreadIDRLG
java.lang.Object
dev.nm.stat.random.rng.concurrent.context.ContextRNG<Long>
dev.nm.stat.random.rng.concurrent.context.ThreadIDRNG
dev.nm.stat.random.rng.concurrent.context.ThreadIDRLG
- All Implemented Interfaces:
RandomLongGenerator
,RandomNumberGenerator
,Seedable
This uniform number generator generates independent sequences of random numbers per thread, hence
thread-safe.
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs a per-context repeatable RLG.ThreadIDRLG
(int N) Constructs a per-context repeatable RLG.ThreadIDRLG
(int N, long seed) Constructs a per-context repeatable RLG.ThreadIDRLG
(long seed) Constructs a per-context repeatable RLG. -
Method Summary
Methods inherited from class dev.nm.stat.random.rng.concurrent.context.ThreadIDRNG
setContext
Methods inherited from class dev.nm.stat.random.rng.concurrent.context.ContextRNG
getRNG, nextDouble, removeContext, seed
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface dev.nm.stat.random.rng.univariate.RandomNumberGenerator
nextDouble
-
Constructor Details
-
ThreadIDRLG
public ThreadIDRLG(int N, long seed) Constructs a per-context repeatable RLG.- Parameters:
N
- the maximum number of threadsseed
- a seed
-
ThreadIDRLG
public ThreadIDRLG(int N) Constructs a per-context repeatable RLG.- Parameters:
N
- the maximum number of threads
-
ThreadIDRLG
public ThreadIDRLG()Constructs a per-context repeatable RLG. -
ThreadIDRLG
public ThreadIDRLG(long seed) Constructs a per-context repeatable RLG.- Parameters:
seed
- a seed
-
-
Method Details
-
nextLong
public long nextLong()Description copied from interface:RandomLongGenerator
Get the next randomlong
.- Specified by:
nextLong
in interfaceRandomLongGenerator
- Returns:
- the next random
long
-