wblut.math.WB_MTRandom.WB_MTRandom |
( |
| ) |
|
Constructor using the default seed.
wblut.math.WB_MTRandom.WB_MTRandom |
( |
final long |
seed | ) |
|
Constructor using a given seed. Though you pass this seed in as a long, it's best to make sure it's actually an integer.
- Parameters
-
Object wblut.math.WB_MTRandom.clone |
( |
| ) |
throws CloneNotSupportedException |
final boolean wblut.math.WB_MTRandom.nextBoolean |
( |
| ) |
|
Next boolean.
- Returns
- next random boolean
final boolean wblut.math.WB_MTRandom.nextBoolean |
( |
final float |
probability | ) |
|
This generates a coin flip with a probability probability
of returning true, else returning false. probability
must be between 0.0 and 1.0, inclusive. Not as precise a random real event as nextBoolean(double), but twice as fast. To explicitly use this, remember you may need to cast to float first.
- Parameters
-
probability | the probability |
- Returns
- next random coin flip
final boolean wblut.math.WB_MTRandom.nextBoolean |
( |
final double |
probability | ) |
|
This generates a coin flip with a probability probability
of returning true, else returning false. probability
must be between 0.0 and 1.0, inclusive.
- Parameters
-
probability | the probability |
- Returns
- next random coin flip
final byte wblut.math.WB_MTRandom.nextByte |
( |
| ) |
|
Next byte.
- Returns
- next random byte
final void wblut.math.WB_MTRandom.nextBytes |
( |
final byte[] |
bytes | ) |
|
Fill array of bytes with random values.
- Parameters
-
final double wblut.math.WB_MTRandom.nextCenteredDouble |
( |
| ) |
|
Returns a random double in the half-open range from [-0.5,0.5). Thus -0.5 is a valid result but 0.5 is not.
- Returns
- next random double in range [-0.5,0.51)
final float wblut.math.WB_MTRandom.nextCenteredFloat |
( |
| ) |
|
Returns a random float in the half-open range from [-0.5,0.5). Thus -0.5 is a valid result but 0.5 is not.
- Returns
- next random float in range [-0.5,0.5)
final char wblut.math.WB_MTRandom.nextChar |
( |
| ) |
|
Next char.
- Returns
- next random char
final double wblut.math.WB_MTRandom.nextDouble |
( |
| ) |
|
Returns a random double in the half-open range from [0.0,1.0). Thus 0.0 is a valid result but 1.0 is not.
- Returns
- next random double in range [0,1)
final float wblut.math.WB_MTRandom.nextFloat |
( |
| ) |
|
Returns a random float in the half-open range from [0.0f,1.0f). Thus 0.0f is a valid result but 1.0f is not.
- Returns
- next random float in range [0,1)
final double wblut.math.WB_MTRandom.nextGaussian |
( |
| ) |
|
Next gaussian.
- Returns
- the double
final int wblut.math.WB_MTRandom.nextInt |
( |
| ) |
|
Next int.
- Returns
- next random integer
final int wblut.math.WB_MTRandom.nextInt |
( |
final int |
n | ) |
|
Returns an integer drawn uniformly from 0 to n-1. Suffice it to say, n must be > 0, or an IllegalArgumentException is raised.
- Parameters
-
- Returns
- next random integer in range 0 to n-1.
final long wblut.math.WB_MTRandom.nextLong |
( |
| ) |
|
Next long.
- Returns
- next random long
final long wblut.math.WB_MTRandom.nextLong |
( |
final long |
n | ) |
|
Returns a long drawn uniformly from 0 to n-1. Suffice it to say, n must be > 0, or an IllegalArgumentException is raised.
- Parameters
-
- Returns
- next random long between 0 and n-1
final short wblut.math.WB_MTRandom.nextShort |
( |
| ) |
|
Next short.
- Returns
- next random short
void wblut.math.WB_MTRandom.readState |
( |
final DataInputStream |
stream | ) |
throws IOException |
Reads the entire state of the MersenneTwister RNG from the stream.
- Parameters
-
- Exceptions
-
IOException | Signals that an I/O exception has occurred. |
synchronized void wblut.math.WB_MTRandom.reset |
( |
| ) |
|
synchronized void wblut.math.WB_MTRandom.setSeed |
( |
final long |
seed | ) |
|
Initalize the pseudo random number generator. Don't pass in a long that's bigger than an int (Mersenne Twister only uses the first 32 bits for its seed).
- Parameters
-
boolean wblut.math.WB_MTRandom.stateEquals |
( |
final Object |
o | ) |
|
State equals.
- Parameters
-
- Returns
- true, if successful
void wblut.math.WB_MTRandom.writeState |
( |
final DataOutputStream |
stream | ) |
throws IOException |
Writes the entire state of the MersenneTwister RNG to the stream.
- Parameters
-
- Exceptions
-
IOException | Signals that an I/O exception has occurred. |
boolean wblut.math.WB_MTRandom.__haveNextNextGaussian |
|
private |
The __have next next gaussian.
double wblut.math.WB_MTRandom.__nextNextGaussian |
|
private |
The __next next gaussian.
final int wblut.math.WB_MTRandom.LOWER_MASK = 0x7fffffff |
|
staticprivate |
final int wblut.math.WB_MTRandom.M = 397 |
|
staticprivate |
int wblut.math.WB_MTRandom.mag01[] |
|
private |
final int wblut.math.WB_MTRandom.MATRIX_A = 0x9908b0df |
|
staticprivate |
int wblut.math.WB_MTRandom.mt[] |
|
private |
int wblut.math.WB_MTRandom.mti |
|
private |
final int wblut.math.WB_MTRandom.N = 624 |
|
staticprivate |
long wblut.math.WB_MTRandom.seed |
|
private |
final long wblut.math.WB_MTRandom.serialVersionUID = 3636987267914792302L |
|
staticprivate |
The Constant serialVersionUID.
final int wblut.math.WB_MTRandom.TEMPERING_MASK_B = 0x9d2c5680 |
|
staticprivate |
The Constant TEMPERING_MASK_B.
final int wblut.math.WB_MTRandom.TEMPERING_MASK_C = 0xefc60000 |
|
staticprivate |
The Constant TEMPERING_MASK_C.
final int wblut.math.WB_MTRandom.UPPER_MASK = 0x80000000 |
|
staticprivate |
The documentation for this class was generated from the following file: