question

David Besson avatar image
0 Likes"
David Besson asked Joerg Vogel edited

Decide activity by percentage bug?

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.fsm

FlexSim 16.2.1
process flowbug
· 4
5 |100000

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

Joerg Vogel avatar image Joerg Vogel commented ·

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 0 ·
David Besson avatar image David Besson Joerg Vogel commented ·

Is it not a little bit pernicious?

0 Likes 0 ·
Joerg Vogel avatar image Joerg Vogel David Besson commented ·

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

0 Likes 0 ·
Show more comments

1 Answer

·
Phil BoBo avatar image
2 Likes"
Phil BoBo answered

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.

5 |100000

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

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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