Skip to main content

DSF C++ core with Python bindings via pybind11

Project description

DynamicalSystemFramework

Latest Release PyPI version DOI

Standard TBB SPDLOG CSV JSON SQLite codecov

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, spdlog, csv-parser and SQLiteCpp. To install requirements on Ubuntu:

sudo apt install cmake libtbb-dev

To install requirements on macOS:

brew install cmake tbb

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 tbb installed:

sudo apt install libtbb-dev

Then, the installation is automatic via uv:

uv build

or you can just use the classic 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.

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) --output-on-failure

Benchmarking

Some functionalities of the library have been benchmarked in order to assess their efficiency.
The benchmarks are performed using Google Benchmarks. To build the benchmarks add the flag -DDSF_BENCHMARKS=ON :

cmake -B build -DDSF_BENCHMARKS=ON
cmake --build build -j$(nproc)

To run all the benchmarks together use the command:

cd benchmark
for f in ./*.out ; do ./$f ; done

Citing

@software{berselli_2026_18745492,
  author       = {Berselli, Gregorio},
  title        = {DynamicalSystemFramework},
  month        = mar,
  year         = 2026,
  publisher    = {Zenodo},
  doi          = {10.5281/zenodo.18745492},
  url          = {https://doi.org/10.5281/zenodo.18745492},
}

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dsf_mobility-5.8.5.tar.gz (151.4 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

dsf_mobility-5.8.5-cp314-cp314-win_amd64.whl (1.5 MB view details)

Uploaded CPython 3.14Windows x86-64

dsf_mobility-5.8.5-cp314-cp314-win32.whl (1.5 MB view details)

Uploaded CPython 3.14Windows x86

dsf_mobility-5.8.5-cp314-cp314-manylinux_2_28_x86_64.whl (2.1 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.28+ x86-64

dsf_mobility-5.8.5-cp314-cp314-macosx_15_0_arm64.whl (1.4 MB view details)

Uploaded CPython 3.14macOS 15.0+ ARM64

dsf_mobility-5.8.5-cp312-cp312-win_amd64.whl (1.5 MB view details)

Uploaded CPython 3.12Windows x86-64

dsf_mobility-5.8.5-cp312-cp312-win32.whl (1.5 MB view details)

Uploaded CPython 3.12Windows x86

dsf_mobility-5.8.5-cp312-cp312-manylinux_2_28_x86_64.whl (2.1 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

dsf_mobility-5.8.5-cp312-cp312-macosx_15_0_arm64.whl (1.4 MB view details)

Uploaded CPython 3.12macOS 15.0+ ARM64

File details

Details for the file dsf_mobility-5.8.5.tar.gz.

File metadata

  • Download URL: dsf_mobility-5.8.5.tar.gz
  • Upload date:
  • Size: 151.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for dsf_mobility-5.8.5.tar.gz
Algorithm Hash digest
SHA256 8bfa55a92e9db38bfd4dc71913a68073bbb7a6483f5e375dbde88a7bb01a23a8
MD5 7f6843fa6830e2f4c73ad2c4b91a7870
BLAKE2b-256 0d62c4f64755dba8e10420645f76a96e32c1cfcd09dcdeddc6feee76c38127f0

See more details on using hashes here.

File details

Details for the file dsf_mobility-5.8.5-cp314-cp314-win_amd64.whl.

File metadata

File hashes

Hashes for dsf_mobility-5.8.5-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 b916a6762d6dc2cee8fc3d5ec8c28cb517806806becd51116c1f77b42b3f8d1f
MD5 bcdf04211a7a7eaa9b021af55b62bc67
BLAKE2b-256 8992ef30f068238352ffa59276b734ccf68f7437c21e895442021497d5ac57b8

See more details on using hashes here.

File details

Details for the file dsf_mobility-5.8.5-cp314-cp314-win32.whl.

File metadata

  • Download URL: dsf_mobility-5.8.5-cp314-cp314-win32.whl
  • Upload date:
  • Size: 1.5 MB
  • Tags: CPython 3.14, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for dsf_mobility-5.8.5-cp314-cp314-win32.whl
Algorithm Hash digest
SHA256 881a3179dd47d4c5caf6aa4ebd411db676fb1a3be1aa0f5285114ac93528fe6c
MD5 90e6654cef465c2748c9439dfa1f97d2
BLAKE2b-256 6225f3083c6e180955a6b5885ba1dbcc2bb3ef800cdc9095c37db0e1819694fd

See more details on using hashes here.

File details

Details for the file dsf_mobility-5.8.5-cp314-cp314-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for dsf_mobility-5.8.5-cp314-cp314-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 dd08a52db020b9897dff9b6021b48c611c229da21542276020cc8f11bce0859c
MD5 34ddb7eaf473fae58ac6b868b7feb7c6
BLAKE2b-256 2f4b9d400fee0803ca8550f6dac856f35aca425edf76f6e9c5fca9639ca5c058

See more details on using hashes here.

File details

Details for the file dsf_mobility-5.8.5-cp314-cp314-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for dsf_mobility-5.8.5-cp314-cp314-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 c506789e0ed9b765725c645b165e3c2f7dc0777b65a1f45e9728af7e6b0adf3a
MD5 f040b08e22016e32ec00bb4ee626613c
BLAKE2b-256 51e960a7b357cf3530be46fbb9a291c93ed42093020ae8d3b8552698f7ff9413

See more details on using hashes here.

File details

Details for the file dsf_mobility-5.8.5-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for dsf_mobility-5.8.5-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 0e247c23c316acd6017437b1b17b5d077064367f9870440cd2ce6ef452bd2486
MD5 d66a63047e462869e58923745c3ff706
BLAKE2b-256 3247bcb407cbb2507e9779eb5670bdeb2df7d6d4129d990b4ea1f50e73abcb2a

See more details on using hashes here.

File details

Details for the file dsf_mobility-5.8.5-cp312-cp312-win32.whl.

File metadata

  • Download URL: dsf_mobility-5.8.5-cp312-cp312-win32.whl
  • Upload date:
  • Size: 1.5 MB
  • Tags: CPython 3.12, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for dsf_mobility-5.8.5-cp312-cp312-win32.whl
Algorithm Hash digest
SHA256 00072044d226fc519938714acdd4589ba8d69b247a9e1ea43bf6eb974b788d6d
MD5 bd6ca05effcf8e5c0c6ad229696d2beb
BLAKE2b-256 5d51d1a838cbce4cc1213cc001b3d2d325267b5ce6c2c71ed313eded49f8eb34

See more details on using hashes here.

File details

Details for the file dsf_mobility-5.8.5-cp312-cp312-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for dsf_mobility-5.8.5-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 7d6c46b941e70cded69f2d75216f3975ea2dafc5cbbe28f2d7d4728c55e7a18e
MD5 641efa214548cc9cfb145b35eec5f351
BLAKE2b-256 584867e109bebc96423ad8ca8a7ecd769c42421d70fe416737894bda75460abc

See more details on using hashes here.

File details

Details for the file dsf_mobility-5.8.5-cp312-cp312-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for dsf_mobility-5.8.5-cp312-cp312-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 baf62297069383678cead234bc00f263c9a2f595704137279499ee831af577d6
MD5 cef035f464d9dcf9344cb7fff1338425
BLAKE2b-256 8942bd80b7711b0baaa70d04782ba4afce34e288693ed8560b0e231f3d3f8ab7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page