Class SeedFactory
- java.lang.Object
-
- org.apache.commons.rng.simple.internal.SeedFactory
-
public final class SeedFactory extends Object
Utilities related to seeding.This class provides methods to generate random seeds (single values or arrays of values, of
int
orlong
types) that can be passed to themethods that create a generator instance
.
Although the seed-generating methods defined in this class will likely return different values for all calls, there is no guarantee that the produced seed will result always in a "good" sequence of numbers (even if the generator initialized with that seed is good).
There is no guarantee that sequences will not overlap.- Since:
- 1.0
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static int
createInt()
Creates anint
number for use as a seed.static int[]
createIntArray(int n)
Creates an array ofint
numbers for use as a seed.static long
createLong()
Creates along
number for use as a seed.static long[]
createLongArray(int n)
Creates an array oflong
numbers for use as a seed.
-
-
-
Method Detail
-
createInt
public static int createInt()
Creates anint
number for use as a seed.- Returns:
- a random number.
-
createLong
public static long createLong()
Creates along
number for use as a seed.- Returns:
- a random number.
-
createIntArray
public static int[] createIntArray(int n)
Creates an array ofint
numbers for use as a seed.- Parameters:
n
- Size of the array to create.- Returns:
- an array of
n
random numbers.
-
createLongArray
public static long[] createLongArray(int n)
Creates an array oflong
numbers for use as a seed.- Parameters:
n
- Size of the array to create.- Returns:
- an array of
n
random numbers.
-
-