|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ProGAL.math.Randomization
public class Randomization
A wrapper for static randomization functions.
Constructor Summary | |
---|---|
Randomization()
|
Method Summary | |
---|---|
static java.util.Random |
getGenerator()
|
static double |
randBetween(double d1,
double d2)
Return a uniform random double between (including) d1 and (not including) d2 |
static int |
randBetween(int i1,
int i2)
Return a uniform random number between (including) i1 and (not including) i2. |
static void |
randomizeInPlace(int[] as)
Randomize an array. |
static int[] |
randomPermutation(int max)
Generate a random permutation of integers between (including) 0 and (not including) max |
static void |
seed(long s)
Seeds the random generater used by this class. |
static java.lang.Object[] |
shuffle(java.lang.Object[] arr)
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Randomization()
Method Detail |
---|
public static java.util.Random getGenerator()
public static int randBetween(int i1, int i2)
i1
- lower bound of random numberi2
- upper bound of random numberpublic static double randBetween(double d1, double d2)
d1
- lower bound of random numberd2
- upper bound of random numberpublic static int[] randomPermutation(int max)
max
- the length of the permutationpublic static void randomizeInPlace(int[] as)
as
- the array to be randomizedpublic static void seed(long s)
s
- seedpublic static java.lang.Object[] shuffle(java.lang.Object[] arr)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |