public class Random
extends java.lang.Object
Constructor and Description |
---|
Random() |
Modifier and Type | Method and Description |
---|---|
static boolean |
nextBoolean() |
static double |
nextDouble()
Returns the next pseudorandom, uniformly distributed
double value between 0.0 and 1.0 . |
static double |
nextDouble(double min,
double max)
Generates a pseudo-random number between two given values.
|
static boolean |
nextGamble(int options)
Returns true with a chance of
1 / options . |
static double |
nextGaussian()
Returns the next pseudorandom, Gaussian ("normally") distributed
double value with mean 0.0 and standard deviation 1.0 . |
static double |
nextGaussian(double min,
double max,
double sd)
Generates a pseudo-random number between the two given values with standard deviation.
|
static double |
nextGaussian(double min,
double max,
double mean,
double sd)
Generates a pseudo-random number between the two given values with standard deviation about a provided mean.
|
static int |
nextGaussian(int min,
int max,
int sd)
Generates a pseudo-random number between the two given values with standard deviation.
|
static int |
nextGaussian(int min,
int max,
int mean,
int sd)
Generates a pseudo-random number between the two given values with standard deviation about a provided mean.
|
static int |
nextInt(int min,
int max)
Returns a pseudorandom, uniformly distributed
int value
between min (inclusive) and max (exclusive), drawn from
this random number generator's sequence. |
static java.awt.Point |
nextPoint(java.awt.Shape area)
Generates a pseudo-random point within the given shape.
|
public static boolean nextBoolean()
public static int nextInt(int min, int max)
int
value
between min (inclusive) and max (exclusive), drawn from
this random number generator's sequence.min
- lower bound (inclusive)max
- upper bound (exclusive)int
value between min (inclusive) and max (exclusive) from this random number generator's sequencepublic static boolean nextGamble(int options)
1 / options
.options
- Amount of options to gamble with.nextInt(0, options)
equals 0public static double nextDouble(double min, double max)
min
- The minimum value (inclusive).max
- The maximum value (exclusive).public static double nextDouble()
double
value between 0.0
and 1.0
.Random.nextDouble()
public static double nextGaussian()
double
value with mean 0.0
and standard deviation 1.0
.Random.nextGaussian()
public static int nextGaussian(int min, int max, int sd)
min
- The minimum value (inclusive).max
- The maximum value (exclusive).sd
- Standard deviation.public static double nextGaussian(double min, double max, double sd)
min
- The minimum value (inclusive).max
- The maximum value (exclusive).sd
- Standard deviation.public static int nextGaussian(int min, int max, int mean, int sd)
min
- The minimum value (inclusive).max
- The maximum value (exclusive).mean
- The mean (>= min and < max).sd
- Standard deviation.public static double nextGaussian(double min, double max, double mean, double sd)
min
- The minimum value (inclusive).max
- The maximum value (exclusive).mean
- The mean (>= min and < max).sd
- Standard deviation.public static java.awt.Point nextPoint(java.awt.Shape area)
area
- the shape