Skip to content
All apps

Elevator simulator

About this app

Two elevator strategies compete in a duel on the same call stream — FCFS, SSTF, SCAN, LOOK, zoning or destination dispatch. Metrics and histograms expose the trade-off between mean and longest wait, and a click on a bar shows the passenger who lived it.

Scheduling as a trade-off

An elevator constantly has to decide which call to serve next. FCFS serves calls in the order they arrive. SSTF always goes to the nearest call and is fast on average, but under load it can leave passengers at the edges waiting a very long time. SCAN and LOOK travel in one direction and only turn at the end or at the last call. Zoning splits the building between several cars, and destination dispatch asks for the destination when the call is made. Lowering the mean wait and bounding the longest wait are different goals. Disk scheduling uses the same algorithms.

What the app shows

A building with 5 to 30 floors and 1 to 4 cars. Passengers appear at random following a daily profile: in the morning from the lobby upwards, at midday mixed, in the evening downwards. In duel mode two strategies run side by side on an identical call stream. Metrics show mean, 95th-percentile and maximum waiting time, trips per hour and passengers delivered and waiting; a histogram for each side shows the distribution of waiting times.

Try it yourself

Pick two strategies, the number of floors and cars, the time of day and the intensity, and let them compete. Increase the load and watch SSTF stay good on average while its maximum waiting time runs away. Clicking a bar in the histogram highlights the passenger who experienced that wait.

Frequently asked questions

How does an elevator decide where to go?
Through a dispatch strategy. A common one is the elevator algorithm (SCAN or LOOK): the car keeps going in its direction and serves every call on the way until no calls remain in that direction, then turns around. Modern systems with destination dispatch ask for the destination when the call is made and assign cars accordingly.
What is the difference between SCAN and LOOK?
SCAN travels all the way to the last floor in each direction before turning. LOOK turns around at the last call in its direction and saves empty trips. Both prevent individual calls from being skipped indefinitely.
Why is nearest call first not always best?
SSTF (shortest seek time first) minimises the next trip and often achieves a low mean waiting time. Under heavy load, however, new calls keep appearing near the car, so passengers on distant floors wait a very long time. This is called starvation.
What can I set in the elevator simulator?
Two strategies from FCFS, SSTF, SCAN, LOOK, zoning and destination dispatch, 5 to 30 floors, 1 to 4 cars, the time of day and the intensity of the call stream. Metrics and histograms compare both strategies directly.

Subject: Computer science

More from Computer science

A VisuApp by heyprof: interactive, free in your browser, no sign-up. What is a VisuApp? · All apps