The pseudo-code for customers is shown in figure (5). Customers send an initial request to the scheduler. The customer must then wait for the elevator's status report while he/she is outside of the elevator. As soon as an elevator reaches his/her floor, if the elevator is going in the same direction and if the elevator's door is open, then the customer will get on and send his/her destination request to the
8
elevator directly. When the customer is inside the elevator, he/she again must again wait for the elevator's status report. If the elevator is open on his/her destination floor the customer can exit. This will complete the customer's interaction with the scheduler and elevators. The customer will “sleep” for a random number of iterations and use the elevator once more.