Skip to content

TheMariuolo/traffic_simulation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

14 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Random walk traffic simulation ๐ŸŒ‡๐Ÿš—๐Ÿš™

Python implementation of a traffic simulation using a random walk over a graph. Scripts in this repository allow to perform a simulation with two dynamics: synchronous and asynchronous dynamics. A more detailed description of the simulation and those two dynamics can be found in the pdf Arise of congestion.

Installation

To start using the repository, first clone it:

git clone https://github.com/MassimoMario/traffic_simulation.git

Requirements

This project requires Python โ‰ฅ 3.8 and the following libraries:

  • numpy
  • matplotlib
  • tqdm
  • networkx
  • geopandas

To install them you can run on the Bash:

pip install -r requirements.txt

Usage and examples

The main script simulation.py can be runned from the command line providing different argument ending in different configuration.

As an example you can run:

python simulation.py --file my_file.geojson --n_max 10 --tc 3 --n_steps 100 --load 3 --dynamics sy

The dynamics argument is a string an allows only 'asy' and 'sy' values for asynchronous and synchronous dynamics.

โš ๏ธ The output of the simulation script are plots of the input network, its degree histogram, the probability distribution of node state and the deviations occurrence.

โš ๏ธโš ๏ธโš ๏ธReplace my_file.geojson with your actual file .geojson :) .

โ„น๏ธ Help

For a complete list of parameters and their descriptions, run:

python simulation.py --help

Repository structure

The repository contains the following folders and files:

About

Python implementation of a traffic simulation using a random walk over a graph.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages