![]() |
Murl Engine Lua Addon API
Version 1.0 beta
|
The random number generator base class.
The base class is abstract and is implemented by the TT800, Well1024 and Marsaglia class.
Get a random Bool value.
Boolean RandBool()
Get a random UInt32 value within a specified range. It is supported to pass a range of from > to.
Integer RandUInt(Integer from, Integer to)
from | The start of the range. |
to | The end of the range. |
Get a random SInt32 value within a specified range. It is supported to pass a range of from > to.
Integer RandSInt(Integer from, Integer to)
from | The start of the range. |
to | The end of the range. |
Get a random Real value within a specified range. Scales (from - to) within a 32 bit random number. It is supported to pass a range of from > to.
Number RandReal(Number from, Number to)
from | The start of the range. |
to | The end of the range. |
Get a random Double value within a specified range. Scales (from - to) within a 64 bit random number. It is supported to pass a range of from > to.
Number RandDouble(Number from, Number to)
from | The start of the range. |
to | The end of the range. |
Draw an index from a distribution array. The distribution array contains numbers which are defining the probability of the partition. The higher the value of the partition, the higher is the probability of drawing the partition.
Integer Draw(Murl.Array.UInt32 distribution)
distribution | An array of partitions. |
Draw an index from a distribution array with no replacement. Draw() and set the drawn partition to zero.
Integer, Murl.Array.UInt32 DrawNoReplacement(Murl.Array.UInt32 distribution)
distribution | An array of partitions. |
Draw an index from a distribution array with no replacement. Draw() and decrement the drawn partition by a specified value.
Integer, Murl.Array.UInt32 DrawNoReplacement(Murl.Array.UInt32 distribution, Integer decrement)
distribution | An array of partitions. |
decrement | The value to decrement the drawn partition. The drawn partition is set to zero if the decrement underflows the partition. |