Skip to content

Implement RANDOM_UNIFORM function #385

@travisfranck

Description

@travisfranck

Vensim's RANDOM_UNIFORM (along with other RANDOM_XYZ functions) have not been implemented yet. SDE should support the most used functions, like RANDOM_UNIFORM, RANDOM_POISSON, and RANDOM_NORMAL. Because they all require a random number generator, the suggestion is to focus on one, RANDOM_UNIFORM, to implement the foundation.

Vensim's RANDOM documentation, including the algorithm choice, is documented here:
https://www.vensim.com/documentation/noise_rng.html

A link to some code for the algorithm is here:
https://github.com/MersenneTwister-Lab/SFMT

I asked Vensim forums about tips and pitfalls. TomF provided a good reply on this thread here
https://www.ventanasystems.co.uk/forum/viewtopic.php?p=32192

The highlight of the thread is that:

Equation sorting is deterministic in Vensim, but I'm not sure we could readily tell you exactly what the rules are.
Another source of variation is likely to be calls during initialization - anything that causes one more or one less will break symmetry.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions