Decide activity by percentage bug?

Decide activity by percentage bug?

david_besson
Not applicable
87 Views
5 Replies
Message 1 of 6

Decide activity by percentage bug?

david_besson
Not applicable

[ FlexSim 16.2.1 ]

Hello,

In process flow, I set a "Decide" activity to send tokens to downstream activites by percentage.

But it seems that the distribution is not working correctly. In the model attached for example, the tokens seems to be sent to the first connector 1 point more than the percentage specified.

Is it a bug?

Thanks!

q-pf-decide-by-percentage-bug.fsm3636-capture.png

0 Likes
Accepted solutions (1)
88 Views
5 Replies
Replies (5)
Message 2 of 6

joerg_vogel_HsH
Mentor
Mentor

If you look into the source code, you find that the distribution has a discrete result range [0..100]. That way is zero a possible result of the range and some items are going to the output port 1. To be exact 1/101 of all items will go to the output port number 1.

0 Likes
Message 3 of 6

david_besson
Not applicable

Is it not a little bit pernicious?

0 Likes
Message 4 of 6

joerg_vogel_HsH
Mentor
Mentor

Maybe, the hint should advise not to use 0 percent as a value.

0 Likes
Message 5 of 6

cameron_pluim
Not applicable

I think instead it should be:

double randomnum = uniform(0, 1, stream)*100;

This will allow the decimal percentages, while still giving a value between 0 and 100. Theoretically 0 is still a viable solution, but is much less likely in this scenario.

0 Likes
Message 6 of 6

philboboADSK
Autodesk
Autodesk
Accepted solution

Yes, this is a bug. I'll add a note to the development list.

For now, if you change line 8 to

double randomnum = uniform(0, 100, stream); 

then it will behave correctly.



Phil BoBo
Sr. Manager, Software Development