Method | Description | |
---|---|---|
LinearCongruentialGenerator ( long seed ) : System |
Construct the default LCG. You need only specify a seed.
|
|
LinearCongruentialGenerator ( long modulus, long multiplier, long increment, long seed ) : System |
Create a LCG with the specified modulus, multiplier and increment. Unless you REALLY KNOW WHAT YOU ARE DOING, just use the constructor that just takes a seed. It will set these values to the same as set by the GCC C compiler. Setting these values wrong can create fairly useless random numbers.
|
|
NextDouble ( ) : double |
The next random number as a double between 0 and 1.
|
|
NextLong ( ) : long |
The next random number as a long between 0 and MAX_RAND.
|
|
Range ( double min, double max ) : double |
Generate a random number in the specified range.
|
public LinearCongruentialGenerator ( long seed ) : System | ||
seed | long | The seed. |
return | System |
public LinearCongruentialGenerator ( long modulus, long multiplier, long increment, long seed ) : System | ||
modulus | long | The modulus for the LCG algorithm. |
multiplier | long | The multiplier for the LCG algorithm. |
increment | long | The increment for the LCG algorithm. |
seed | long | The seed for the LCG algorithm. Using the same seed will give /// the same random number sequence each time, whether in Java or /// DotNet. |
return | System |
public Range ( double min, double max ) : double | ||
min | double | The minimum random number. |
max | double | The maximum random number. |
return | double |