question

Ali H avatar image
0 Likes"
Ali H asked Joerg Vogel edited

Send a batch from a queue to other queue with roundrobin configuration

Hello,
Thank you so much for the help!
They know that what I want to do is to be able to make a batch of 8 pieces to the queue and leave the 8 pieces in the next queue, that is:
Collect 8 pieces of queue1 and leave the 8 pieces in queue2, then again collect 8 pieces of queue1 and leave the 8 pieces in queue3 independently if there is space in the previous queue.
It is to send the batch of 8 pieces to the different queue with the round-robin configuration.

send batch to queue with round robin 2.fsm


FlexSim 18.0.10
queuebatchround robin
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

·
Joerg Vogel avatar image
0 Likes"
Joerg Vogel answered Joerg Vogel edited

3D Logic approach:

Triggers:

On Entry: you set a new label value at each item to 0. I called it "tag".

On End Collecting: you set the label value tag to 1.

There result is all items are have label named tag and only the last item of the batch has got a value of one. The other labels of "tag" have values of zero. Now you can increment a label at the queue itself by the exiting items by there label value of "tag".

On Exit increment a label value. Replace item by current and use a labelname you have created at your queue,increment-label.png

item.tag is mostly 0, but the last item of your batch inrements the label at your queue by one.

Function on Flow tab in Properties window

Send To Port: you choose a picklist property Port By Case

Case Function: There you evaluate the label of your queue which gets incremented. But saddly after the fourth batch you are forced to reset the label value back to zero. You can write a conditional logic in on Exit trigger. Or it doesn't matter that the label rises on, because you use a modulus operater which does a integer division returning the rest of this division. A modulus is for example "%".

A sequence of values like 0,1,2,3,4,5,6,7,8,.. returns by a modulus operator to 4 : 0,1,2,3,0,1,2,3,0,...

current.batchCount%current.outObjects.length  

where current.outObjects.length is equal to the number of output ports or number of receiving queues.

port-by-case-modulus.png

send_batch_round_robin_JV.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.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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