How can I get AGV allocating certain control point

How can I get AGV allocating certain control point

TomasHefler
Not applicable
278 Views
2 Replies
Message 1 of 3

How can I get AGV allocating certain control point

TomasHefler
Not applicable

[ FlexSim 25.1.1 ]

Hello,
I´m trying to do some customized AGV path planning and a great advantage for my model would be to be able to find which AGV has the first allocation on a given control point. I'm able to get number of allocations on control point and an allocation as treenode, but I'm struggling with getting to AGV that does the allocation.

I would be grateful for any advice.
Thanks

AGVpaths.fsm 1745582349951.png

0 Likes
Accepted solutions (1)
279 Views
2 Replies
Replies (2)
Message 2 of 3

moehlmann_fe
Advocate
Advocate
Accepted solution

You can get that pretty easily nowadays through the AGV.AllocatableObject class.

https://docs.flexsim.com/en/25.0/Reference/CodingInFlexSim/FlexScriptAPIReference/AGV/AGV.Allocatabl...

agvpaths_1.fsm

0 Likes
Message 3 of 3

TomasHefler
Not applicable

Thanks for your advice.
I was able to get the AGV as AllocationPoint and that extract it as an Object via this code:

AGV.AllocatableObject CP = token.CPs[1];


//check number of allocating agvs is bigger than one
if(Model.find(CP.name+">variables/allocations").subnodes.length>0){
    //find agv having the 1st allocation
    AGV.AllocationPoint allocation = CP.allocations[1];
    Object agv = allocation.allocator;
}
0 Likes