Class Randoms

java.lang.Object
io.jenetics.ext.internal.util.Randoms

public class Randoms extends Object
Since:
3.5
Version:
3.5
  • 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 given random engine of the maximal value n is null.
    • nextBigInteger

      public static BigInteger nextBigInteger(BigInteger min, BigInteger max, RandomGenerator random)
      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 to max
      Throws:
      IllegalArgumentException - if min >= max
      NullPointerException - if one of the given parameters are null.