question

Cyrine S avatar image
0 Likes"
Cyrine S asked Pierre G commented

Conditional Batching

Hi all! I want to perform a batching for items before sending them to a queu. The batch size is variable ie items can not be sent to the queu unless a label called "lastone" is equal to 1.

exampe

Item 1 : "lastone=0" ==> wait

Item 2 : "lastone=1"==> send the batch (2 items) to the queu

Item 3 : "lastone=0"==>wait

Item 4 : "lastone=0"==>wait

Item 5 : "lastone=0"==>wait

Item 6 : "lastone=1"==>send the batch(4 items) to the queu

I attached a simple model for better understanding.

Thank you in advance for your help.conditionalbatching.fsm

FlexSim 18.0.10
batchconditional decide
5 |100000

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

Pierre G avatar image
1 Like"
Pierre G answered Pierre G commented

Hi,

You could use a ProcessFlow to do what you want.

First, in your Queue, you can choose the option Do Not Release Item. You will have to release your items manually if you want them to continue their way.

Second, to release your items at the good moment, you can use a ProcessFlow. The idea is to create a token when an item enter in your Queue, and to push this item in an Internal List. Then, if the label lastone is equal to 0, you can destroy your token ; if not, you can pull every item you will have on your List, and release them with the SubFlow "Release le lot".

If you have any questions, ask me.


a.png (14.9 KiB)
a.png (32.7 KiB)
· 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.

Joerg Vogel avatar image
1 Like"
Joerg Vogel answered

Try batching with a Max Wait Time a bit larger than 0 e.g. 0.00000001.

The Target Batch Size is large (10000).

You set OnEntry trigger to close the output. And you append in the same trigger to open the output by the condition

  1. item.lastone

That is equal to the comparision item.lastone == 1, because by evaluating the label the value is 1 and this equal to true. Because you set a wait time lasting a bit longer than 0 the output will be opened when the last of the item of a time stamp had already arrived.

This is in fact not a real batching because, you don't not know or set the exact batching size.

If you get errors, please build your model from the beginning. If there are still errors please report back again.

5 |100000

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