Pull Strategy for Sink using Global Table for Demand

Pull Strategy for Sink using Global Table for Demand

ajay_bhesaniya
Not applicable
34 Views
11 Replies
Message 1 of 12

Pull Strategy for Sink using Global Table for Demand

ajay_bhesaniya
Not applicable

[ FlexSim 16.0.1 ]

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.

Accepted solutions (1)
35 Views
11 Replies
Replies (11)
Message 2 of 12

sam_stubbsYXX86
Community Manager
Community Manager

Ajay, could you post a sample model for us to look at?

Message 3 of 12

ajay_bhesaniya
Not applicable

extrastorage.fsm

Hi Sam,

I have attached the Sample Model. Thanks for offering to review it.

I am eager to get your feedback.

Message 4 of 12

sam_stubbsYXX86
Community Manager
Community Manager
Accepted solution

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

Message 5 of 12

ajay_bhesaniya
Not applicable

Sam, I am amazed to have this level of support. I had spent several days trying to implement this strategy and I am glad I reached out to you guys.

I spent some time running the model and had few follow-up questions;

1. After running the model, I saw the "ItemCounts" label not incrementing in value but stays at 0.00.Is there a way to build separate labels for each "itemtype" and thus get a count of each? which I can use to verify if the sink is pulling based on the demand table.

2. I see the model keeps running indefinitely (I had to stop it at 5000 time units). One of my goals was to setup the Sink to Pull based on the demand table and then Stop (24 time units in this example since the demand table has 24 rows). Beyond that, the Queues start filling until they are maxed out and then the Source gets blocked. What additional logic needs to be added to make this happen?

3. Also, is there a way to read the demand table values as daily or weekly demand instead of hourly?

Thus, the source continues to produce at hourly rates and the Sink consumes on a daily rate or weekly rate?

4. The End goal of this modeling effort is to find the Optimal Queue capacity for each product that would satisfy a rate of demand fed through the demand table. Is there a way to quickly get to that number?

I could not contain my excitement after I got your last response and I hope I am not overwhelming you with this additional questions.I have spent a lot of time going through the video tutorials and reading the Applied Simulation Text but have not yet found complete answers for my questions.

Thanks in advance!

0 Likes
Message 6 of 12

sam_stubbsYXX86
Community Manager
Community Manager

Hello Ajay, just as a heads up, as we are using this new answers forum format, we are trying to keep each question isolated to its own post on the board. So I've broken up these four questions into posts on the board as a whole for the community and especially support to all look at and help with. (As a reference you can go here to see "Best Practices" for using this forum.)

Question 1 is posted here. Question 2 is posted here. Question 3 is posted here. And Question 4 is posted here.

Thank you for your questions. I posted an answer to some of the questions already, let us know if you still need help.

0 Likes
Message 7 of 12

ajay_bhesaniya
Not applicable

Sam, Thanks a lot. I will check the Best Practices section for future queries.

0 Likes
Message 8 of 12

myriam_srdg
Not applicable

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


0 Likes
Message 9 of 12

moehlmann_fe
Observer
Observer

The sink possesses a label called "ItemCounts". This label contains a table that tracks how many items of each type the sink has received by incrementing the respective value whenever an item enters the sink (first function in the On Entry trigger).
The first part of the condition reads the value for the current item's type from that table label which then gets compared to the target value from the global table.

You can see the table view of the label by rightclicking on it and choosing "Explore -> As Table".

1673852924025.png

1673852932955.png

The reset of the values happens in the User Event "Track Current Hour".

1673853013532.png

Message 10 of 12

myriam_srdg
Not applicable

Thank you @Felix Möhlmann

0 Likes
Message 11 of 12

Juan13
Not applicable

In our model the ItemCounts doesn´t counts. For that reason in the second 0 the sink takes all at once.

0 Likes
Message 12 of 12

Juan13
Not applicable
0 Likes