question

Harish G avatar image
0 Likes"
Harish G asked Jason Lightfoot commented

Minimum inventory required to make a full batch

Hello,



This is what I am trying to achieve:

I wanted to see how much is the minimum inventory I need to start with in the stacker to get a full lot of 24 on the Pallets before the sink, as I would want to avoid partial lots. For that I used the batch function to group the tokens, where I am plugging different numbers to get to that 24 full batch and pushing it to the list. But, it groups the tokens into the same 22 batch quantity and pushes to the list, whereas the full lot size needed is 24. Which means its borrowing from the next group to fill that space of 2 totes causing partial lots at some point. How do I get around this, as I don't want any partial lots at the pallets at all?


As you can see in the below example: A batch size of 22 on the Stacker can get us to full lot of 24, but in the next run it creates partial batch. Please see attached the model.


Thanks for your kind help!

flexsim-new Model_3.28 - Copy (2).fsm


@Ryan Clark @Felix Möhlmann


1650471212605.png

1650471261286.png

FlexSim 22.1.0
simulation
· 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.

Harish G avatar image Harish G commented ·

Adding to the above question:


One of the things I feel could really be helpful is is there a way to add some kind of decider to say when its going to pull the same type it should look to see if there is at least 'x' number of cured totes available in the Stacker (X is the number of totes which will give us the full batch on the pallets). If not, again do the same kind of logic before Pull any. If none is available anywhere then, proceed with the same set of steps from there below. Is there any easy way to do that? That I believe will help me solve this issue.


Thanks for your help!

1650491842997.png


0 Likes 0 ·
1650491895903.png (44.5 KiB)
Jason Lightfoot avatar image Jason Lightfoot ♦♦ commented ·

Hi @Harish G, was one of Harish G's or Felix Möhlmann's answers helpful? If so, please click the "Accept" button at the bottom of the one that best answers your question. Or if you still have questions, add a comment and we'll continue the conversation.

If we haven't heard back from you within 3 business days we'll auto-accept an answer, but you can always unaccept and comment back to reopen your question.

0 Likes 0 ·

1 Answer

Felix Möhlmann avatar image
0 Likes"
Felix Möhlmann answered Felix Möhlmann commented

My assumption is that you choose the batch size in the process flow differently to the batch size of the queue, so that the process can start before all 24 items have cured.

In that case your desired logic would be something like:

Wait until there are at least N cured items of a given type and at least 24 (cured + uncured) in the stacker. Then start the process. Afterwards check again for the same type, then for any type. If no eligible types are found, wait until the rack is full and the condition is fulfilled again. Is this correct?

In this case it would, in my opinion, make more sense to push the individual items to a list, instead of whole batches, while also keeping track of the total number of items of each type in the stacker as well as how many of them are cured. In the attached model I do this in array labels on the stacker which get updated in the On Entry, On End Dwell Time and On Exit trigger.

These labels are also read by dynamic expressions fields of the item list, so each entry has a reference to the total number of (cured) items of that type. This can then be used in the pull query to only pull the first item when there is enough stock in the stacker to produce a full batch.

1650526619281.png

The pull activities of the main leave the entry on the list and only serve the purpose to determine the next product type. The individual items are then pulled in the sub flow.

1650526676653.png

flexsim-new-model-328-fm2.fsm


· 5
5 |100000

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

Harish G avatar image Harish G commented ·

Thanks, @Felix Möhlmann. That works close to what I was looking for.


I was trying trial and error for multiple total cured qty combinations to identify where its producing partial lots. When I found a condition where it does that and ran the model, instead of producing partial and moving to the next type, it just waits idle and continues with the lot once it becomes available. Whereas in the previous model it was working fine like I wanted to stop with the partial lot & move to the next one/start filling the rack again depending upon the condition if you look at the initial graph.


Also, I would like to understand & learn a bit more about the Array labels, list properties that you utilized. Is there any good resource that I can refer to for understanding this? Even if you could give a quick snapshot regarding the concept, that would be useful too :-)

1650559000101.png

1650559019763.png

0 Likes 0 ·
Harish G avatar image Harish G commented ·

Also, when I change the max content in the pallet to above 24, like 26, it creates this unusual graph.

1650570729920.png

0 Likes 0 ·
1650570729920.png (210.3 KiB)
Felix Möhlmann avatar image Felix Möhlmann Harish G commented ·

It seems I misunderstood your previous post and thought you wanted to eliminate the possibility of partial batches.

To allow them again, simply have the tokens that try to pull cured items skip to the finish of the sub flow instead of waiting until one can be pulled. Also, re-add the "Release Items" activity that sends a message to the queue, telling it to release all currently held items.

1650611062084.png

The target quantity is determined by how often the subflow is run. The queue capacity has to higher than that number, but has no bearing on the model logic otherwise. That's why are seeing the pattern in your screenshot; you are still only pulling in batches of 24.

In the attached model, batches of 26 are supposed to go to the queues, starting when there are at least 18 items of type in the stacker of which at least 12 are cured.

flexsim-new-model-328-fm3.fsm

About array labels:

Arrays are a general programming concept. You can think of them as indexed lists where array[N] accesses the Nth entry of the array. An array label is simply a label that holds an array of values instead of a single one. In this case, I use them because it makes storing values for each product type quite easy. When an object enters/exits the rack of cures, I can increment/decrement the respective array entry by using the product type as index, pointing to the right value.

https://docs.flexsim.com/en/22.1/Reference/CodingInFlexSim/FlexScriptAPIReference/Data/Array.html

About lists:

There are some pages in the manual that deal with lists, I think they would be a good starting point to learn, if you haven't read them already.

https://docs.flexsim.com/en/22.1/ConnectingFlows/Lists/KeyConceptsLists/KeyConceptsLists.html

Some short insight on the expression fields used:
You can think of fields as table columns that hold additional information about the value on the list. Apart from simply copying the values labels, these can also be custom expressions that draw data from other points in the model or do calculations.

When writing an expression you have access to some pre-defined parameters, which you can see when you open the code editor if the field.

1650610273584.png

The "value" is a reference to whatever was pushed to the list and the "pushTime" the model time at which it was added to the list. "puller" is a reference to the object that is trying to pull something from the list. It is only available when you mark the field as "Dynamic", meaning it gets re-evaluated every time the value of the field is read (so either when actively viewing the list entries or when something is pulling from the list).

In the model I use one field to calculate whether is item is cured or not. (Alternatively, you could also set a label once it is cured and simply add that as field. It would have to dynamic as well though, so it is updated when the label value changes).

1650610895174.png

In two other fields I read the current value of the "Qty" and "Cured" array labels on the rack. As mentioned above "value" is a reference to the object that was pushed to the list - the item. So "value.Product" is as the array index, to look up the value pertaining to the item's type.

1650610885230.png

I hope this is helpful to you.

0 Likes 0 ·
Harish G avatar image Harish G Felix Möhlmann commented ·
Thank you so much for the detailed explanation, @Felix Möhlmann! That surely helps :-)


Also, the reason I went for 26 & not 24 is considering scrap from the input into the processor A3. Meaning if we input 26 totes into the A3, @ 5% scrap it would come out as only 24.7 totes. Is there a way to add the scrap percentage into the model?

0 Likes 0 ·
Show more comments