In may model I'm working with n agv (not a specific number) saved in a group, using the script. Every time a new item must be stored in my rack, I have to find the nearest shuttle to the lift. The position of the shuttles are saved in a global table that I update every time there is a movement of the agv.
Using a group and the "acquire resource" activity, I don't know how to write the code who helps me in finding the nearest shuttle.
An option is to use the list (and push/pull to list) instead the group [https://answers.flexsim.com/questions/29832/how-to-acquire-resource-with-a-reference-to-a-grou.html], but I have some difficolt in improving this method, especially in push and pull from the list the agvs.
Is there a way to find it using the SQL code in the "acquire resource" activity that could be related with the global table?
Thanks for the help.