question

Magnus C avatar image
0 Likes"
Magnus C asked Magnus C commented

How to query AGVs by distance

Hello,

Using the default AGV process flow template I wish to activate the AGV parked closest to the item that need to be picked up. How can I do this?

As you know, this is the logic that activates parked AGVs, but using a simple query ORDER BY distance does not work. I have tried to modify the distance expression in the Available AGVs list, but without any luck.

I saw a similar thread, but no solution was presented: https://answers.flexsim.com/questions/34496/is-there-a-way-to-query-a-list-of-task-executors-b.html

Thanks!

Choose One
agvprocess flowlistquerydistance
skjermbilde.png (27.6 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.

1 Answer

Jason Lightfoot avatar image
1 Like"
Jason Lightfoot answered Magnus C commented

I expect you need to have an item referenced on the token in order to evaluate the distance within the list fields. The activity "Wait for New Item on Load List" doesn't assign the new item to a token label for you to use in a distance calculation based on puller.item. You could find the item in code and assign it to token.item or you could swap the "Wait for New Item on Load List" activity for a "Pull from List" with the "leave entry on list" checked - and assign the item to a label on the token there. To ensure you only pull new items I'd store the pushtime on the token and then only pull items "WHERE pushTime>token.lastpushtime".

· 3
5 |100000

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

Magnus C avatar image Magnus C commented ·

Great suggestion. I have tried something similar to what you´re explaining here. In my model the logic pulls the new item from the local partitioned list and assigns it to the token before trying to activate an AGV. The item is of course left on the list. Everything should be set up correctly. I know this because I already use the properties of these items to pull AGVs in regards to other requirements that I have set up. Distance seems to be the only problem I can't solve.

I could set up a simple example model, but it really is just the basic AGV PF.

0 Likes 0 ·
Jason Lightfoot avatar image Jason Lightfoot ♦♦ Magnus C commented ·

I think the distance field expression for AGVs might best done with cpdistance(fromcp,tocp) - passing in value.as(AGV).currentCP as fromcp and cpconnection(puller.item.up,1,1) as tocp.

0 Likes 0 ·
Magnus C avatar image Magnus C Jason Lightfoot ♦♦ commented ·

Gave your suggestion above a few attempts, but in the process I tried

cpdistance(value.parkPoint, puller.pickupPoint)

and it seems to be working fine. Since I already have the items properties it was just a matter of using the existing labels correctly. Anyways, thank you for your help!

1 Like 1 ·