Pull based on upstream demand

Pull based on upstream demand

poopatel
Not applicable
874 Views
26 Replies
Message 1 of 27

Pull based on upstream demand

poopatel
Not applicable

[ FlexSim 23.2.3 ]

Hey, I am a bit new to flexsim and trying to figure out this example model for a bigger project - I have 3 Queues (SC1, SC2, SC3) which will pull item from PDC1 which will pull item from MainQueue. The pull condition variables are mentioned in a global table. Each part has a variable name CAC which is based on normal distribution (mean:225, sd:25). A part that is being pulled must be between specified min and max CAC value as per demand of upstream process. Would be great if somebody can help me code up the pull conditions or show me how can I proceed. Thanks!

example_model.fsm

0 Likes
Accepted solutions (1)
875 Views
26 Replies
Replies (26)
Message 2 of 27

moehlmann_fe
Advocate
Advocate
Accepted solution

You talk about how the queues should be pulling items, but in your model the queue have to accept whatever item the processors work on. It's the processors that have to make the decision what to pull.

In the attached model processor 1, 5, 6 and 7 read the allowed ranges from the global table in a query in their On Reset trigger. In the Pull Requirement they compare the item's CAC value to each range. If it falls into one of the ranges, the item is pulled.

There are two entries in the table for SC1, so I assumed that both of those are valid ranges for the CAC value.

pull-requirement-by-range-fm.fsm

0 Likes
Message 3 of 27

poopatel
Not applicable

So each entry in the table are individual orders. So will the solution still remain the same. Or would you like me include more orders and upload another file ?

0 Likes
Message 4 of 27

poopatel
Not applicable

I have also mentioned time in the global table. Processor 1 must start pull for that specified range or CAC values only on those specified time. Also the part once pulled must labeled to ensure that it end up in the SC mentioned during the initial pull. Also processor 2, 3, and 4 are still pulling parts which should not be the case, right?

Here is a new model with bigger table to avoid confusion.

pull-requirement-by-range_example.fsm

0 Likes
Message 5 of 27

moehlmann_fe
Advocate
Advocate

For timed pulling Process Flow is the much better choice.

process-flow-pull.fsm

0 Likes
Message 6 of 27

poopatel
Not applicable

This is great...thank you very much...pretty much what I wanted. Just a few questions regarding this - can i add like a source & queue from which the SC's will directly pull if there is a backorder i.e. an order cannot be fulfill because the items in the MainQueue does not satisfy the CAC range condition?

Also I know there is a way to automate the update of global tables so that I can connect it to an external excel and automate the entire process without making manual entries but can this be done to both the source in model and source in process flow that you have made?

0 Likes
Message 7 of 27

moehlmann_fe
Advocate
Advocate

You can set a maximum wait time on the Pull from List activity and create a fitting item in the Process Flow if none could be pulled.

And yes, you can import a table from excel directly into the source through the Excel interface. You just have to make sure that the format is exactly the same (Time, Name, Quantity, LabelColumns...).

To import it directly into the source, click on the green plus next to table data, choose "Browse" and navigate to the treenode that stores the table data of the source.

1707422873252.png

In the script console of the attached model you can find code that copies a global table into the source.

process-flow-pull_1.fsm

0 Likes
Message 8 of 27

poopatel
Not applicable
I see. and this will also track the time after the order was triggered or I will have to create a trigger for that?
0 Likes
Message 9 of 27

moehlmann_fe
Advocate
Advocate
I'm not 100% sure what time you what to track, but generally yes, you will have to build extra logic to do that.

The time items take between two objects in the model can be gathered in a "Composite Staytime" chart in a dashboard.

0 Likes
Message 10 of 27

poopatel
Not applicable
I am basically going to assign different processor process times and so on and I am also going to increase max content so processor can pull or process multiple items at a time. Thus I want to track time it takes for an order to travel to destination once it was triggered.
0 Likes
Message 11 of 27

poopatel
Not applicable
Why is your logic not extending to this model. Do I need to alter anything if I want to expand to include more SC which are connected to other PDCs? what are those alterations?

Also when I change create object source from Q1 to lets say Q5 the model stops following the logic. What I wanted was if the item with required CAC limits is not available then a new item should be created at Q5 and should directly get transferred to its destination. Can you please help me set this up?

0 Likes
Message 12 of 27

moehlmann_fe
Advocate
Advocate

The example I attached only covers the case of items that need to go through processor1 (since those are also the only destinations mentioned in the table).

You can use the "Object by Case" option in the "Move Object" and "Create Object" activities to send/create the item where it needs to go based on the assigned destination.

1707462074746.png

0 Likes
Message 13 of 27

poopatel
Not applicable

process_flow_expand.fsm

Can you take a look at this model. The logic is not working as you described. Just another question to go along with it - Can I alter my query to lets say I want to add multiple Max_CAC column such that the condition will be - compare CAC with min and Max_1 if not satisfied then compare it will min and Max_2 and so on. The reason being I want to fulfill order using parts I have in Main Queue rather than through new object. If you do try the logic you can assume Max2_CAC = Max1_CAC + 5, Max3_CAC = Max2_CAC + 5 and so on.

0 Likes
Message 14 of 27

moehlmann_fe
Advocate
Advocate

You have to create the new items "in" Queue5, otherwise they won't move to the processor.

1707504202423.png

You also have to properly set up the "Send to Port" option of Processor13 so the items end up at the correct queue ("Port by Case").

To allow a larger range, you can add a second Pull from List activity that gets used if the first one was unsuccesful. It omits the requirement that the CAC value must be smaller than the max and instead orders the difference between the two, pulling the item closest to the limit.

process-flow-expand_1.fsm

0 Likes
Message 15 of 27

poopatel
Not applicable

Hey originally what I want was to pull item closest to the limit but should be greater in value. Can I use the same logic in pull from list 1 as pull from list 2 ? That way I only need to describe min_CAC

0 Likes
Message 16 of 27

moehlmann_fe
Advocate
Advocate

Sure, you would just replace the Max label with the Min label in the query.

WHERE CAC >= puller.Min_CAC ORDER BY CAC - puller.Min_CAC ASC

This would pull the item whose CAC value is closest to the Min_CAC and larger than it at the same time.

0 Likes
Message 17 of 27

poopatel
Not applicable

Hey...I think the model is working great. Thanks for the help.

Sorry but I have more questions on this as I trying to improve this to make it more dynamic.

So, what if instead of global table I have a random weekly demand associated with each SC and the Source 1 produces some products each day. How can i model this?

Also a scenario where the Main Queue will send send products to Q1, Q2, Q3, and Q4 and then each SC will pull product from respective Queues they are associated with? Will have to create a process flow for each Q(i)?

0 Likes
Message 18 of 27

moehlmann_fe
Advocate
Advocate

You can use a DateTime Source to randomize more or less everything about the token creation in a single interfact. How many are created over the interval, their label values and how they are distributed over said interval.

capture1.png

You can do the same for item creation: Create a randomized amount of tokens each day and each token creates one (or more) item(s) ("Create Objects" activity).

You can use list partitions to control from which queue items are pulled. Each partition essentially acts as a "sub-list" that is independent from other partitions.

capture2.png

capture3.png

You just need a way to tell the tokens from which partition to pull. But if the origin queue is fixed per SC value, you can probably just assign it as a label in the source.

0 Likes
Message 19 of 27

poopatel
Not applicable

I think there is some misunderstanding: let me break it down

1) I want to replace Source1 with a weekly source with randomized CAC.

2) Instead of the global table, I want each SC to generate its own daily demand with randomized distribution of Min_CAC. (ideally I want a customer to come in demand a product (with equal or greater CAC) and they go away once it gets the product)

3) Now I have two scenario

a) SC will pull from MainQueue through their respective PDCs

b) Instead of SC pulling from MainQueue, I want the MainQueue to send it to PDC1, PDC2, PDC3, PDC4. Each PDCs will have their own list (can be a partition as you said) and SC will pull product from list from the closed PDC (min processing time) (same CAC conditions , equal or greater and min from list)

Can you help me build this ? I know it might be too much to ask but I am getting confused between what is token, item, and how to connect process flow to model.

process-flow-expand.fsm

0 Likes
Message 20 of 27

moehlmann_fe
Advocate
Advocate

1) & 2) As I said, you can do both with a DateTime Source in Process Flow.

3) The difference would only be which queues push the items to the list (MainQueue or PDCs) and whether that list is partitioned or not.

process-flow-expand_1.fsm

0 Likes