public class RandomUtil extends Object
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_SEED
If not specified, this will be the seed used for random objects used
internally within JSAT.
You may change this to any desired value at the start of any experiments to consistently get new experimental results. |
static boolean |
INCREMENT_SEEDS
This controls whether or not
getRandom() will cause a change in
the DEFAULT_SEED each time it is called. |
Modifier and Type | Method and Description |
---|---|
static Random |
getRandom()
Returns a new Random object that can be used.
|
static Random |
getRandom(int seed)
Returns a new Random object that can be used, initiated with the given
seed.
|
public static int DEFAULT_SEED
public static boolean INCREMENT_SEEDS
getRandom()
will cause a change in
the DEFAULT_SEED
each time it is called. This is the default to
ensure that multiple calls to getRandom will not return an equivalent
object.public static Random getRandom()
Random
. Essentially, it will be better than Java's default PRNG
in every way. DEFAULT_SEED
and INCREMENT_SEEDS
.public static Random getRandom(int seed)
Random
. Essentially, it will be better than
Java's default PRNG in every way. seed
- the seed of the PRNG, which determines the sequence generated
by the returned objectCopyright © 2017. All rights reserved.