question

tr-simulation avatar image
0 Likes"
tr-simulation asked Jonah K edited

Process time of an activity to a random number?

How do I set the process time of an activity to a random number within a certain range?

FlexSim 22.2.2
flexsim healthcare
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

1 Answer

Jonah K avatar image
0 Likes"
Jonah K answered Jonah K edited

Set the process time as a statistical distribution > uniform (or D uniform for discrete integers). It will populate with this code:

uniform(5.0, 15.0, getstream(current))

The first number is your min, the second number is your max.

· 5
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

tr-simulation avatar image tr-simulation commented ·
Thanks, so uniform is the same as random?
0 Likes 0 ·
Jonah K avatar image Jonah K ♦ tr-simulation commented ·

The randomness comes from the "getstream(current)" portion of the code. It will pick a random number between 5 and 15, and the uniform part means that there is no "preference" to pick a higher number in the range, lower number, etc. Out of a million samples, you will get a nearly uniform distribution of random values.

By default the model will repeat the same random stream each time you reset. If you want a new random stream each time you run the model, then you will want to go to Statistics > uncheck Repeat Random Streams.

0 Likes 0 ·
tr-simulation avatar image tr-simulation Jonah K ♦ commented ·
Thank you!
0 Likes 0 ·
Jacob W2 avatar image Jacob W2 ♦ tr-simulation commented ·
@tr_simulation,

Uniform means that within the given range, any value has an equal chance of being chosen. The random selection is handled by the stream that is currently being used by the model, and as such the numbers for any given stream will be randomly selected.

0 Likes 0 ·
tr-simulation avatar image tr-simulation Jacob W2 ♦ commented ·
Thank you!
0 Likes 0 ·