question

Yash Patel avatar image
0 Likes"
Yash Patel asked Felix Möhlmann edited

Trigger based in quantity in a batch

Hi, I am working on a model where I am making batches of 8, but in process I want to start a parallel process when quantity in a batch reaches 6. So I am trying to set a trigger source where token in generated when any batch reaches 6 to run another process flow inheriting common labels for that batch. I tried to look in to the triggers available with batch but non of then checks each batch in the batch process. Could you please guide me in what other triggers can I use. 1732129712065.png1732129791572.png

FlexSim 24.2.2
event-triggered sourcebatchsize
1732129712065.png (24.5 KiB)
1732129791572.png (16.1 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.

1 Answer

Felix Möhlmann avatar image
1 Like"
Felix Möhlmann answered Felix Möhlmann edited

Edit: Nevermind what I wrote below. It does work but there is a way easier option. Listen to the "On Batch Change" event and assign the tokens to a label. You can then check if there are currently six tokens in the batch.

partial-batch-trigger_1.fsm

Original Answer:

You can react to each token entering the activity though and check if the respective batch has reached a quantity of 6.

The attached model showcases two possibilities of how this could be implemented.

One is an Event-Triggered Source, followed by a "Breathe" and then a Decide that checks the batch quantity. The issue here is that two tokens being added to a batch at the same time will break this, due to the "Breathe" (which in turn is necessary to first let the entering get added to a batch).

Alternatively you can forego the "Breathe" and instead check if the batch the token will get added to will reach a quantity of six immediately. This is implemented in the code of the "Group By" field of the Batch activity. This code gets run for each arriving token and has the benefit of having a direct reference to the activity. The code creates a new token and writes some information about the batch to it in an adjacent "Start" activity.

partial-batch-trigger.fsm


5 |100000

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