question

Tom H6 avatar image
0 Likes"
Tom H6 asked Tom H6 commented

How can I get AGV allocating certain control point

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

FlexSim 25.1.1
agvagv pathsallocation
1745582349951.png (29.8 KiB)
agvpaths.fsm (39.4 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

Felix Möhlmann avatar image
0 Likes"
Felix Möhlmann answered Tom H6 commented

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

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

agvpaths_1.fsm


agvpaths-1.fsm (39.4 KiB)
· 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.

Tom H6 avatar image Tom H6 commented ·

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 0 ·