public class RandomFactory extends Object
Random
generator objects.
It does not provide individual random numbers, but will create a random
generator; either using a fixed seed or random seeded (default).
The seed can be globally predefined using -Delki.seed=123
.
These classes are not optimized for non-predictability, but for speed, as
scientific experiments are not likely to be adversarial.Modifier and Type | Field and Description |
---|---|
static RandomFactory |
DEFAULT
Global default factory
|
private long |
seed
Seed.
|
Constructor and Description |
---|
RandomFactory(long seed)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
static RandomFactory |
get(Long seed)
Factory method: Get a random factory for the given seed.
|
private static long |
getGlobalSeed()
Initialize the default random.
|
Random |
getRandom()
Get a random generator.
|
Random |
getSingleThreadedRandom()
Get a non-threadsafe random generator.
|
public static RandomFactory DEFAULT
private long seed
public RandomFactory(long seed)
seed
- Random seedprivate static long getGlobalSeed()
public static RandomFactory get(Long seed)
seed
- Seedpublic Random getRandom()
public Random getSingleThreadedRandom()
Copyright © 2015 ELKI Development Team, Lehr- und Forschungseinheit für Datenbanksysteme, Ludwig-Maximilians-Universität München. License information.