Idle Behavior:
Stay on the current floor with doors closed if there are no Active Requests.
If a new Request appears:
If it’s on this floor, open doors, serve it, wait 10 seconds, then close doors. If no more Requests, remain Idle.
If it’s a different floor, determine if the target floor is higher or lower. Move in that direction (Up or Down State).
Responding to Summons:
In Moving Up State, serve only floors with Up Summons that are above the current position. Ignore Down Summons until no upward requests remain.
In Moving Down State, serve only floors with Down Summons that are below the current position. Ignore Up Summons until no downward requests remain.
Responding to Destinations:
When a Destination Button is pressed, add it to Active Requests.
If it lies in the current direction, serve it in sequence.
If the opposite direction, finish the current direction first. Then reverse direction to serve remaining Requests.
Arriving at a Requested Floor:
Upon arrival at a floor with an Active Request (Summons or Destination), stop. Open doors, deactivate that Request and wait 10 seconds.
If new Requests arise during this wait, adjust travel plans accordingly.
After 10 seconds with no new requests for that floor, close doors.
Direction Changes:
After serving all Active Requests in one direction, check the opposite direction for any pending Requests.
If found, switch direction.
If no Requests remain, return to Idle State.
No Unnecessary Stops:
Do not stop on floors without Active Requests matching your current direction.
Not bad.
Please use CATEGORIES ONLY, not tags.
Place post into Regrade Please and/or Feedback Please following any significant improvements.
done 👍
Brilliant.