Package edu.wisc.game.util
Class RandomRG
java.lang.Object
java.util.Random
edu.wisc.game.util.RandomRG
- All Implemented Interfaces:
- Serializable,- java.util.random.RandomGenerator
- See Also:
- 
Nested Class SummaryNested classes/interfaces inherited from interface java.util.random.RandomGeneratorjava.util.random.RandomGenerator.ArbitrarilyJumpableGenerator, java.util.random.RandomGenerator.JumpableGenerator, java.util.random.RandomGenerator.LeapableGenerator, java.util.random.RandomGenerator.SplittableGenerator, java.util.random.RandomGenerator.StreamableGenerator
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionbooleangetBoolean(double p) <T extends Enum<T>>
 TGet a random value of a specified enum classintgetExp(int M, double L) doublegetExpDouble(double M, double L) Returns an exponentially distributed random real number in the range [0, M], with the probability density dropping by e at L.intgetInRange(int[] z) intgetInRange(int min, int max) Generates a random integer number x, uniformly distributed among the (max-min+1) values: min ≤ x ≤ max.randomSubsetOrdered(int n, int m) randomSubsetPermuted(int n, int m) A random subset of m numbers out of [0:n-1], in random orderMethods inherited from class java.util.Randomdoubles, doubles, doubles, doubles, from, ints, ints, ints, ints, longs, longs, longs, longs, next, nextBoolean, nextBytes, nextDouble, nextFloat, nextGaussian, nextInt, nextInt, nextLong, setSeedMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.random.RandomGeneratorisDeprecated, nextDouble, nextDouble, nextExponential, nextFloat, nextFloat, nextGaussian, nextInt, nextLong, nextLong
- 
Constructor Details- 
RandomRGpublic RandomRG()
- 
RandomRGpublic RandomRG(long seed) 
 
- 
- 
Method Details- 
getBooleanpublic boolean getBoolean(double p) - Parameters:
- p- The probability of the return value being true
- Returns:
- a random boolean number.
 
- 
getInRangepublic int getInRange(int min, int max) Generates a random integer number x, uniformly distributed among the (max-min+1) values: min ≤ x ≤ max.
- 
getInRangepublic int getInRange(int[] z) 
- 
randomSubsetPermutedA random subset of m numbers out of [0:n-1], in random order
- 
randomSubsetOrdered
- 
getExpDoublepublic double getExpDouble(double M, double L) Returns an exponentially distributed random real number in the range [0, M], with the probability density dropping by e at L.
- 
getExppublic int getExp(int M, double L) 
- 
getEnumGet a random value of a specified enum class
 
-