withaspirit / Elevator-Simulation

Elevator System Simulation project
1 stars 1 forks source link

Elevator Movement Refactor #157

Closed withaspirit closed 2 years ago

withaspirit commented 2 years ago

Improved readability of Elevator Movement Algorithm. Elevator now displays both "IDLE" and "ACTIVE" Movement states in its output statements.

There's a slight bug where, when an elevator is IDLE and currentFloor == requestFloor, the "reached destination" message pops up before the "moved to floor" message. This is because the first time the "compareFloor()" method is called in "respondToRequest()," it checks if the elevator is stopped and removes the request if that happens.

Changes