Contents
Is there an OOP problem for an elevator?
This is one of them; unfortunately, my OOP professor in college never actually gave an answer to it, and so I’ve been wondering. The problem is as follows: design a basic set of objects/methods to be used to simulate an elevator bank.
Which is the best strategy for elevator design?
As time might not suffice, add comments on your ideas (“might do statistics, learning when rush hours are”) . But the basics: if a floor button is pressed an elevator will pass the floor, decide whether to halt, or not (already many other floors pressed, an other elevator free). Typically minimism is the best strategy.
When does an elevator go up or down?
In a single-elevator system, it should go up, stopping at all requested floors on the way, until there are no more pending requests for higher floors, then it should service all of the down requests in descending order. The order in which the requests are submitted does not matter; the timing does matter, though.
Why do you need to do an elevator interview?
The interview reason for this task, is the intelligence in coordinating several elevators. As a normal user the behavior of an elevator is simple.
Why was I asked to design an elevator?
The interviewer asked me to design functions that should be used for designing an elevator.He just asked for the normal working not to go in very deep as time restriction was there. He was expecting me to provide the Data Structure that would be best suited, different classes & relationships between them, etc.
How does object oriented elevator design implementation work?
By putting them in separate functions, it isolates the particular I/O for your platform (which is likely to be unique to that platform or operating system) from the logic of the simulation (which does not depend on the underlying OS).
How to eliminate NUM _ of-reqs in elevator design?
That also answers your question about eliminating num_of_reqs: just keep accepting input until either the elevator can’t hold any more people or until the user indicates no more input such as by inputting a special sentinel value that indicates end of data. The use of std::vector::emplace_back everywhere in this program is peculiar.
What do you need to know about elevator design?
Doors openable. In short: let everyone survive a ride. Then with closed doors, with no buttons pressed for say 10 seconds, request the common intelligence/coordinator whether to go somewhere. It has to know where every elevator is, in which direction, with how much buttons pressed internally.
Do you need to make a better case for an elevator?
If anybody should be able to call them fine. If nobody but another object should call them you need to make a better case. Looking at it from a design perspective. In big buildings some lifts do not go to all floors. One of the things about elevators is that they usually come in banks and do not operate independently.