AGV Behaviors¶
(nodes/agv_behaviors.py)
FindNearestFreeAGVSlot:¶
Finds the nearest free slot on the closest AGV.
- Output:
Feedback: Closest AGV ID with a free slotSuccess: Always
LocateFilledInspectionAGVs:¶
Checks for AGVs with all four slots filled, and sets the
filledAGV (int)to the ID of the AGV with all slots filled.
- Output:
Feedback: ID of AGV with all slots filledFailure: No AGVs have all slots filledSuccess: At least one AGV has all slots filled
MoveAGVsToIntersection:¶
Moves the filled AGV to the intersection of the AGV track, sets the
filledAGV (int)variable back to -1, and sets AGVATIntersection to the ID of the moved AGV.
- Output:
Feedback: ID of AGV that was moved to the intersectionFailure: There are no filled AGVs, orfilledAGV = -1Success: There is a filled AGV, and it successfully makes it to the intersection
Wait1Sec:¶
All active AGVs stop movement for one second.
- Output:
Feedback: Confirmation of completing the waitSuccess: Always
MoveAGVToAssembly:¶
Moves the AGV at the intersection to the assembly station, decrements AGVsAtIntersection (type: int) by 1, and sets the position of the AGV to Assembly.
# Usage WORLD.AGVs[x][1] = "Assembly" # x = ID of moved AGV
- Output:
Feedback: ID of AGV that was moved to the assembly stationFailure: No AGVs are at the intersectionSuccess: The AGV reached the assembly station
MoveAssemblyAGVToInspection:¶
Moves the AGV at the assembly station back to the inspection state and sets the position of the AGV to Inspection.
- Output:
Feedback: ID of AGV that reached the inspection stationFailure: No AGVs are at Assembly, or AGVs at Assembly do not have all slots clearedSuccess: An empty AGV is moved from the assembly station to the inspection station
UnloadAssemblyAGV¶
Clears the slots of the AGV (if present) at the assembly station and then sets the filled slots of the AGV to 0.
# Usage WORLD.AGVs[x][0] = 0 # x is the ID of the moved AGV
- Output:
Feedback: ID of the AGV at the assembly station that had its slots clearedFailure: No AGV is at the assembly stationSuccess: The AGV at the assembly station had its slots successfully cleared