The primitives Random* found in the Number Generators library replaces the wide range of primitives that were previously available and have been moved to Compatibility→NumberGenerators. Every time the primitive is executed it generates a value that is a random deviate drawn from the distribution selected by parameter Distribution.
The following distributions are available (along with their parameters):
A separate seed value can be defined for each instance of the primitive which determines whether a local seed is used, a generated seed is used or the global seed is used.
The usage of the seed value is as follows:
The following code must be used (duplicated code indicates that it can be used in either the setup or the go method):
hinclude { <Rng/Normal.h> }
protected
{
Rng::Normal mRandom;
}
setup
{
mRandom.setMean(MeanValue);
mRandom.setVariance(VarianceValue);
mRandom.setSeed(SeedValue);
}
go
{
mRandom.setMean(MeanValue);
mRandom.setVariance(VarianceValue);
mRandom.setSeed(SeedValue);
Output%0 << mRandom();
}