question

Joaquín MSV avatar image
0 Likes"
Joaquín MSV asked Joaquín MSV answered

Sort next AGV destination by shortest network distance

Hello all,

I am trying to provide orders to an AGV an pick boxes from different stations based on the shortest distance in the AGV network (not in straight line). I'm populating an item list with the boxes of each queue and adding as property the CP linked to the queue (as center object). Apart from that, I have created a dynamic field on the list with the boxe's CP and the puller's current CP. The configuration of the list is like this:

1743606613192.png

Then, the puller is the CP attached to the AGV asking for next destination:

1743606708844.png

The logic behavior would be that, if I'm in a CP, and after each box I query and sort by distance, if I still have boxes in the bystanding queue, I'll finish them (distance 0), but if not, I'll go to the closest one in line (the next). The problem is that this behavior is not happening. It seems that the value calculated by cpdistance is not properly considered or not well calculated, for whatever reason.

Separately, the function works fine, like tested in an independent block:

1743606919195.png

1743606944042.png

I would like to use this method to find shortest jobs to filter the tasks in simple ProcessFlow but is not working like it should be. Any idea of what it could be? Thanks in advance for your help.

Here the test program: query_orders_AGV_by_distance_Network.fsm

FlexSim 25.0.4
controlpointdistanceusing listsagvnetworks
5 |100000

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

Felix Möhlmann avatar image
1 Like"
Felix Möhlmann answered

Swap the parameters in cpdistance(). You want the distance from the puller to the CP of the item.

5 |100000

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

Joaquín MSV avatar image
0 Likes"
Joaquín MSV answered

What a silly mistake. Thank you very much.

5 |100000

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