Method | Description | |
---|---|---|
MersenneTwister ( ) : System |
Creates a new pseudo-random number generator with a default seed.
|
|
MersenneTwister ( |
Creates a new pseudo-random number generator with a given seed.
|
|
Next ( ) : |
Returns the next pseudo-random Int32.
|
|
Next ( Int32 maxValue ) : Int32 |
Returns the next pseudo-random Int32 up to maxValue.
|
|
Next ( Int32 minValue, Int32 maxValue ) : Int32 |
Returns the next pseudo-random Int32 at least minValue and up to maxValue.
|
|
NextBytes ( Byte buffer ) : void |
Fills a buffer with pseudo-random bytes.
|
|
NextDouble ( ) : Double |
Returns the next pseudo-random Double value. There are two common ways to create a double floating point using MT19937: using GenerateUInt32 and dividing by 0xFFFFFFFF + 1, or else generating two double words and shifting the first by 26 bits and adding the second. In a newer measurement of the randomness of MT19937 published in the journal "Monte Carlo Methods and Applications, Vol. 12, No. 5-6, pp. 385 ñ 393 (2006)" entitled "A Repetition Test for Pseudo-Random Number Generators", it was found that the 32-bit version of generating a double fails at the 95% confidence level when measuring for expected repetitions of a particular number in a sequence of numbers generated by the algorithm. Due to this, the 53-bit method is implemented here and the 32-bit method of generating a double is not. If, for some reason, the 32-bit method is needed, it can be generated by the following: |
|
NextDouble ( Boolean includeOne ) : Double |
Returns a pseudo-random number greater than or equal to zero, and either strictly less than one, or less than or equal to one, depending on the value of the given parameter.
|
|
NextDoublePositive ( ) : Double |
Returns a pseudo-random number greater than 0.0 and less than 1.0.
|
|
NextSingle ( ) : Single |
Returns a pseudo-random number between 0.0 and 1.0.
|
|
NextSingle ( Boolean includeOne ) : Single |
Returns a pseudo-random number greater than or equal to zero, and either strictly less than one, or less than or equal to one, depending on the value of the given boolean parameter.
|
|
NextSinglePositive ( ) : Single |
Returns a pseudo-random number greater than 0.0 and less than 1.0.
|
|
NextUInt32 ( ) : UInt32 |
Returns the next pseudo-random UInt32.
|
|
NextUInt32 ( UInt32 maxValue ) : UInt32 |
Returns the next pseudo-random UInt32 up to maxValue.
|
|
NextUInt32 ( UInt32 minValue, UInt32 maxValue ) : UInt32 |
Returns the next pseudo-random UInt32 at least minValue and up to maxValue.
|
Method | Description | |
---|---|---|
GenerateUInt32 ( ) : |
Generates a new pseudo-random UInt32.
|
Method | Description | |
---|---|---|
compute53BitRandom ( Double translate, Double scale ) : Double | ||
init ( UInt32 seed ) : void | ||
temperingShiftL ( UInt32 y ) : UInt32 | ||
temperingShiftS ( UInt32 y ) : UInt32 | ||
temperingShiftT ( UInt32 y ) : UInt32 | ||
temperingShiftU ( UInt32 y ) : UInt32 |
public MersenneTwister ( |
||
seed | A value to use as a seed. | |
return | System |
public Next ( Int32 maxValue ) : Int32 | ||
maxValue | Int32 | The maximum value of the pseudo-random number to create. |
return | Int32 |
public Next ( Int32 minValue, Int32 maxValue ) : Int32 | ||
minValue | Int32 | The minimum value of the pseudo-random number to create. |
maxValue | Int32 | The maximum value of the pseudo-random number to create. |
return | Int32 |
public NextBytes ( Byte buffer ) : void | ||
buffer | Byte | The buffer to fill. |
return | void |
public NextDouble ( Boolean includeOne ) : Double | ||
includeOne | Boolean |
/// If |
return | Double |
public NextSingle ( Boolean includeOne ) : Single | ||
includeOne | Boolean |
/// If |
return | Single |
public NextUInt32 ( UInt32 maxValue ) : UInt32 | ||
maxValue | UInt32 | /// The maximum value of the pseudo-random number to create. /// |
return | UInt32 |
public NextUInt32 ( UInt32 minValue, UInt32 maxValue ) : UInt32 | ||
minValue | UInt32 | The minimum value of the pseudo-random number to create. |
maxValue | UInt32 | The maximum value of the pseudo-random number to create. |
return | UInt32 |