question

Osama A6 avatar image
0 Likes"
Osama A6 asked Ben Wilson edited

duniform( ..) dempirical(..)

What is the difference between duniform( ..) and empirical(..)? can you provide an example?

FlexSim 21.2.1
duniform dempirical
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

Ben Wilson avatar image
0 Likes"
Ben Wilson answered Ben Wilson edited

duniform(min, max) will give you a random number from the min to the max, as if you had a (max-min+1)-sided die where each face had equal probability of being rolled. i.e, duniform(1,6) would act like a (6-1+1 =) 6 sided die with values from 1 to 6.

See the Alphabetical Command Reference (flexsim.com) entry for duniform.

==========

dempirical(table) - typically a reference to a global table is passed as the parameter. The global table has a column for percentages and a column for values. A random row of that table is found, according to the percentages specified, and the value on that row returned. The percentages and values on each row are completely user-defined (though the percentage column should add to 100 - see the linked documentation). You could create a global table with even percentages and sequential values, mimicking what you can do with the duniform() command, but you also have the freedom in the global table to specify varying percentages and values that are not strictly sequential.

The cempirical entry actually has a really good explanation with example tables. See also the dempirical command entry.

5 |100000

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