GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - ngautam0/elevator-system: elevator system coded with python

BranchesTags
Open more actions menu

Latest commit

 

History

4 Commits
4 Commits

Folders and files

NameName
Last commit message
Last commit date
code
code
 
 
img
img
 
 
.gitignore
.gitignore
 
 
README.md
README.md
 
 
README.md.html
README.md.html
 
 
req.txt
req.txt
 
 

Repository files navigation

Elevator System - Python

Problem Solved:

  • An elevator system, which can be initialized with n elevator.

  • When provided input as below, it processes each request, based on simple cost functions.

  • Input can be edited in ./code/run.py.

  • Each elevator has below capabilites :

    • Move Up and Down
    • Open and Close Door
    • Start and Stop Running
    • Display Current Status
    • Decide weather to move up or down, given a list of request
  • Elevator System takes care of :

    • Creation of system with an array of objects of elevator.
    • Decides which lift to associate which floor.
    • Marks which elevator is available or busy.
    • Can mark which elevator is operational and which is not.

ASSUMPTION:

  • Elevator System has got only one button per elevator outside the elevator.

  • So if there are a total of 5 elevators, there will be 5 buttons.

  • Note that, this dosent not mimic real world, when you would have a total of 10 buttons for 5 elevators ( one for up and one for down)

  • Once the elevator reaches its called point, then based on what floor is requested, it moves either up or down.

How to Run:

  1. [OPTIONAL] - Create and activate a python3 virtualenv.

  2. Install requirements mentioned in req.txt :

    pip install -r req.txt

  3. Change directory to code :

    cd code

  4. [OPTIONAL] - Change the params in ./code/run.py

  5. python run.py

Imporvements:

  1. Error handling could be improved.

  2. Take input from user / config file rather than hardcoding it.

  3. Enhance system to have better cost functions.

Default Input Details :

  1. active_floors = [5,-2,7,9,10, 9, 12, -1] - List of floors on which button outside elevator was pressed.

  2. lift_positions = [9,10,5,0,4] - Current elevator postion, this represents 5 elevator currently standing @ floor 9, 10, 5, 0 and 4.

  3. no_of_lifts, floor_min, floor_max = 5, -4, 20 - Number of lifts in the system, min floor, max floor

  4. request_each = [[-3,12, 8, 6 ,4 ,0, 5], [-3,0, 5], [4,0, 5], [8, 6 ,4 ,0, 5], [2,4,8,10,12]]

A 2d list to mimic buttons pressed / request to go in each elevator.

Output of Default Input:

  • [Output cropped].

About

elevator system coded with python

Topics

elevator-problemelevator-simulationpythonpython-3

Resources

Readme
Activity

Stars

5 stars

Watchers

0 watching

Forks

8 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.