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.

38 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. The ultra design luxury outdoor roof very beauty. major views is outdoor design work Using Aluminium Scaffolding To Finish the job.

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

    ReplyDelete
  6. 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
  7. 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
  8. Awesome post. It was so informative and keep sharing. You organise it very well. Home lifts India

    ReplyDelete
  9. 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
  10. Thank You Author!!! You are sharing the very informative and great post. If anyone out there is looking to book Cheapest Kerala Tour Packages for Couple with Best Price then don’t go beyond Indian Travel Store – “Your Trusted Partner in your Travel Journey.”

    ReplyDelete
  11. 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
  12. 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
  13. Spank me. It’s the only way I learn. Hey, i am looking for an online sexual partner ;) Click on my boobs if you are interested (. )( .)

    ReplyDelete
  14. 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
  15. 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
  16. 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
  17. Nice Blog Thanks for sharing the wonderful Blog. Elite Elevators are one of the best home home lifts company in Australia. home elevators
    Residential elevators
    Domestic Lifts
    H200 Home Lifts
    H100 Home Lifts

    ReplyDelete
  18. 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

  19. 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
  20. Download Cricket Mazza 11 for Android Live Line & Fastest IPL Score. Get Live Cricket Scores, Scorecard, Commentary, Match Info and Schedules of All International & Domestic Matches, Series wise Stats, Records, Analysis and Facts, Trending News and Tweets, Recent ICC Player and Team Rankings. Also Download live cricket score apps for ios, including Beach Cricket, Cricket T20 Fever 3D, Download Real Cricket mazza 11 and other Latest Cricket News, top answers suggested and ranked.

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

    ReplyDelete