-
Notifications
You must be signed in to change notification settings - Fork 193
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Elevators should not ignore passengers that want to travel in the wrong direction if they have already entered the elevator. #10
Comments
@alexanderpas is this the section describing the logic you're referring to? https://github.com/mshang/python-elevator-challenge/blame/master/README.md#L159-L179
I agree. The request should be serviced (or "queued"), but obviously not acted upon immediately. The expected behavior, at least in elevators I've used, should be:
But that's my opinion |
Yes. A second instance of this problem is seen in this section
Which causes the rider that wanted to go to the 4th floor, which was already in the elevator to not being serviced, despite having entered before the rider that wanted to go to the 6th floor, which had to enter the destination twice.). Additionally, This case shows the doors opening and closing 3 times on the same floor, despite having riders already in the elevator, and having selected a destination. |
@alexanderpas I hadn't noticed that one. I didn't even get as far as the section your issue refers to. What got me was the section above (directly beneath "Directionality"). Have a look at my comment on it It seems this has become an interesting exercise in defining elevator logic rather than implementing it. |
The behavior in this challenge is based on the elevator in my building, which actually is that dumb... |
Hahaha... I understand. This has actually been an interesting process, but for me it's been more interesting in terms of the logic itself rather than programming for it. Thinking about how to make an elevator do things efficiently was a nice break from my typical coding routines, so thanks! |
When a passenger is already inside the elevator, and wants to travel in the wrong direction, the elevator should not ignore that passenger completely, but only ignore the passenger until it's done travelling in the current direction.
The current situation means that when you press the button for a lower floor inside the elevator, the button for that floor doesn't light up, causing confusion from the rider, who doesn't expect the elevator to not continue to his floor but stay put at a different floor.
The text was updated successfully, but these errors were encountered: