java.lang.Object
io.jenetics.ext.internal.util.Randoms
- Since:
- 3.5
- Version:
- 3.5
-
Method Summary
Modifier and TypeMethodDescriptionstatic BigInteger
nextBigInteger
(BigInteger min, BigInteger max, RandomGenerator random) Returns a pseudo-random, uniformly distributed int value between min and max (min and max included).static BigInteger
nextBigInteger
(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 givenrandom
engine of the maximal valuen
isnull
.
-
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
min
and less than or equal tomax
- Throws:
IllegalArgumentException
- ifmin >= max
NullPointerException
- if one of the given parameters arenull
.
-