DSF C++ core with Python bindings via pybind11
Project description
DynamicalSystemFramework
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.
Table of Contents
Installation
The library is available on PyPI:
pip install dsf-mobility
To check the installation you can simply run
import dsf
print(dsf.__version__)
Installation (from source)
Requirements
The project requires C++20 or greater, cmake, tbb simdjson, and spdlog (with fmt).
To install requirements on Ubuntu:
sudo apt install libtbb-dev libspdlog-dev libsimdjson-dev cmake
To install requirements on macOS:
brew install tbb simdjson spdlog cmake
Utilities are written in python. To install their dependencies:
pip install -r ./requirements.txt
Installation (C++)
The 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 build
Otherwise, it is possible to customize the installation path:
cmake -B build -DCMAKE_INSTALL_PREFIX=/path/to/install
then building and installing it (eventually in sudo mode) with:
cmake --build build
cmake --install build
Installation (Python)
If 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 doxygen
Then, 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.
Testing
This project uses Doctest for testing.
To compile tests you can simply add the flag -DDSF_BUILD_TESTS=ON when configuring the project with CMake:
cmake -B build -DDSF_BUILD_TESTS=ON
cmake --build build -j$(nproc)
To run the tests use the command:
ctest --test-dir build -j$(nproc)
Benchmarking
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 build
To run all the benchmarks together use the command:
for f in ./*.out ; do ./$f ; done
Citing
@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}}
}
Bibliography
- 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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dsf_mobility-4.0.2.tar.gz.
File metadata
- Download URL: dsf_mobility-4.0.2.tar.gz
- Upload date:
- Size: 121.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
818e64ef66951ae7c4bbd8a7a894fdeb6cc66aaac848316949fd382ef1f8c28c
|
|
| MD5 |
0e5944625352bc0eab92c1df251f7e18
|
|
| BLAKE2b-256 |
678ea86aa6734367e3769348d19f28c37c67a246ec2e08268dec1841b123abab
|
File details
Details for the file dsf_mobility-4.0.2-cp312-cp312-manylinux_2_39_x86_64.whl.
File metadata
- Download URL: dsf_mobility-4.0.2-cp312-cp312-manylinux_2_39_x86_64.whl
- Upload date:
- Size: 1.1 MB
- Tags: CPython 3.12, manylinux: glibc 2.39+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f21243e5a8b4e570dc854d984b65fb35dcda413bdc83018e67e2d26ad7582bf8
|
|
| MD5 |
a641732eb682c608107392b4eb9c34e2
|
|
| BLAKE2b-256 |
6afe984deb8e848a4c340a3e4c9c7634162a61982c3ff230f8ea615317fc72f0
|
File details
Details for the file dsf_mobility-4.0.2-cp312-cp312-macosx_15_0_arm64.whl.
File metadata
- Download URL: dsf_mobility-4.0.2-cp312-cp312-macosx_15_0_arm64.whl
- Upload date:
- Size: 814.4 kB
- Tags: CPython 3.12, macOS 15.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f7e4f66b1393e1a4a0f8df622a8e4fadbad29b08963dcc7624214b5d05cdc5d6
|
|
| MD5 |
7101460478fd8776a8dbb71a35a721b3
|
|
| BLAKE2b-256 |
700bfb00cc8ab8721b9d42b5667fecb90d0fdafb54bf90741287b6bb0bb3e36b
|
File details
Details for the file dsf_mobility-4.0.2-cp310-cp310-manylinux_2_39_x86_64.whl.
File metadata
- Download URL: dsf_mobility-4.0.2-cp310-cp310-manylinux_2_39_x86_64.whl
- Upload date:
- Size: 1.1 MB
- Tags: CPython 3.10, manylinux: glibc 2.39+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4dec15d3d4149bc2909481dbd9bf0b55e2facc1203d1b5c3c8cdc25d8080ac18
|
|
| MD5 |
37897181e8ff9dd72804e5bc3e6bcf0c
|
|
| BLAKE2b-256 |
a499b97ec30ae00c10832263f56474b3d99f6c4e8e310be21a733532bec84ef8
|
File details
Details for the file dsf_mobility-4.0.2-cp310-cp310-macosx_15_0_arm64.whl.
File metadata
- Download URL: dsf_mobility-4.0.2-cp310-cp310-macosx_15_0_arm64.whl
- Upload date:
- Size: 810.7 kB
- Tags: CPython 3.10, macOS 15.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dd2c70f8bbbb96e00bdd454c8124a246325849a4a4a2df14b623af91c2955269
|
|
| MD5 |
b760b9cee74992759fe200501a128b0d
|
|
| BLAKE2b-256 |
8f73f01206d0bc784467b52a1e5beaf90efde6ef337b49007950526bf3c16250
|