Skip to main content

DSF C++ core with Python bindings via pybind11

Project description

DynamicalSystemFramework

Latest Release PyPI version Standard TBB SPDLOG CSV JSON 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, 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


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-4.0.2.tar.gz (121.1 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-4.0.2-cp312-cp312-manylinux_2_39_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.39+ x86-64

dsf_mobility-4.0.2-cp312-cp312-macosx_15_0_arm64.whl (814.4 kB view details)

Uploaded CPython 3.12macOS 15.0+ ARM64

dsf_mobility-4.0.2-cp310-cp310-manylinux_2_39_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.39+ x86-64

dsf_mobility-4.0.2-cp310-cp310-macosx_15_0_arm64.whl (810.7 kB view details)

Uploaded CPython 3.10macOS 15.0+ ARM64

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

Hashes for dsf_mobility-4.0.2.tar.gz
Algorithm Hash digest
SHA256 818e64ef66951ae7c4bbd8a7a894fdeb6cc66aaac848316949fd382ef1f8c28c
MD5 0e5944625352bc0eab92c1df251f7e18
BLAKE2b-256 678ea86aa6734367e3769348d19f28c37c67a246ec2e08268dec1841b123abab

See more details on using hashes here.

File details

Details for the file dsf_mobility-4.0.2-cp312-cp312-manylinux_2_39_x86_64.whl.

File metadata

File hashes

Hashes for dsf_mobility-4.0.2-cp312-cp312-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 f21243e5a8b4e570dc854d984b65fb35dcda413bdc83018e67e2d26ad7582bf8
MD5 a641732eb682c608107392b4eb9c34e2
BLAKE2b-256 6afe984deb8e848a4c340a3e4c9c7634162a61982c3ff230f8ea615317fc72f0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dsf_mobility-4.0.2-cp312-cp312-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 f7e4f66b1393e1a4a0f8df622a8e4fadbad29b08963dcc7624214b5d05cdc5d6
MD5 7101460478fd8776a8dbb71a35a721b3
BLAKE2b-256 700bfb00cc8ab8721b9d42b5667fecb90d0fdafb54bf90741287b6bb0bb3e36b

See more details on using hashes here.

File details

Details for the file dsf_mobility-4.0.2-cp310-cp310-manylinux_2_39_x86_64.whl.

File metadata

File hashes

Hashes for dsf_mobility-4.0.2-cp310-cp310-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 4dec15d3d4149bc2909481dbd9bf0b55e2facc1203d1b5c3c8cdc25d8080ac18
MD5 37897181e8ff9dd72804e5bc3e6bcf0c
BLAKE2b-256 a499b97ec30ae00c10832263f56474b3d99f6c4e8e310be21a733532bec84ef8

See more details on using hashes here.

File details

Details for the file dsf_mobility-4.0.2-cp310-cp310-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for dsf_mobility-4.0.2-cp310-cp310-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 dd2c70f8bbbb96e00bdd454c8124a246325849a4a4a2df14b623af91c2955269
MD5 b760b9cee74992759fe200501a128b0d
BLAKE2b-256 8f73f01206d0bc784467b52a1e5beaf90efde6ef337b49007950526bf3c16250

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