AGV_FullModel_6_27_24_withAstarNav.fsm
I am trying to implement an AGV "parking queue" with variable parking spots. My goal is to have AGVs stage to the furthest spot in the queue of parking spots, and then a full tote condition will select the adjacent or closest upstream staged AGV.
What is being asked is that for the number of parking spots, the AGVs will pick up an empty tote and then proceed down to the furthest parking spot. When a tote becomes full the AGV in the closest adjacent or upstream parking spot will move to the spot directly in front of it, push (move) the full tote onto the adjacent conveyor, place the empty tote it is carrying onto the vacated station, and then turn and proceed back to be reassigned (currently pick up an empty tote and rejoin the staging queue again). Additionally, they are wanting vacated parking spots to be filled by all AGVs in the “parking queue” to move downstream until all spots are filled. I can get pretty much all the parking behavior individually but having trouble combining all those requirements. In hind sight it probably would have been better to use network navigation, but the customer changed requirements mid-model and I'm not sure how I would redesign it with the current process flows.
The model I’ve included does all the required behavior except for grabbing the correct parked AGV. You’ll see I hard coded a partition ‘3’ just to grab the furthest down stream for the moment.
I tried the following code in the ‘Pull From Occupied Parking’ partition of the Divert process flow to select the correct parking spot based on what chute it is at, but it breaks something.
“
int modValue = 0;
if (current.Chute_Number%Model.parameters.ParkingSpots == 0)
{
modValue = current.Chute_Number/Model.parameters.ParkingSpots;
}
else
{
modValue = Math.trunc(current.Chute_Number/Model.parameters.ParkingSpots)+1;
}
“
I am sure there is an easier way to do what I am trying to do (likely using subflows or something). I would love help fixing the current process I have or help doing it a better way. Thank you in advance