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
public class ThreadIDRLG extends ThreadIDRNG implements RandomLongGenerator
This uniform number generator generates independent sequences of random numbers per thread, hence thread-safe.
-
-
Constructor Summary
Constructors Constructor Description ThreadIDRLG()Constructs 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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longnextLong()Get the next randomlong.-
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 Detail
-
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 Detail
-
nextLong
public long nextLong()
Description copied from interface:RandomLongGeneratorGet the next randomlong.- Specified by:
nextLongin interfaceRandomLongGenerator- Returns:
- the next random
long
-
-