question

MSL1911 avatar image
0 Likes"
MSL1911 asked Jason Lightfoot answered

How to assign a label (Type) for the items based on a global table

Hello, I'm trying to assign 4 labels(types) of parts depending of a percentage located in a global table. I'm doing it using an empirical distribution in an exit trigger of the shipment but it doesn't work. Could you help me with this?

autoquestmodel1.fsm

FlexSim 23.2.3
global tabledempiricaltriggers creation
autoquestmodel1.fsm (37.4 KiB)
5 |100000

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

Jason Lightfoot avatar image
0 Likes"
Jason Lightfoot answered

Your label's value expression to read the global table should be something like this:

Table("GlobalTable1")[Empirical("Percentage").get(getstream(current))][3]

And your Percentage table should be formatted with the columns switched so that the Data column contains the row value.

1705085450637.png



1705085450637.png (3.1 KiB)
5 |100000

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

Julio R avatar image
0 Likes"
Julio R answered Jason Lightfoot converted comment to answer

When using the Empirical command, you need to reference an empirical distribution, in your case you could use Empirical("Percentage").get(getstream(current)) in your trigger to use the empirical distribution "Percentage" that you have.

5 |100000

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