How do I set the process time of an activity to a random number within a certain range?
How do I set the process time of an activity to a random number within a certain range?
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.
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.
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.
13 People are following this question.
FlexSim can help you understand and improve any system or process. Transform your existing data into accurate predictions.
FlexSim is a fully 3D simulation software environment. FlexSim can be used to simulate any process in any industry.
FlexSim®, FlexSim Healthcare™, Problem Solved.®, the FlexSim logo, the FlexSim X-mark, and the FlexSim Healthcare logo with stylized Caduceus mark are trademarks of FlexSim Software Products, Inc. All rights reserved.
Privacy | Do not sell or share my personal information | Cookie preferences | Report noncompliance | Terms of use | Legal | © Autodesk Inc. All rights reserved