Code Monkey home page Code Monkey logo

bbs-elevator's Introduction

bbs-elevator

Setup

Download project: git clone https://github.com/BBS-SonyIstanbul/bbs-elevator.git

Import project to your workspace via Gradle or Maven

  • Run gradle clean build or
  • Run mvn clean install

Check if everything is running fine:

Run KillMeTest.groovy

Description

We all have been crazy about waiting elevators at least once or twice. Here is a sample code waiting for you to configure as your desired elevator logic.

  • Elevator, Passenger are simple objects which have obvious functionalities.
  • ElevatorLogic can deal with multiple elevators and open for your implementation as MyElevatorLogic
  • Chrone indicates time changes in the logic. Please note that elevators are working as synchronized.
  • Metric is being used for keeping the track of time.

Goal

Multiple algorithms can be carried out for different goals of elevator system (eg. Least move of elevator, shortest waiting time for passenger, shortest lead time for passenger etc.)

Specifically for this Code Kata Session, we will be aiming for shortest lead time for passengers which means difference between calling an elevator and getting off one.

At the end of Kata Session, we all will be running ChroneSimulator to see whose output will be indicating shortest lead time.

Hint: Number of elevators is up to you!

Execution

Please note that;

This is a 30 floor apartment which passengers mostly use floor 0 to embark/disembark! Usage of elevators are weighted due to time of the day as:

  • Between hours 0 and 1 weight is 10
  • Between hours 1 and 7 weight is 5
  • Between hours 7 and 9 weight is 30
  • Between hours 9 and 17 weight is 10
  • Between hours 17 and 20 weight is 30
  • Between hours 20 and 24 weight is 15 Simulator will run for 5 days with 1000 passenger a day...

You can use MyElevatorLogic.groovy with Groovy or Java

bbs-elevator's People

Contributors

bbs-sonyistanbul avatar

Watchers

James Cloos avatar hadican 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.