Sort by expression in a queue

Sort by expression in a queue

rocio_alvarez9R3F7
Advocate Advocate
294 Views
4 Replies
Message 1 of 5

Sort by expression in a queue

rocio_alvarez9R3F7
Advocate
Advocate

Hello, I saw the use of Sort by Expression in a forum post, but it doesn't solve my problem.

I have a small model where an operator carries boxes (labeled Type 1 to 3) of three different types from queue1 to queue2.
In queue1, I've set up a trigger called On Entry --> Control --> Sort by Expression, which sorts the boxes in ascending order using the expression item.Type.
As the boxes enter queue1, they are sorted by Type in ascending order. However, the operator isn't picking up the boxes in ascending Type order; instead, they're picking them up in the original order they arrived.
How can I make the operator pick up the boxes sorted in ascending Type order?
Thanks in advance. I've attached the simple model.

0 Likes
Accepted solutions (1)
295 Views
4 Replies
Replies (4)
Message 2 of 5

FelixMoehlmann
Collaborator
Collaborator
Accepted solution

As long as the downstream object has available capacity, any arriving items will immediately get released by the queue and a transport task sequence will be generated and added to the operator's task sequence queue. Controlling the order in which the items are transported is thus about influencing the order in which tasks are executed. By default they are sorted by their priority in descending order.

The priority field of fixed resources does not allow you to enter code expressions. Setting the task sequence priority based on the item label could for example be done in the "On Receive Task Sequence" trigger of the operator. Once a task sequence is started by the operator (so before they have travelled to the pickup location), changing the item is no longer possible with the default 3d logic.

For more detailed control you could switch to using lists and Process Flow: Tell the operator to travel to the queue, then pull the best item from a list and load it.

0 Likes
Message 3 of 5

rocio_alvarez9R3F7
Advocate
Advocate

Thanks Felix,
yes, I know it can be done with lists, but I was consulting a FlexSim manual where they proposed this exercise. Even though I ordered the items in the queue, the operator was taking the items in the order they arrived, regardless of the order they were in the queue. That's why I had this question.

Thank you very much for the explanation.

0 Likes
Message 4 of 5

FelixMoehlmann
Collaborator
Collaborator

If the queue was connected to a processor, so only one item is released at a time, sorting them in the queue would suffice to change the order in which they are processed. Maybe that was what the exercise was referring to.

0 Likes
Message 5 of 5

rocio_alvarez9R3F7
Advocate
Advocate

Exactly. It's connected to a processor.

Thank you so much!

0 Likes