Exercise · Volume 1 · 2.2.5-10
Exercise 2.2.5-10
not stated yet in Lean solution written
| Rating | 40 |
|---|---|
| Kind | Informal: the exercise has no formal statement, so Lean does not state it from the written solution |
| Section | Section 2.2.5 of Volume 1 |
The task
Specify the actions of an elevator one knows, check the rules by experiment, then design a discrete simulator and run it.
The exact wording is in your copy of the book.
Hints
Open one hint at a time. Try the exercise again after each.
Hint 1
Follow the plan of the text: list the variables, the coroutines, and the delays.
Solution
Show the solution
This is a project and has no single answer. A way to do it, in the style of the section, is as follows.
First list the state: the floor, the doors, the direction, the call buttons. Then write down the rules as coroutines, one for the users and one for the elevator, with each action marked by the delay it takes. Then ride the elevator and write down, with a watch, the times of door openings and floor passages, and especially the unusual cases, such as pressing a button when the doors are closing, or two people with opposite directions.
Each experiment is compared with the rules, and the rules are changed until no case disagrees. The text says that this took the author six rounds. After that a simulator follows: a WAIT list sorted by time, one node per activity, and a loop that takes the first node, advances the clock and runs it. Output is a table like Table 1, and one checks the table against the experiments again.
Remarks
The exercise was not done here, since it needs a real elevator and an open rating of 40. The program of the text, with the code of Exercises 8 and 9, is a base for it.
This solution is drafted, and a person has not reviewed it yet. The source.
In Lean
not stated yet The exercise is not stated in Lean yet.
The status is computed from the Lean build. The node of the map.
Something is wrong? Report it.