Random

Syntax

Random
Random(UpperBound)
Random(LowerBound, UpperBound)
Random(LowerBound, UpperBound, Seed)

Description

Returns a different random real number, between LowerBound and UpperBound, for each timestep.  If not specified, the lower and upper bounds default to 0 and 1.  The value is a real number--to get random integers, use the RandomInteger function.

The value returned is a random but repeatable value for any given branch, scenario, year and month.  This means that the numbers will be the same each time a scenario is calculated (for a given branch, year and timestep), but each scenario will have a different sequence.  If you want the same sequence for two or more branches or scenarios, you can use the optional "Seed" parameter. Using the same seed in two different functions will yield the same sequence.  Note: The seed value is not the first value in the sequence.

Examples

Random = some value between 0 and 1, e.g., 0.407
Random(100) = some value between 0 and 100, e.g., 83.12
Random(-10, 10) = some value between -10 and 10, e.g., -4.74
Random(0, 100, 5) = some value between 0 and 100 using a seed of 5, e.g., 15.7.  This will produce the same sequence regardless in which branch or scenario it is used.