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:
Then, the puller is the CP attached to the AGV asking for next destination:
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:
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