question

stefano L avatar image
1 Like"
stefano L asked tannerp commented

Change global table values depending on an average value

Hi,

How can I store the Capacity label value of items leaving the warehouse to be able to calculate the average? Afterwards I need to see this average and, if it is too high (close to 90%) or too low (close to 60%), change all the values of the global table ValueTable setting them all to 100 or 50 respectively. The Capacity label of items in the warehouse are updated every 10 seconds through the custom code "Capacity Update" in the process flow.

Model attached here:

mean-model.fsm

Thanks.

FlexSim 19.0.0
FlexSim 19.0.3
global tablelabelswarehouseitemsaverage
mean-model.fsm (52.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.

1 Answer

·
tannerp avatar image
1 Like"
tannerp answered tannerp commented

Hi @stefano L,

I'm not sure if this is what you're looking for, but I added a couple lines of code in your Capacity Update activity that check if the capacity is below 60 or above 90. If so, they will set all the values in the table to 50 or 100.

mean-model-updated.fsm


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

stefano L avatar image stefano L commented ·

Thanks @tanner.p but actually, I was looking for a way to store the capacity values of the items Exiting the warehouse and then average these values. The result of the average allows to decide whether to modify the global table or not.

0 Likes 0 ·
tannerp avatar image tannerp stefano L commented ·

That makes sense. I'm not sure how frequently you'll be evaluating the average capacity, but you should be able to do the same thing. The only difference would be that instead of updating values in a Global Table immediately, you can write the capacity values to Global Variables or perhaps another table and then average those based on a trigger whenever you're ready to evaluate.

1 Like 1 ·

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.