question

Ajay Bhesaniya avatar image
2 Likes"
Ajay Bhesaniya asked JUanGarcia commented

Pull Strategy for Sink using Global Table for Demand

I am new to Simulation Modeling using FlexSim and I am trying to build a simple model to assess the feasibility of creating a Pull Strategy referencing a Global Demand table.

I created a Global Demand table with the columns representing the number of items (4 in this e.g.) and the rows as time periods. Each row represents an hour and the table values represent the demand for each product, every hour. I have 4 Queues connected to the Sink and each Queue holds only one itemtype. I have set the Pull Strategy to "Using Global Lookup Table (Demand)" in the Flow tab of the Sink and tried running the model. The Sink pulls only Itemtype 1 form Queue1 and completely ignores the other queues. Also, the Sink pulls the entire quantity of itemtype 1 arriving at Queue 1 and does not reference the demand table for pulling.

I am sure there is additional logic required to execute the 'Pull Strategy at the Sink' successfully. Any guidance here will be highly appreciated.

FlexSim 16.0.1
global tablepull strategy
· 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.

Sam Stubbs avatar image
2 Likes"
Sam Stubbs answered Ben Wilson commented

Hey Ajay, so we took a look at it. This is what we came up with: First we introduced a Global Variable: "CurrentHour" to track which hour in the table the model was on. Then we created a Label Table on the Sink "Terminal" called ItemCounts that tracks how many of each item type the sink is receiving. We added a line of code to say that the sink will receive up to a certain amount of that item type within the set hour based on your table. Finally we created a global User Event "TrackCurrentHour" that increments the CurrentHour variable, and reopens the ports to receive the next amount on the table for the given hour. I'm including our modifications as a model attachment. I hope this has helped! demandtableexample.fsm


· 3
5 |100000

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

Helen avatar image
0 Likes"
Helen answered Sam Stubbs commented

Thank you for this thread, it's being really helpful. Nevertheless, I have additional questions on it @Sam Stubbs. In this code, you compare the parts that have been shipped (I guess that the value is reset every hour but don't see how) with the items that should be shipped hourly. The second part of the equation is clear, it seeks for row Current hour and column item type for the column in the table demand. But it's not clear for me what does the first part do.

gettablenum(label(current, "ItemCounts"),getitemtype(item),1) >= gettablenum("demand",CurrentHour,getitemtype(item))

Thanks a lot!

Helen


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