The aim of this project is to rework the original Traffic Flow Dynamics Model. This rework consists of a full code rewriting, in order to implement more features (like intersections) and get advantage from the latest C++ updates.
The library is available on PyPI:
pip install dsf-mobilityTo check the installation you can simply run
import dsf
print(dsf.__version__)The project requires C++20 or greater, cmake, tbb simdjson, spdlog and rapidcsv.
To install requirements on Ubuntu:
sudo apt install libtbb-dev libsimdjson-dev cmakeTo install requirements on macOS:
brew install tbb simdjson cmakeUtilities are written in python. To install their dependencies:
pip install -r ./requirements.txtThe library can be installed using CMake. To build and install the project in the default folder run:
cmake -B build -DCMAKE_BUILD_TYPE=Release && cmake --build build -j$(nproc)
sudo cmake --install buildOtherwise, it is possible to customize the installation path:
cmake -B build -DCMAKE_INSTALL_PREFIX=/path/to/installthen building and installing it (eventually in sudo mode) with:
cmake --build build
cmake --install buildIf you want to use the library from Python, you can build the Python bindings using pybind11. Make sure you have Doxygen installed to generate the docstrings:
sudo apt install doxygenThen, the installation is automatic via pip:
pip install .After installation, you should be able to import the module in Python:
import dsf
print(dsf.__version__)If you encounter issues, ensure that the installation path is in your PYTHONPATH environment variable.
This project uses Doctest for testing.
If the project is compiled in Debug or Coverage mode, tests are always built.
Otherwise, you can add the -DDSF_TESTS=ON flag to enable test build.
cmake -B build -DDSF_TESTS=ON
cmake --build build -j$(nproc)To run the tests use the command:
ctest --test-dir build -j$(nproc)Some functionalities of the library have been benchmarked in order to assess their efficiency.
The benchmarks are performed using a small toolkit developed by @sbaldu, in order to keep them simple and
without needing to rely on large external libraries.
To compile the benchmarks use the commands:
cd benchmark
cmake -B build && make -C buildTo run all the benchmarks together use the command:
for f in ./*.out ; do ./$f ; done@misc{DSF,
author = {Berselli, Gregorio and Balducci, Simone},
title = {Framework for modelling dynamical complex systems.},
year = {2023},
url = {https://github.com/physycom/DynamicalSystemFramework},
publisher = {GitHub},
howpublished = {\url{https://github.com/physycom/DynamicalSystemFramework}}
}- Mungai, Veronica (2024) Studio dell'ottimizzazione di una rete semaforica. University of Bologna, Bachelor's Degree in Physics [L-DM270]. Link to Thesis.
- Berselli, Gregorio (2024) Advanced queuing traffic model for accurate congestion forecasting and management. University of Bologna, Master's Degree in Physics [LM-DM270]. Link to Thesis.
- Berselli, Gregorio (2022) Modelli di traffico per la formazione della congestione su una rete stradale. University of Bologna, Bachelor's Degree in Physics [L-DM270]. Link to Thesis.