question

TTL avatar image
1 Like"
TTL asked Felix Möhlmann commented

Allocate all agv travel nodes at the same time

Hi there,


I am trying to create custom code that allocates all required nodes for a travel path after the OnAGVBuildTravelPath event which allocates all control points at the same time for an AGV's given travel path. This is in order to "pre-reserve" the control points as there are multiple AGV's in the space and would help with routing generation.

Right now, I am only able to get the default of allocating the next space and deallocating as it goes along.

Thanks

FlexSim 23.0.0
agvagvpathcontrolpoint
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
1 Like"
Felix Möhlmann answered Felix Möhlmann commented

The property that controls when a control point is allocated is the "stopDist", which is defined for each allocation point.

So you would read that value for the first point and then loop through all allocation points and set the property to the same value as the first.

  1. Object current = ownerobject(c.up.value);
  2. AGV agv = AGV(current);
  3.  
  4. if(agv.allocationPoints.length > 0)
  5. {
  6.     double firstStopDist = agv.allocationPoints[1].stopDist;
  7.     for(int i = 2; i <= agv.allocationPoints.length; i++)
  8.     {
  9.         AGV.AllocationPoint allocPoint = agv.allocationPoints[i];
  10.         allocPoint.stopDist = firstStopDist;
  11.     }
  12. }

allocateAllAtStart.fsm


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