question

fiz avatar image
0 Likes"
fiz asked Logan Gold answered

Sorting of my list

Hi, this list contains delivery task of an agv. how can i sort it in a manner where TransferArea3 comes first followed by TransferArea2 followed by TransferArea1, and then TransferArea3 again and so on and so forth if available, and then by first come first serve.

so for this following example

1724137366080.png
I am trying to sort it like this:

1724137453429.png

FlexSim 23.0.15
list sort
1724137366080.png (197.8 KiB)
1724137453429.png (25.5 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.

Logan Gold avatar image
0 Likes"
Logan Gold answered

Here is another example (List_OrderByItemRankThenByLocationRank_Example_23.0.fsm) of how you could sort the list based on a location's "priority".

You would use this Query when pulling from List:

ORDER BY ItemRank ASC, QueueRank ASC

In the example model, you can also open the List Entries and put the query in the Test Pull Queries field to see how it affects the entries in the List Entries window.

The important thing is to have a label on the Queues to indicate their rank (QueueRank in the example). Then, in the List Properties, there are two Expression Fields - QueueRank that is looking at that label and ItemRank that is getting the items' ranks.


5 |100000

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

Jacob W2 avatar image
0 Likes"
Jacob W2 answered

Hi @fiz,

If your goal is pull items from a list in a specific order, and do it based on when the item was pushed to the list, here is one way to do it.

In the attached model, I created a process flow label that will be used to ensure that the correct pull order is maintained. The token that represents the puller gets this value and then it changes in the following order 3>2>1>3 and so on. Items are placed in one of three different queues which each have a different QNum value that is used in a query on the list to pull the correct order.

The puller token then pulls items from the list first by the matching QNum value, and then pulls whichever matching item has been on the list the longest. I then stored this information on a table that shows that the pull order was followed queue3>queue2>queue1.

pull from list in specific order.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.