Class  Description 

JDKRandomBridge 
Enum  Description 

RandomSource 
This class provides the API for creating generators of random numbers.

This package provides
factory methods
by which lowlevel classes implemented in module "commonsrngcore"
are instantiated.
Classes in package org.apache.commons.rng.simple.internal
should not be used directly.
The generators are not threadsafe: Parallel applications must
use different generator instances in different threads.
In the case of pseudorandom generators, the source of randomness is
usually a set of numbers whose bits representation are scrambled in such
a way as to produce a randomlooking sequence.
The main property of the sequence is that the numbers must be uniformly
distributed within their allowed range.
Classes in this package do not provide any further processing of the
number generation such as to match other types of distribution.
Which source of randomness to choose may depend on which properties
are more important.
Considerations can include speed of generation, memory usage, period
size, equidistribution, correlation, etc.
For some of the generators, interesting properties (of the reference
implementations) are proven in scientific papers.
Some generators can also suffer from potential weaknesses.
For simple sampling, any of the generators implemented in this library
may be sufficient.
For MonteCarlo simulations that require generating highdimensional
vectors), equidistribution and noncorrelation are crucial.
The Mersenne Twister and Well generators have
equidistribution properties proven according to their bits pool size
which is directly related to their period (all of them have maximal
period, i.e. a generator with size n
pool has a period
2^{n}1
).
They also have equidistribution properties for 32 bits blocks up to
s/32
dimension where s
is their pool size.
For example, Well19937c
is equidistributed up to dimension 623
(i.e. 19937 divided by 32).
It means that a MonteCarlo simulation generating vectors of n
(32bits integer) variables at each iteration has some guarantee on the
properties of its components as long as n < 623
.
Note that if the variables are of type double
, the limit is
divided by two (since 64 bits are needed to create a double
).
Reference to the relevant publications are listed in the specific
documentation of each class.
Memory usage can vary a lot between providers.
The state of MersenneTwister
is composed of 624 integers,
using about 2.5 kB.
The Well generators use 6 integer arrays, the length of each
being equal to the pool size; thus, for example, Well44497b
uses about 33 kB.
Copyright © 2016–2017 The Apache Software Foundation. All rights reserved.