Hi, I want to implement a logic for dynamic switching based on real-time queue detection such that:
- AGV Priority Mode (when there is a high volume of AGVs)
- Truck Priority Mode (when manned vehicle traffic peaks)
So the scenario is:
- Traffic sensors count AGVs and Trucks waiting at the junction
- The system decides based on real-time priority logic:
- If Trucks are waiting > X seconds, give them green
- If AGVs are waiting > Y seconds, give them green
- If both have a queue, the system decides dynamically based on
- Queue length
- Wait time thresholds
- Current congestion
- Example Decision Logic
- If 3+ Trucks are waiting AND their queue time > 20 seconds, Truck gets priority
- If AGVs are waiting AND their queue time > 20 seconds, AGV gets priority
- If both queues are full, switch every X seconds to balance the flow
- If neither is waiting, keep the last active mode until demand change
If the above is not possible, I want to be able to set it such that:
- If the AGV queue length exceeds a threshold (e.g., 5 AGVs waiting), trigger the AGV Green phase
- If Trucks waiting ≥ 3, trigger Trucks Green phase for a short duration
This is my current model: