Donald Knuth's The Art of Computer Programming has, in its first volume, a lengthy section on simulating an elevator. It is a single regular elevator (nothing "special" going on as in the post here), but even so, as he tries to make things precise, you realize how much detail is involved, and get some appreciation for the task of programming. It occupies about 15 pages (plus several pages of exercises and solutions).…
Now, if there are multiple elevators but a single set of up/down buttons for them on each floor, that's where things get really complex really fast.