GithubHelp home page GithubHelp logo

arundle01 / lift-algo-sim Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 34 KB

Simulation of two different Lift Algorithms in Python 3.8. This is a piece of coursework done for the Data Structures & Algorithms module, and thus is not guaranteed to function or be secure. Use at own risk.

License: MIT License

Python 100.00%
university coursework simulation lift-algorithms

lift-algo-sim's Introduction

lift-algo-sim

Simulation of two different Lift Algorithms.

GitHub GitHub repo size GitHub top language GitHub language count

What is this project?

This repository contains the code for one of my University projects. This project was for the Data Structures and Algorithms module and concerned the simulation of lifts (elevators). For a video example see this video.

The Naïve Lift

The original specification required a basic (sometimes referred to as Naïve) lift system wherein the lift has a set capacity of six people and could only move up or down. This lift could only change directions when it had reached the top or bottom floor; this is an attempt to model original mechanical lifts.

The Improved Lift

The specification also required an algorithm written by the student that was, in some form or another, more efficient than the Naïve lift. My improved code is based on the SCAN disk scheduling algorithm (sometimes referred to as The Elevator algorithm) wherein the Lift can now change direction anywhere, on any floor. However, it is always checking for:

  • people in the floors ahead of the lift (if it is going up, it checks for people further up the building.)
  • people in the lift that need to be delivered ahead of the lift

If either of these conditions are met, it continues in its current direction. If neither are met, then it will change directions and continue the other way.

What does each file do?

See below a list of functionality:

  • animation.py : Defines all animation subroutines for use in animating the lifts.
  • graphing.py : Takes the output of statistics from the lifts and makes scatter graphs.
  • gui.py : Creates the menu GUI for users to select number of floors and population.
  • improved_algorithm.py : The decision algorithm for the Improved lift; outputs statistics.
  • naive_algorithm.py : The decision algorithm for the Naïve lift; outputs statistics.
  • main.py : Run this to start the whole program.

Can I use this code?

I mean, if you really want to. This code was made to fit the specification under a time pressure so isn't the nicest to look at or work with. As this is an old University Project, this is unlikely to be supported unless someone desperately wants to use it (in that case, contact me first and I'll see what I can do).

Requirements

This code was written in Python 3.8.0 and uses Pygame 1.9.6

lift-algo-sim's People

Contributors

arundle01 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.