Class ContextRNG<T>
- java.lang.Object
-
- dev.nm.stat.random.rng.concurrent.context.ContextRNG<T>
-
- Type Parameters:
T- the context type
- All Implemented Interfaces:
RandomNumberGenerator,Seedable
- Direct Known Subclasses:
ThreadIDRNG
public abstract class ContextRNG<T> extends Object implements RandomNumberGenerator
This uniform number generator generates independent sequences of random numbers per context.
-
-
Constructor Summary
Constructors Constructor Description ContextRNG()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected RandomNumberGeneratorgetRNG(T context)doublenextDouble()Get the next randomdouble.voidremoveContext()voidseed(long... seeds)Seed the random number/vector/scenario generator to produce repeatable experiments.
-
-
-
Method Detail
-
getRNG
protected RandomNumberGenerator getRNG(T context)
-
removeContext
public void removeContext()
-
nextDouble
public double nextDouble()
Description copied from interface:RandomNumberGeneratorGet the next randomdouble.- Specified by:
nextDoublein interfaceRandomNumberGenerator- Returns:
- the next random number
-
-