question

Marco B8 avatar image
0 Likes"
Marco B8 asked Marco B8 commented

Acquire Resource referenced to a group of object that are created using a script

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.

FlexSim 17.2.5
listsqlacquire resourcescriptgroups
· 5
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

gilbert jerald avatar image
2 Likes"
gilbert jerald answered Marco B8 commented

@Marco B8

As per your objective, I have built a simple model with 4 shuttles that get the nearest parked shuttle to load the item from queue1 and unload it on queue2.

Solution:

I have used the process flow to achive this logic

Initially, I push the created item to the "itemlist " and I have a list (ShuttleList) that holds the number of shuttles that is been used in the model.

In the process flow, item will pull the nearest parked shuttle using distance query.

I have attached the model for your reference have a look at it

shuttle-pull-by-distance-1.fsm

Note: Implement this logic to your model and let me know whether it is working

Thanks


· 1
5 |100000

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