Round robin by batch

Round robin by batch

don_masmoudi
Enthusiast Enthusiast
213 Views
2 Replies
Message 1 of 3

Round robin by batch

don_masmoudi
Enthusiast
Enthusiast

Hello,

 

I have an example with 4 combiners.

I have one source for Totes and the other one for boxes.

The objective is to send boxes by batch (in this case 100) to fill tote with the defined order Combiner1 -> Combiner2 -> Combiner3 -> Combiner4 -> Combiner1 -> Combiner2 -> Combiner3.... (Round robin)

 The inter arrival time of boxes is defined (1.44 sec).

 

Please find in attached the example.

 

Thank you for your help.

 

Best regards.

0 Likes
Accepted solutions (1)
214 Views
2 Replies
Replies (2)
Message 2 of 3

FelixMoehlmann
Collaborator
Collaborator
Accepted solution

You can start with the default "Round Robin" option in the Send to Port field of the source and then edit its code to only switch port every 100 items.

The code works by creating a counter label on the object (line 5) that starts at value 1.

This value is then used to denote the next output port rank to use (line 10) and then incremented by 1 (line 11). If the value grows past the number of output connections, it is reset to 1 (line 12/13).

Changing to batches just requires two changes. In line 10, instead of using the label value directly as port number, divide it by the batch size and then round up. In the condition in line 12, check against the number of output connections times the batch size.

 

Screenshot 2026-02-24 102815.png

0 Likes
Message 3 of 3

don_masmoudi
Enthusiast
Enthusiast

Thank you !

0 Likes