Package jadex.commons.random
Class FastThreadedRandom
- java.lang.Object
-
- java.util.Random
-
- jadex.commons.random.FastThreadedRandom
-
- All Implemented Interfaces:
java.io.Serializable
public class FastThreadedRandom extends java.util.RandomWrapper for quick multi-threaded PRNG access using multiple PRNGs.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Random[]prngsThe random number generators.protected intthreadingmaskMask for distributing threads.
-
Constructor Summary
Constructors Constructor Description FastThreadedRandom()Creates the wrapper.FastThreadedRandom(java.lang.Class<?> randomclazz)Creates the wrapper.FastThreadedRandom(java.lang.Class<?> randomclazz, int threadinglevel)Creates the wrapper.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleannextBoolean()Wrapper method.voidnextBytes(byte[] bytes)Wrapper method.doublenextDouble()Wrapper method.floatnextFloat()Wrapper method.doublenextGaussian()Wrapper method.intnextInt()Wrapper method.intnextInt(int bound)Wrapper method.longnextLong()Wrapper method.voidsetSeed(long seed)Wrapper method.
-
-
-
Constructor Detail
-
FastThreadedRandom
public FastThreadedRandom()
Creates the wrapper.
-
FastThreadedRandom
public FastThreadedRandom(java.lang.Class<?> randomclazz)
Creates the wrapper.
-
FastThreadedRandom
public FastThreadedRandom(java.lang.Class<?> randomclazz, int threadinglevel)Creates the wrapper.
-
-
Method Detail
-
nextBoolean
public boolean nextBoolean()
Wrapper method.- Overrides:
nextBooleanin classjava.util.Random
-
nextBytes
public void nextBytes(byte[] bytes)
Wrapper method.- Overrides:
nextBytesin classjava.util.Random
-
nextDouble
public double nextDouble()
Wrapper method.- Overrides:
nextDoublein classjava.util.Random
-
nextFloat
public float nextFloat()
Wrapper method.- Overrides:
nextFloatin classjava.util.Random
-
nextGaussian
public double nextGaussian()
Wrapper method.- Overrides:
nextGaussianin classjava.util.Random
-
nextInt
public int nextInt()
Wrapper method.- Overrides:
nextIntin classjava.util.Random
-
nextInt
public int nextInt(int bound)
Wrapper method.- Overrides:
nextIntin classjava.util.Random
-
nextLong
public long nextLong()
Wrapper method.- Overrides:
nextLongin classjava.util.Random
-
setSeed
public void setSeed(long seed)
Wrapper method. Warning: This is useless, included for completeness.- Overrides:
setSeedin classjava.util.Random
-
-