World Random |
Exposes random number generator functionality.
The Random object initializes the pseudo random number generator and returns pseudo random numbers from a variety of random number distribution types.
Set the Seed property of the Random object at the beginning of a simulation if repeatability of simulation results is desired.
The Real method is the default method for the Random object.
The following example sets the pseudo random number generator seed and then assigns the speed of each Bot object to a random whole number between 0 and 5.
World.Random.Seed = 117
For Each Bot in Bots
Bot.Speed = World.Random.Whole (0, 5)
Next Bot