Coder Social home page Coder Social logo

singuerinc / subway Goto Github PK

View Code? Open in Web Editor NEW
12.0 4.0 3.0 1.25 MB

A metro/subway flow simulation.

Home Page: https://subway-singuerinc.netlify.app/

License: MIT License

HTML 0.96% TypeScript 99.04%
typescript pixijs subway simulation trains

subway's Introduction

Subway

A metro/subway flow simulation.

Demo

Subway

About

I am quiet a fan of transportation systems. I used to play a lot to OpenTTD: an open source version of Transport Tycoon.

I was always fascinated by the (almost) perfect synchronization that the train systems have.

Logic

A few statements about this experiment:

  • There is no API connected to the app: I was considering the idea of using an API to get the data, but the problem is that it becomes a "visualization" rather than a simulation.

  • It is based on the Barcelona subway net, but can be easely modified to display any system.

  • It includes a simple "AI":

    • Trains unload and load cargo on each station
    • Trains decide when to wait or enter to a waypoint/station by status (free/occupied)
    • Trains have a predefined itinerary and routes that have to follow
    • Stations get cargo (passengers) to be delivered to other stations
    • Trains have different capacity (1, 2, 3 or more wagons)
    • Trains max speed is affected by the cargo and the size of the train
    • Trains may have failures (not yet implemented)

Tech

I created this project as a fun way to learn a bit more about Typescript and PIXI.js

Other cities

The simulation is fixed to display the Barcelona subway, but it is very easy to change to any city, you just need to define a Subway line and the coords for each station. Take a look the src/lines folder.

License

See the LICENSE file for license rights and limitations (MIT).

subway's People

Contributors

dependabot-preview[bot] avatar dependabot[bot] avatar singuerinc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

subway's Issues

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.