Can you please explain random number streams and how they are used in the software?

Can you please explain random number streams and how they are used in the software?

cliff_king
Not applicable
421 Views
6 Replies
Message 1 of 7

Can you please explain random number streams and how they are used in the software?

cliff_king
Not applicable
 
Accepted solutions (1)
422 Views
6 Replies
Replies (6)
Message 2 of 7

cliff_king
Not applicable
Accepted solution
Random numbers are needed during a simulation run to pull random samples from the various stochastic distributions (i.e. exponential, lognormal, erlang, etc.) used throughout the model to define process times, arrival rates and such. In our software, you can specify which stream of random numbers should be used to generate samples from the various distributions defined in your model. There are an unlimited number of streams available within the software, and you can specify a different stream ID for every distribution used in the model, if you want. The streams can be thought of as a list of pseudo-random numbers that are generated with what we call the "random number generator". The random number generator is a sophisticated algorithm that uses an initial "seed" value to generate a stream of pseudo-random numbers, one after the other, as needed, whenever a stochastic distribution is called during the simulation run. Each stream will generate a uniquely different set of numbers because each stream is initiated with a unique seed value.

There is a setting available under the "Statistics" menu that allows you to either "Repeat Random Numbers" or not. If the menu setting is checked, then each of the streams will be initiated with their default seed value and therefore generate the same stream of random numbers every time the model is ran. If the "Repeat Random Numbers" menu option is not checked, then a different seed value will be used to initiate each of the streams every time the model runs and therefore the stream of random numbers will be different; thereby generating different samples from the distributions referencing the streams, and therefore generating different model results for every run. There is no need to bother with this menu setting when using the Experimenter to run a model. During an experiment, the setting is ignored, and each stream is initiated with a predefined seed value that is unique to both the stream and the replication being run during the experiment. By using predefined seed values for each of the streams based on the replication number, we are able to 1) better compare results for a specific replication number a cross various scenarios defined in an experiment, and 2) manually rerun a specific replication of a specific scenario to further investigate something of interest discovered for a particular run of the experiment. In FlexSim HC, you can specify a specific scenario and replication number to run of your model using the "Explore" tab of the "Simulation Experiment Control" window, and in standard FlexSim you need to "Choose a default reset scenario" on the "Scenarios" tab and specify a replication number in the "Repeat Streams of Replication" field on the "Advanced" tab.

Message 3 of 7

normand_ct
Not applicable

@Cliff King, you mentioned: "There are an unlimited number of streams available within the software". Can you elaborate on the type of random number generator implemented in Flexsim (i.e MRG32, MT19937, WELL, etc.) and what is the period of the generator ?

Thanks

0 Likes
Message 4 of 7

philboboADSK
Autodesk
Autodesk

FlexSim uses a prime modulus multiplicative linear congruential generator.



Phil BoBo
Sr. Manager, Software Development
Message 5 of 7

sebastien_b49
Advocate
Advocate

@Cliff King. @Phil BoBo Thank you for this detailed explanation of the random stream. When we use a function without calling a specific stream, is the first stream simply called or is it random too ? Can we have repeatability by not explicitly defining a random stream ?


0 Likes
Message 6 of 7

philboboADSK
Autodesk
Autodesk

If you don't specify a stream, it uses stream 0. All distribution calls made without a specific stream specified will be using the same stream.



Phil BoBo
Sr. Manager, Software Development
0 Likes
Message 7 of 7

sebastien_b49
Advocate
Advocate

@Phil BoBo. Thank you for the fast response !

0 Likes