question

Emily K avatar image
0 Likes"
Emily K asked Emily K commented

Choose the nearest AGV

Hi, I wish to choose the nearest AGV to load object.

I make reference to these questions and try these methods in my own model. But it doesn't work as I wish.
https://answers.flexsim.com/questions/31261/acquire-nearest-shared-resource.html

https://answers.flexsim.com/questions/108310/process-flow-related.html

Any mistakes in my model?

221101_Nearest AGV.fsm

FlexSim 21.2.4
agv
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

Felix Möhlmann avatar image
0 Likes"
Felix Möhlmann answered Emily K commented

By default the distance-code assumes that the puller is either a task sequence or the object that the task executer will travel to. When using the Acquire activity, the puller is set as the token, so you have to change the reference for the code to work.

Your first linked post says to shift the reference from the token to the item. In this case this is not enough since you are using an AGV network. For the distance to be calculated correctly, the reference must be an object connected to the network, so in this case the source (or possibly queue later). So you want to shift the puller variable from the token, to the object containing the item.

puller = puller.item.up;

1667290588791.png


1667290588791.png (16.8 KiB)
· 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.

Emily K avatar image Emily K commented ·

Thanks for your advice!

However my model still doesn't work.I found that the model in the first link will show how many resource are in the list, but my list didn't show such information.

1667367563966.png

I tried to change the puller to token.item.up, but still no response. Could you please give some advices?
Thanks!221102_Nearest AGV.fsm

0 Likes 0 ·
Felix Möhlmann avatar image Felix Möhlmann Emily K commented ·

You have to push the task executers to the list. Either at the start of the model, for example in a simple process flow that creates a token for each group member and pushes that member to the list. Or by adding the group to the "Initial Content" of the list.

1667372345451.png

When using a list and the Pull from List activity you can change the puller value directly in the activity. So you don't need to alter the code of the distance field. That was only meant for the case of using a process flow resource.

1667372428412.png

221102-nearest-agv_1.fsm

0 Likes 0 ·
Emily K avatar image Emily K Felix Möhlmann commented ·

Thanks for letting me understand more about puller and list :)

Much appreciate!

0 Likes 0 ·