Skip to content

nazariinyzhnyk/bml_traffic_model

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Python3 bml model implementation.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published