Git Product home page Git Product logo

boarding-simulation's Introduction

Boarding Simulator

A simulation to test plane boarding methodologies in your terminal

Motivation

After watching a wonderfully informative and entertaining video on the frustrations of the existing methodologies for boarding a plane, I decided to build a simulation to model some of the methodologies to the test

Requirements

  • Node 11.0+ Due to V8 7.0 bringing a stable sort implementation to Array.sort
    • Request: use lodash sortby() to circumvent stable sort issue

How to use

Boarding Simulator runs in your terminal and uses a json file to configure the simulation. Run node ./dist/index.js to run the simulation with the default configuration Pass in a path to a configuration json to use those settings: node ./dist/index.js path/to/my/settings.json

The config file

passengerCount: number

Number of passengers that will be assigned seats. Will be limited to the maximum seats available

rows: number

Number of seat rows in the plane


columnsPerSide: number

Number of seat columns per side of the plane. Ex: 3 columnsPerSide = 6 columns total


boardingGroups: number

Number of boarding groups to divide the rows by


stepsBerBag: number

Number of steps it takes to stow a single bag


bagMin: number

Minimum number of bags that a passenger may carry


bagMax: number

Maximum number of bags that a passenger may carry


seatShufflePenalty: number

Steps it takes for a person to bypass an already seated passenger to get to assigned seat


sortStrategyName: string

Strategy to sort passengers by. See Sorting Strategies for a list of available strategies


showRowNumbers: boolean


showColumnNumbers: boolean


showBoardingGroups: boolean

(not implemented)


showLog: boolean

(not implemented)


animate: boolean

Sets the simulation mode.

  • true Animation mode
  • false Average mode

simulationRuns: number

Times that the simulation will be run. Only used when in Average mode, i.e animate: false


fps: number

Framerate of the simulation. Only used when in Animation mode, i.e animate: true


Sorting Strategies

alternatingRows

backToFront

backToFrontRow

bySide

fastest

frontToBack

frontToBackRow

isleToWindow

random

slowest

windowToIsle

Simulation Mode

The simulator can run in two distinct modes:

Animation mode: Runs a single simulation and displays an animation in the terminal

Average mode: Runs the simulation without animating then returns an summary of all simulations run. Runs the simulation as many times as provided by the provided siumulationRuns value

Building

TBD

boarding-simulation's People

Contributors

prplchang avatar bits-by-brandon avatar

Stargazers

Don Page avatar  avatar Brian Perry 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.