|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.Random
org.mymedialite.util.Random
public class Random
Draws random values from a normal distributed using a simple rejection method.
Constructor Summary | |
---|---|
Random()
Default constructor |
|
Random(long seed)
Creates a Random object initialized with a seed. |
Method Summary | |
---|---|
static Random |
getInstance()
Gets the instance. |
static void |
initInstance(long seed)
Initializes the instance with a given random seed. |
double |
nextExp(double lambda)
Get the next exp. |
int |
nextInt(int min,
int max)
Get a random number within a specified range. |
double |
nextNormal()
Get the next number from the standard normal distribution. |
double |
nextNormal(double mean,
double stdev)
Draw the next number from a normal distribution. |
Methods inherited from class java.util.Random |
---|
next, nextBoolean, nextBytes, nextDouble, nextFloat, nextGaussian, nextInt, nextInt, nextLong, setSeed |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Random()
public Random(long seed)
seed
- an integer for initializing the random number generatorMethod Detail |
---|
public static void initInstance(long seed)
seed
- a seed valuepublic static Random getInstance()
public int nextInt(int min, int max)
min
- the minimum of the rangemax
- the maximum of the range
public double nextExp(double lambda)
lambda
- public double nextNormal()
public double nextNormal(double mean, double stdev)
mean
- mean of the Gaussianstdev
- standard deviation of the Gaussian
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |