Saturday, November 10, 2012

Object Oriented design for Elevator in a multi-storied apartment

Object Oriented design for Elevator in a multi-storied apartment

Below is the design for an elevator in a multi-storied building.

A typical lift has buttons(Elevator buttons) inside the cabin to let the user who got in the lift to select his/her desired floor.Similarly each floor has buttons (Floor buttons) to summon the lift to go floors above and floor below respectively. The buttons illuminate indicating the request is accepted. And the lift reaches the requested floor the button stops illuminating.

Use cases:
User

  • presses the floor button to summon the lift
  • presses the elevator button to make the lift move to the desired floor


Floor Button/Elevator Button

  • illuminates when pressed
  • places a elevator request when pressed
Elevator
  • Moves up/down as per instruction
  • Opens/closes the door
Each button press results in an elevator request which has to be served. Each of these requests is tracked at a global place. ElevatorRequests, the class which stores elevator requests can use different strategies to schedule the elevator requests. The elevator is controlled by a controller class which we call ElevatorController. The elevator controller instructs the elevator what to do and also can shutdown/start up the elevator of the building. The elevator controller reads the next elevator request to be processed and serves it. 







Button is abstract class defining common behavior like illuminate, doNotIlluminate. FloorButton, ElevatorButton extend Button type and define placeRequest() which is invoked when the button is pressed. Both the floor button presses and elevator button presses adds requests at a common place.
ElevatorController runs the show by reading the next request to process and instructing the elevator what to do.


How can we extend this to multiple elevators in a sky scraper

In the single elevator scenario, there is an elevator and an elevator controller and a common area where the floor requests and the elevator button request are stored and processed as per the scheduling algorithm.

To extend this to multiple elevators, each elevator will have a corresponding elevator controller. Floor based requests can be served by any elevator where as elevator button requests will be served by the elevator in which the button is pressed.

FloorButton's placeRequest adds a request to the common area which is accessible to all controller. ElevatorButton's placeRequest adds a request to the controller's internal queue as only one elevator is supposed to serve it.

Each elevator controller runs as a separate thread and checks on if it can process a floor request along with processing requests made by its own elevator button presses.

29 comments:

  1. Good summary. Have one question: for multiple elevators scenario, where the common queue and internal queue should be added?

    ReplyDelete
    Replies
    1. I thought the common queue is added in ElevatorRequest, and the internal queue is added in controller for each elevator.

      Delete
  2. Nice schemes and idea, you should try to do some innovations in lift configurator

    ReplyDelete
  3. Nice information. Thanks for sharing.
    Jaimini Elevators & Escalators pvt.ltd. is a Leading Designer and Manufacturer of Glass Lift, Hospital Lift, passenger lift and goods lift in delhi, India. Jaimini Elevators provides excellent services like Lift Installation, Lift Manufacture, Lift Maintenance, Lift Repairing etc.hospital lift service providers in delhi Hospital lift suppliers in delhi hospital lift manufacturer in delhi

    ReplyDelete
  4. lift buttonsWe provide the best lift buttons maintenance & manufacturing service in China. We are famous manufacturers, offering quality and cheap elevator panel parts.

    ReplyDelete
  5. This is really nice to read content of this blog.
    We ate manufactures and suppliers Lift manufacturer company in Delhi NCR.
    http://www.spaceelevators.org

    ReplyDelete
  6. mcafee.com/activate registered trademarks, company names, product names and brand names are the property of their respective owners, and mcafee.com/activate disclaims any ownership in such third-party marks. The use of any third party trademarks, logos, or brand names is for informational purposes only, and does not imply an endorsement by mfmcafee.com or vice versa or that such trademark owner has authorized mfmcafee.com to promote its products or services.


    office.com/setup is an independent support and service provider for the most secure remote technical services for all Office products. Our independent support services offer an instant support for all software related errors in the devices, laptops, desktops and peripherals. We have no link or affiliation with any of the brand or third-party company as we independently offer support service for all the product errors you face while using the Office. If your product is under warranty, then you may also avail our support services for free from manufacturer’s official website office.com/setup.

    mcafee.com/activate is an independent support and service provider for the most secure remote technical services for all norton products. Our independent support services offer an instant support for all software related errors in the devices, laptops, desktops and peripherals. We have no link or affiliation with any of the brand or third-party company as we independently offer support service for all the product errors you face while using the norton. If your product is under warranty, then you may also avail our support services for free from manufacturer’s official website norton.com/setup.

    ReplyDelete
  7. Awesome post. It was so informative and keep sharing. You organise it very well. Home lifts India

    ReplyDelete
  8. Civil Lab Equipment Manufacturer is the leading Manufacturer, Supplier and Exporter of Civil Engineering Lab Equipments or instruments. Established in 2005.

    Mob: +91-9891445495, +91-8448366515, +918587026175
    Phone : +91-11-23657121
    Website : http://setestindia.com, http://civillabequipmentmanufacturer.com/

    ReplyDelete
  9. Are you tired of taking hundreds of stairs every day to reach your office or apartment? Do you want to install high-quality Automatic lifts Pakistan? Are you looking for different kinds of lifts at one reliable place? Well, then you have landed at the right place. Our company has been working for years to supply top-quality and reliable Home elevators in Pakistan.

    ReplyDelete
  10. Civil Lab Equipment Manufacturer offer a comprehensive range of oil and petroleum testing lab equipments, which are widely used in Schools, Colleges and

    Universities. We offer a wide range of Civil Engineering Lab Equipments Manufacturers and Civil Engineering Lab Equipments Exporters in India.

    Website : http://civillabequipmentmanufacturer.com, http://www.setestindia.com


    Mob: +91-9891445495, +91-8448366515, +91-8587026175

    ReplyDelete
  11. This is such a great resource that you are providing and you it away for free. I love seeing blog that understand the value.
    Lifts Installation & Modification Services in Ghaziabad
    Lifts Installation & Modification Services in Delhi NCR

    ReplyDelete
  12. Great Blog, there is so much reality written in this content and everything is something which is very hard to be argued. Top notch blog having excellent content. Elevator Cabin

    ReplyDelete
  13. We are a quality conscious parts manufacturer, based in Narol area of Ahmedabad, Gujarat, India. We manufacture un-machined and machined grey cast iron castings from 200 grams to 120 kilograms.
    We have a full fledged machine shop having CNC lathes and vertical machining centres for precision machining of parts from various types of engineering materials like CI, alloy steels, stainless steel, engineering plastics, non ferrous metals.
    Elevator Parts manufacturing in Ahmedabad

    ReplyDelete
  14. Nice post! This is very informative and knowledgeable article that's way i would like to say thanks for your efforts you have made in this post
    Elevator Company in Dubai | Elevator Company in UAE

    ReplyDelete

  15. Yes, this is a good post without any doubt. You really do a great job. I am inspired by you, so keep it up!
    elevator companies in uae

    ReplyDelete
  16. Great post thanks for sharing this.I was looking this kind of info.
    Goods Passenger Lift In Delhi

    ReplyDelete
  17. Many home lift manufacturers and suppliers in Delhi but i would like to recommend Hybon Elevators. Hybon has lots of varition of lits like home lifts, capsule lifts, stretcger lifts, food lift, goods lift, and etc.

    ReplyDelete
  18. Hybon is the best home lift company in Delhi NCR, and they have a lot of space in their home elevators. Hydraulic lifts are larger than other models of elevator. Call 9138262626 to speak with Hybon experts about installing a home elevator.

    ReplyDelete
  19. Nice post! Thank you for sharing this insightful object-oriented design for elevators in a multi-storied building. It's crucial to ensure efficient and reliable vertical transportation systems.
    If you need expert advice or top-quality elevator solutions in Riyadh, Saudi Arabia, don't hesitate to contact MELSA (Mitsubishi Electric Saudi Ltd.) . We specialize in elevators that prioritize safety, performance, and modern design. Elevate your building's vertical transportation with MELSA. For more details: https://www.melsa.com.sa/products/elevators/

    ReplyDelete