In addition to the thread of @David Besson Decide activity by percentage bug? how can we set a range of values without the limit values itself like ]0..100[ or 0 < x < 100 inside the parameters of a uniform distribution?
In addition to the thread of @David Besson Decide activity by percentage bug? how can we set a range of values without the limit values itself like ]0..100[ or 0 < x < 100 inside the parameters of a uniform distribution?
Although the uniform() command documentation claims to be inclusive, if you actually test it, it isn't. It might theoretically be inclusive, but there are theoretically an infinite number of values between any two decimal values so the probably of actually being the extremes is infinitesimally small (roughly 1 in 2^53 for a double-precision value) such that in actual practice, I don't think it ever returns the extremes.
So you can use use the uniform() distribution to get an exclusive distribution of floating point values, as the example code below shows:
int extremes = 0; for (int i = 1; i <= 10000000; i++) { double num = uniform(0,100); if (num == 0 || num == 100) { extremes++; // this code will never get hit } } return extremes; // this will always return 0
If you are using duniform(), then you can add 1 to the beginning or subtract 1 from the end to make it exclusive.
The random values uniform() gives back are unlikely to ever actually equal any specific value in the range, including the extremes, unless that value was explicitly obtained using that pseudo-random number generation and then repeated.
Jorge,
Have you tried using Global Macros as substitutes for the actual limit values themselves?
5 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