Giter VIP home page Giter VIP logo

elevator_firstpass's Introduction

ELLevator ReadMe

Potential Engineer Interview Submission

Summary

This project simulates the behavior of a single elevator.

Languages and Libraries Used
  • Python 3.7
Files Included
  • main.py
  • ellevator.py
  • readme.md

How to Run

  • Be sure you have installed Python 3.7 or higher and all files listed above are in the same directory
  • In a Terminal shell, navigate to the directory chosen in the above step
  • Type the command:
python3 main.py
  • You will see text output in your terminal giving status info and prompting you for input. Respond accordingly
  • Alternatively, you can run this from an environment of your choice. You will still run main.py to inititate the program

Assumptions, Limitations, and Decisions Made

Assumptions
  • When finished with its list of requests, the Elevator should return to the first floor (or lobby)
  • There is only one Elevator
  • There is only one master queue, which exists outside of and is accessed by the Elevator
  • The Elevator accepts an input of (floor, direction) from the 'outside'. This summons the Elevator.
  • The Elevator accepts an input of (floor, exit) from the 'inside'. This is logged as a destination.
Decisions
  • The Elevator moves incremenetally up and down along a list of integers between and including a provided minimum and maximum floor number. At each floor, the Elevator will decide if it should stop.
  • The Elevator will stop at a floor if there exists an external summon request for the current floor in the same direction the Elevator is already traveling
  • The Elevator will stop at a floor if there exists an internal request for the current floor, regardless of direction
  • The Elevator will not stop at a floor if there exists an external summon request for the current floor in the opposite direction the Elevator is already traveling
Limitations (personal and technical)
  • The Elevator can only accept input while the doors are open.
  • The Elevator's behavior is hard-coded at the moment. It cannot quickly become another flavor of Elevator.
  • The Elevator currently checks direction and if it should open its doors twice. This is in response to the decisions outlined above. I imagine there is a more efficient way to ensure the Elevator turns around at the top or bottom of its path, but I kept things simple for my and your (mostly my) sanity.

elevator_firstpass's People

Contributors

melissaragonese avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.