question

ginolagomarsino avatar image
0 Likes"
ginolagomarsino asked Jeanette F commented

How to label by porcentage for some item depending of the value of Type

i need to label by porcentage item that passing through a Processor element, i need to label randonly the 50% of them with a 8 and the other 50% with a 9, but i only need to label the items wich item.Type = 1, the others just pass. this is like using a IF.

anyone can help me?

FlexSim 22.2.4
labelselectionobjetc
· 1
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 ·
50% probability or 50% ratio? A statistical distribution fulfill a probability to be act like ratio upon 1.000.000 events. A fixed ratio depends on an interval update.
0 Likes 0 ·

1 Answer

·
Jason Lightfoot avatar image
0 Likes"
Jason Lightfoot answered Jeanette F commented
if (item.Type==1)
     item.subType=bernoulli(50,8,9);
· 2
5 |100000

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

ginolagomarsino avatar image ginolagomarsino commented ·

Thank you Jason,, Do you know any other way to do that without code?

I need a processor to somehow relabel some elements that pass, but only to those that have value item:Type=1 and assign them a random value of 8 or 9 and do nothing to the rest

0 Likes 0 ·
Jeanette F avatar image Jeanette F ♦♦ ginolagomarsino commented ·

Hello @GinoLagomarsino,

You will need to use code. I do not believe we have a picklist option for this. You can place the code in a trigger on the processor. You can select code snippet from the picklist options.

1670562938227.png

0 Likes 0 ·
1670562938227.png (7.8 KiB)

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.