question

Maria B6 avatar image
0 Likes"
Maria B6 asked Ben Wilson commented

How to make the item choose the queu with the shortest waiting time?

My model has a processor connected to 3 queues and each of these queues is connected to another processor. Is it possible to make an item from the first processor to choose the queue with the shortest waiting time?

FlexSim 18.2.3
flexsim 18.2.3decision
· 6
5 |100000

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

Gokulakrishnan Kandasamy avatar image Gokulakrishnan Kandasamy commented ·

It is not possible to choose the queue with shortest waiting time at initial stage because waiting time will be calculated once inventory starts to add. Try to use basic process flow decision logic to move item to queue whichever you like. Otherwise, there is so many options in send to the port flow tab. Try to use that

0 Likes 0 ·
Maria B6 avatar image Maria B6 Gokulakrishnan Kandasamy commented ·

Thank you for your answer, but I should have submitted an image from this part of the model for a better understanding. The situation is the following:

So, my question applies for the Processor1 when it is sending objects to Queue2, Queue3 or Queue 4. In send to port flow tab from the processor I must introduce some instruction/code to make the shortest waiting time the decision criterion. Is it possible?

0 Likes 0 ·
Gokulakrishnan Kandasamy avatar image Gokulakrishnan Kandasamy Maria B6 commented ·

@Maria B6 i can't open your image. Please resend it

0 Likes 0 ·
Show more comments
Ben Wilson avatar image Ben Wilson ♦♦ commented ·

Hi @maria.b6, was joerg.vogel's or braydn.t's answer helpful? If so, please click the red "Accept" button on one of their answers. Or if you still have questions, add a comment and we'll continue the conversation.

0 Likes 0 ·
Joerg Vogel avatar image
2 Likes"
Joerg Vogel answered Joerg Vogel commented

Hi @Maria B6,

longest queue is not shortest waiting time. In the attached model I add all waiting times of all items of the same queue together. Therefore all Items are pushed to a global list on entry event and pulled on exit of any queue. The shortest time gets evaluated if all queues are filled at least with one item. The source code is in the queue previous to the waiting queues. The code is written to insert more queues.

shortest_wait_time_1.fsm


· 5
5 |100000

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

Maria B6 avatar image Maria B6 commented ·

@Jörg Vogel this code really worked for my problem. Thank you! I only have one question about the model you sent: I didn't understand the function of the "on reset" trigger, because the update of waiting time values is done with the codes on the "on entry" and "on exit" tabs of the queues, am I right?

0 Likes 0 ·
Joerg Vogel avatar image Joerg Vogel Maria B6 commented ·

On Reset I collect all names of objects connected to the queue which receives items into an array at a label called "outs". If you want to customize the feature limited for output objects, you can edit the source code in the On Reset trigger. In Line 5 I read this label in my code.

0 Likes 0 ·
Joerg Vogel avatar image Joerg Vogel Maria B6 commented ·

@maria.b6

you wrote me an e-mail, what do you want to know about my code? How can I help?

0 Likes 0 ·
Maria B6 avatar image Maria B6 Joerg Vogel commented ·

I see that on the list are all the times that the boxes spent on the waiting line. But how is the sum of these values plotted in a table and still in ascending order? Where is this function described?

0 Likes 0 ·
Show more comments
Braydn T avatar image
0 Likes"
Braydn T answered

@Maria B6

Does this shortest queue option not work?

Also, we cannot see your image.


shortestqueue.png (84.4 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.