Fri Nov 22 20:22:32 CET 2019 > - You say that we have to handle both call buttons (people who call the > lift) and destination buttons (people who say to the lift that they want > to go at a specific floor) have to follow the FIFO thing. This means > that if we have a person in the lift and a call happened before the > person says its destination, then the lift has to go to the call and > then to the destination of the first person ? We can assume that the button D is pressed at the same time as the person is picked up. Example: person A calls lift at time 1 from floor 3 person B calls lift at time 2 from floor 5 - the lift stands still at time 0 at floor 1. Its queue is empty [] - at time 1 the lift starts moving towards floor 3. Its queue is [3] - at time 2 the lift still travels towards floor 3. Its queue is [3,5] - at time 3 the lift picks up person A who chooses destination 10. Its queue is [5,10] - at time 5 the lift reaches floor 5 and picks up person B who chooses destination 5. Its queue is [10,6] - at time 14 the lift reaches floor 10. Its queue is [6] - at time 20 the lift reaches floor 6. Its queue is [] > - And also can we assume that a call is one user or should we assume a > reasonable random number of people per call ? Yes, we can assume that a call is always made by one single person. Multiple persons and lift capacity can be the topic of one of the missing extension tasks. Mon Nov 25 20:00:54 CET 2019 > The first one is about the FIFO method. If we reach a floor and we have > two people who want to leave the lift, is it possible ? Or if we have a > call and a destination on the same floor, can we combine or we have to > know which person went first into the lift, or called the lift first, > then leave the floor and come back later for the other one ? Yes, you should handle this as follows: if there are two or more people who want to leave the lift at a reached floor, they leave it at the same time. If there are two persons waiting at the floor when the lift arrives then you can embark them both and choose random which one will enter the destination queue first. You should use an exponential distribution to decide the times between arrival of passengers to the lifts: https://en.wikipedia.org/wiki/Exponential_distribution We will see how to use random generators in one of the next lectures. They are in chap 24. > And the other thing is that I don't really understand what is a controller. A controller is like a sort of manager. It handles objects of the type Lift and updates their status telling them what to do.