Skip to content

Latest commit

 

History

14 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

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

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages