java.lang.Object
io.jenetics.ext.internal.util.Randoms
- Since:
- 3.5
- Version:
- 3.5
-
Method Summary
Modifier and TypeMethodDescriptionstatic BigIntegernextBigInteger(BigInteger min, BigInteger max, RandomGenerator random) Returns a pseudo-random, uniformly distributed int value between min and max (min and max included).static BigIntegernextBigInteger(BigInteger n, RandomGenerator random) Returns a pseudo-random, uniformly distributed int value between 0 (inclusive) and the specified value (exclusive), drawn from the given random number generator's sequence.
-
Method Details
-
nextBigInteger
Returns a pseudo-random, uniformly distributed int value between 0 (inclusive) and the specified value (exclusive), drawn from the given random number generator's sequence.- Parameters:
n- the bound on the random number to be returned. Must be positive.random- the random engine used for creating the random number.- Returns:
- the next pseudo-random, uniformly distributed int value between 0 (inclusive) and n (exclusive) from the given random number generator's sequence
- Throws:
IllegalArgumentException- if n is smaller than 1.NullPointerException- if the givenrandomengine of the maximal valuenisnull.
-
nextBigInteger
Returns a pseudo-random, uniformly distributed int value between min and max (min and max included).- Parameters:
min- lower bound for generated long integer (inclusively)max- upper bound for generated long integer (exclusively)random- the random engine to use for calculating the random long value- Returns:
- a random long integer greater than or equal to
minand less than or equal tomax - Throws:
IllegalArgumentException- ifmin >= maxNullPointerException- if one of the given parameters arenull.
-