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.

Matthew Gillespie avatar image Matthew Gillespie ♦♦ commented ·

Can you attach your model? Setting up the list and pulling based off distance isn't too hard, but it'd be easier to show you if I can see how your model works already.

0 Likes 0 ·
Marco B8 avatar image Marco B8 Matthew Gillespie ♦♦ commented ·

I can attach only a part of my model, the once where I have the problem.

The model is this : list.fsm [the custom code "Distance" is not completed, but I will use it to update the location of the shuttles]

The problem is in this point: list-1.png

Thanks for the help!

0 Likes 0 ·
list.fsm (63.9 KiB)
list-1.png (16.8 KiB)
gilbert jerald avatar image gilbert jerald Marco B8 commented ·

The aim of your model is to get the nearest shuttle to collect the item from rack an placed it in the respective destination. Correct?

0 Likes 0 ·
Show more comments
Show more comments

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.

Marco B8 avatar image Marco B8 commented ·

Hi @gilbert jerald! Thank you for your answer and sorry for this late replay.

Your idea works correctly in my model, but I have to change only few things!

Thank you again

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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