question

Arvind J avatar image
0 Likes"
Arvind J asked Felix Möhlmann answered

Set Logic At Queue - Batching

1658107852783.png

Hi All,

Please advice on the box that out from Processor 1.

After the box out from Processor1, it should batch until 8 boxes at queue1 then only can send to processor 2.

The batching logic should follow as below

8,10,8,10,8,10

For the first time it should batch 8 boxes, then followed by 10 boxes and the cycle repeated again.


batching.fsm

FlexSim 21.0.10
processorsqueue logicorder batchingbatching groupingqueue items
1658107852783.png (76.1 KiB)
batching.fsm (27.1 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.

David Seo avatar image David Seo commented ·

You can solve your issue using 'Perform Batching' field in Queue. Or You can use 'Combine' object. And then if you have some more issue, upload it again.

0 Likes 0 ·
Arvind J avatar image Arvind J David Seo commented ·

Hi David Seo,


I have tried "perform batching".

1658125263051.png

After 10 boxes arrive At Queue1, it should send to processor 2.

After 8 boxes arrive At Queue4, it should send to processor 2.


All this 18 boxes are same SKU. In the above diagram you can see there's still red boxes in Queue1, but green boxes already start to produce at processor2.

batching.fsm

0 Likes 0 ·
1658125263051.png (89.1 KiB)
batching.fsm (33.1 KiB)

1 Answer

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

In addition to what David Seo wrote in his comment: You can use triggers on the queue to update the batch size property of the queue.

If 'Flush contents between batches' is active, you can use the option 'Update Queue's Batch Size' in the entry trigger and set it to switch between 8 and 10.

1658125245633.png

1658125295487.png

This line checks whether the batch size is currently set to 8. If so, it returns 10, otherwise 8.

batching-fm.fsm

The option above sets the batch size when the first item enters the queue (queues goes from empty to having one item). If the content is not flushed between batches, the queue might not ever be empty, so you need to customize the updating of the batch size further.

1658125475901.png

This code first checks if the total input of the queue is divisible by 18 (mod operator '%'). If that is the case, a batch of 10 must have been completed and the batch size is set back to 8 (on 18, 36, 54,...). On the other hand, if the input - 8 is divisible by 18, a batch of 8 was completed and it is set to 10 next (on 8, 26, 44, ...).
(Both calculations are offset by and additional -1, because the trigger should set the batch size when the first item of a new batch enters)

batching-fm_1.fsm


1658125245633.png (4.0 KiB)
1658125295487.png (10.5 KiB)
1658125475901.png (20.4 KiB)
batching-fm.fsm (28.8 KiB)
batching-fm-1.fsm (28.7 KiB)
5 |100000

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