Queue routing logic

Queue routing logic

kevskon
Enthusiast Enthusiast
347 Views
5 Replies
Message 1 of 6

Queue routing logic

kevskon
Enthusiast
Enthusiast

Hello Everyone,

I am currently working on a simulation involving quick-lanes, self-lanes, and traditional lanes, all of which are fed by an arrival rate stored in a global table. I've added labels to my flow items to track item count and customer type. I'm seeking assistance with the routing logic for my flow items. Here's the logic I'm aiming for:

  • If the label item count is 5 or less, the items can go to any lane, but they should preferably choose quick-lanes (QL) and self-lanes (SL) if the queue lengths for traditional lanes are equal to QL and SL queue lengths.
  • If the label item count is greater than 5, the items should prefer traditional lanes R1-5 and avoid quick-lanes 99.9% of the time (with a 0.1% chance of mistakenly going to a quick-lane).
  • Items should enter the self-lane queue if all Q1-Q5 queue lengths exceed the Q_SL queue length by 2 or more.

I'm unsure if this routing logic is achievable. I've tried several solutions using process flow to monitor queue lengths and attempted custom code, but nothing seems to be working. I've attached the simulation for reference. Thank you in advance for your help!

 

0 Likes
Accepted solutions (1)
348 Views
5 Replies
Replies (5)
Message 2 of 6

moehlmann_fe
Advocate
Advocate
Accepted solution

I would suggest to use lists. They are a powerful tool to filter and/or sort values by their characteristics.

https://docs.flexsim.com/en/24.0/ConnectingFlows/Lists/WorkingWithLists/WorkingWithLists.html

 

In the attached model I added a global list "Lanes" and added all queues to it as initial content. I also defined three list fields:

- Type just mirrors the type of the queue (Std, Quick or Self).

- queueSize is the number of objects in the queue (plus one if the connected processor is busy)

- modQueueSize is the same as queueSize but the content of Std-Queues is reduced by 2 artificially.

moehlmann_fe_0-1749559237577.png

 

When a customer enters I first check their item count. If <= 5 they pull any of the queues sorted by "queueSize" in ascending order, then by whether they are a Std-Queue in ascending order (thus prioritizing non-Std-Queues) and finally by a random value (if all else is equal).

moehlmann_fe_1-1749559476627.png

 

With an item count of > 5 99.9% go to pull the shortest queue of Std or Self. Though here the "modQueueSize" is used for sorting, so a Self-Queue is only chosen if the Std-Queues all contain at least two more customers.

moehlmann_fe_2-1749559492631.png

 

0.01% pull a Quick-Queue.

moehlmann_fe_3-1749559510101.png

 

Note that in all of these cases the queue isn't actually removed from the list, as the "Leave Entries On List" option in the Pull from List activities is checked. The list is only used to look up what queues are available and which is current the "best". 

Message 3 of 6

kevskon
Enthusiast
Enthusiast

Thank you for your detailed reply, I will try to apply this approach to my model and will let you know how it works out for me!

0 Likes
Message 4 of 6

kevskon
Enthusiast
Enthusiast

Thanks I think this logic will mostly work for what I am trying to accomplish! I have a screenshot attached for an instance throughout the run where customers seem to be preferring the Std lanes even if their modified queue lengths are still higher than SL, do you have any suggestion on how I can change the settings for customers to choose SL?

kevskon_0-1749587824669.png

 

0 Likes
Message 5 of 6

moehlmann_fe
Advocate
Advocate

Do new customers actually join the Std-Lanes in this situation? What is probably happening is that a backlog starts to build in the SL-Queue so customers move to the other lanes. But then the backlog quickly clears since there are 8 SL-checkouts for the one queue. Since the customers only choose a queue once, they will stay in their lane, even if a different one becomes shorter while they wait.

You could of course check if a customer might switch lane. Though finding the right condition to not do it too often or too rarely might be tricky. 

One idea would be to also keep a list of waiting customers, including their current position in the queue (list field expression would be: "value.rank"). When a queue becomes empty (or even when it becomes shorter) you could do a check if there are customers that would profit from switching lanes. Essentially the queue would pull customers over.

Message 6 of 6

kevskon
Enthusiast
Enthusiast

Yeah you're right I slowed down the simulation and followed each step and it is working as intended, I ended up changing the mod queue length to -1 from -2. I might hold off on the lane switching ability logic for now as there are other things I'm still trying to work in first. Thank you!

0 Likes