Code Monkey home page Code Monkey logo

bml_traffic_model's Introduction

Biham–Middleton–Levine traffic model

Self-organizing cellular automaton traffic flow model (wiki article).

Simple example:

Initial matrix:
picture

Resulting matrix:
picture

Requirements

Project was developed in Python 3.6 using basic libraries.
See requirements file for details.
To install all the libraries with preinstalled Python and pip cd to project's folder and run command in Terminal:

pip install -r requirements.txt

Running

Basic examples are shown in Jupyter Notebook. Running simulations in terminal:

python main.py -fcols 50 -frows 50 -d 40 -i 100 -p 1

where:
-fcols: number of fields' columns
-frows: number of fields' rows
-d: density
-i: number of iterations
-p: save plot flag

TODOs

  • add possibility to init various direction cars (+ to move left / up);
  • pass args to plot_matrix function to save plots with normal names.

Authors

License

This project is licensed under the MIT License - see the LICENSE file for details

bml_traffic_model's People

Contributors

nazariinyzhnyk avatar

Watchers

 avatar

Forkers

elizacarias

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.