Package org.apache.commons.math3.random
Class JDKRandomGenerator
java.lang.Object
java.util.Random
org.apache.commons.math3.random.JDKRandomGenerator
- All Implemented Interfaces:
Serializable,RandomGenerator
Extension of
java.util.Random to implement
RandomGenerator.- Since:
- 1.1
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCreate a new JDKRandomGenerator with a default seed.JDKRandomGenerator(int seed) Create a new JDKRandomGenerator with the given seed. -
Method Summary
Methods inherited from class java.util.Random
doubles, doubles, doubles, doubles, ints, ints, ints, ints, longs, longs, longs, longs, next, nextBoolean, nextBytes, nextDouble, nextFloat, nextGaussian, nextInt, nextInt, nextLong, setSeedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.commons.math3.random.RandomGenerator
nextBoolean, nextBytes, nextDouble, nextFloat, nextGaussian, nextInt, nextInt, nextLong, setSeed
-
Constructor Details
-
JDKRandomGenerator
public JDKRandomGenerator()Create a new JDKRandomGenerator with a default seed. -
JDKRandomGenerator
Create a new JDKRandomGenerator with the given seed.- Parameters:
seed- initial seed- Since:
- 3.6
-
-
Method Details
-
setSeed
Sets the seed of the underlying random number generator using anintseed.Sequences of values generated starting with the same seeds should be identical.
- Specified by:
setSeedin interfaceRandomGenerator- Parameters:
seed- the seed value
-
setSeed
Sets the seed of the underlying random number generator using anintarray seed.Sequences of values generated starting with the same seeds should be identical.
- Specified by:
setSeedin interfaceRandomGenerator- Parameters:
seed- the seed value
-