question

jacopo-r avatar image
0 Likes"
jacopo-r asked jacopo-r commented

Accessing AGV allocated Control Points

Hi all,

I have a problem for which my model breaks because there is an AGV which is standing still in a charging station that allocates different CPs, therefore another one cannot allocate them. I know it looks weird, but I think it is part of the logic I have that makes AGV allocating CPs even though they will not drive to them.

So, my question is, is there a way to access from the AGV treenode the CPs that it has allocated so I can delete these allocations? I went through the entire AGV treenode, but I couldn't find anything.

Unfortunately I cannot share my model, I hope a picture will be enough.

Thanks in advance.

1684682891384.png

FlexSim 23.0.1
control pointsagv allocationallocation point
1684682891384.png (153.8 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

·
Iago MF avatar image
2 Likes"
Iago MF answered jacopo-r commented

Hi!

This information is inside de AGVNetwork tree.

1684736997320.png

You can use several methods from de AGV class to get information about de current cp, destination cp and also all the allocation points the agv has allocated. See the AGV class:

https://docs.flexsim.com/en/23.1/Reference/CodingInFlexSim/FlexScriptAPIReference/AGV/AGV.html

In this case, you can use the property traversalPoints to know the current allocated points as an array:

Object taskExecuter = Model.find("AGV_Carset_L9_3");

AGV agv = AGV(taskExecuter);

return agv.traversalPoints.length;

Then, you should read the AGV.TraversalPoint class to know how to work with this:

https://docs.flexsim.com/en/23.1/Reference/CodingInFlexSim/FlexScriptAPIReference/AGV/AGV.TraversalPoint.html

I hope it helps you!



1684736997320.png (76.3 KiB)
· 4
5 |100000

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

jacopo-r avatar image jacopo-r commented ·
Hi @Iago MF ,

thank you for your answer. I'll read and apply what you suggested.

0 Likes 0 ·
jacopo-r avatar image jacopo-r commented ·
Hi @Iago MF ,

I now happen to need to access the node called "accumTraversal" on the AGV node under the AGVNetwork treenode. Unfortunately, there is not a property that I can recall in the script such as the traversalPoints has. Do you know how I could access this from the AGV?
Thank you

0 Likes 0 ·
Jason Lightfoot avatar image Jason Lightfoot ♦ jacopo-r commented ·
treenode agvnode=AGV(Model.find("TaskExecuter1"));
treenode accTraversals=agvnode.subnodes["accumTraversals"];

then access each subnode of that as sdt.

Note this is not a supported technique as FlexSim may change the structure of the tree and sdt values, so I suggest you add usercommands to find the values you want so that you can update in one place if such a change takes place that breaks your commands.


0 Likes 0 ·
jacopo-r avatar image jacopo-r Jason Lightfoot ♦ commented ·

Thank you @Jason Lightfoot

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.