Package io.jenetics.prngine
Class LCG64ShiftRandom.ThreadLocal
- java.lang.Object
-
- java.lang.ThreadLocal<LCG64ShiftRandom>
-
- io.jenetics.prngine.LCG64ShiftRandom.ThreadLocal
-
- Enclosing class:
- LCG64ShiftRandom
public static final class LCG64ShiftRandom.ThreadLocal extends ThreadLocal<LCG64ShiftRandom>
This class represents a thread local implementation of theLCG64ShiftRandom
PRNG. It's recommended to initialize theRandomRegistry
the following way:Be aware, that calls of the// Register the PRNG with the default parameters. RandomRegistry.setRandom(new LCG64ShiftRandom.ThreadLocal()); // Register the PRNG with the {@code LECUYER3} parameters. RandomRegistry.setRandom(new LCG64ShiftRandom.ThreadLocal( LCG64ShiftRandom.LECUYER3 ));
setSeed(long)
method will throw anUnsupportedOperationException
for thread local instances.RandomRegistry.setRandom(new LCG64ShiftRandom.ThreadLocal()); // Will throw 'UnsupportedOperationException'. RandomRegistry.getRandom().setSeed(1234);
- Since:
- 1.1
- Version:
- 3.0
-
-
Constructor Summary
Constructors Constructor Description ThreadLocal()
Create a new thread local instance of theLCG64ShiftRandom
PRNG with theDEFAULT
parameters.ThreadLocal(LCG64ShiftRandom.Param param)
Create a new thread local instance of theLCG64ShiftRandom
PRNG with the given parameters.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected LCG64ShiftRandom
initialValue()
Create a new PRNG using block splitting for guaranteeing well distributed PRN for every thread.-
Methods inherited from class java.lang.ThreadLocal
get, remove, set, withInitial
-
-
-
-
Constructor Detail
-
ThreadLocal
public ThreadLocal(LCG64ShiftRandom.Param param)
Create a new thread local instance of theLCG64ShiftRandom
PRNG with the given parameters.- Parameters:
param
- the LC parameters.- Throws:
NullPointerException
- if the given parameters are null.
-
ThreadLocal
public ThreadLocal()
Create a new thread local instance of theLCG64ShiftRandom
PRNG with theDEFAULT
parameters.
-
-
Method Detail
-
initialValue
protected LCG64ShiftRandom initialValue()
Create a new PRNG using block splitting for guaranteeing well distributed PRN for every thread.Tina’s Random Number Generator Library
Chapter 2. Pseudo-random numbers for parallel Monte Carlo simulations, Page 7
Heiko Bauke
[ https://github.com/rabauke/trng4/blob/master/doc/trng.pdf ].- Overrides:
initialValue
in classThreadLocal<LCG64ShiftRandom>
-
-