question

berkowicz-k avatar image
0 Likes"
berkowicz-k asked Felix Möhlmann answered

Assign Label Randomly from Table

Hello,

I have a table formatted like this:

Type Percentage Label
1 10 A
2 20 B
3 10 C
4 30 D
5 30 E


I would like to randomly assign a label value to a token according to this table. I know there is a function in an assign labels activity block to assign labels by percentage according to global table lookup, however, this table has a large number of rows and I rather not enter them all manually. I was hoping there would be a better way to do this.

Thank you in advance

FlexSim 21.0.10
global tablelabeltablesrandom numbers
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

Felix Möhlmann avatar image
0 Likes"
Felix Möhlmann answered

You can use dempirical(), though the percentages must be in column one for that command. If you want to assign multiple values from the same row, I would have the row number in the second column, so that the command determines the row number. Then use that to read and assign other values from the row.

5 |100000

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