Un simulateur modulaire pour modéliser et analyser le trafic routier
Project description
Simulateur de Trafic Routier Intelligent
Un simulateur modulaire pour modéliser et analyser le trafic routier, développé dans le cadre d'un projet Python orienté objet.
Structure du Projet
simulateur_trafic/
├── main.py # Point d'entrée principal
├── models/ # Modèles de base
│ ├── vehicule.py # Classe Vehicule
│ ├── route.py # Classe Route
│ └── reseau.py # Classe ReseauRoutier
├── core/ # Modules core
│ ├── simulateur.py # Classe Simulateur principale
│ ├── analyseur.py # Classe Analyseur pour les statistiques
│ └── exceptions.py # Exceptions personnalisées
├── io/ # Modules d'entrée/sortie
│ ├── affichage.py # Affichage console
│ └── export.py # Export JSON/CSV
├── tests/ # Tests unitaires et d'intégration
│ ├── conftest.py # Fixtures pytest
│ ├── test_vehicule.py
│ ├── test_route.py
│ ├── test_reseau.py
│ └── test_simulateur.py
└── data/ # Données de configuration
└── config_reseau.json
Installation
- Créer et activer l'environnement virtuel :
# Créer l'environnement virtuel
python3 -m venv venv
# Activer l'environnement virtuel
# Sur macOS/Linux :
source venv/bin/activate
# Sur Windows :
# venv\Scripts\activate
- Installer les dépendances :
pip install -r requirements.txt
Utilisation
Lancer la simulation
python main.py
Ou depuis Python :
from core.simulateur import Simulateur
simu = Simulateur(fichier_config="data/config_reseau.json")
simu.lancer_simulation(n_tours=60, delta_t=60)
Exécuter les tests
pytest tests/
Avec couverture de code :
pytest tests/ --cov=simulateur_trafic --cov-report=html
CI/CD
Le projet utilise GitHub Actions pour l'intégration continue :
- CI : Tests automatiques sur chaque push/PR
- Tests : Matrice de tests sur plusieurs OS (Ubuntu, macOS, Windows) et versions Python (3.9-3.12)
- Lint : Vérification du code avec flake8 et pylint
Les workflows sont définis dans .github/workflows/.
Fonctionnalités
- Modélisation : Routes, véhicules, réseau routier
- Simulation : Évolution temporelle du trafic
- Statistiques : Vitesses moyennes, zones de congestion, temps de parcours
- Export : Rapports JSON et CSV
- Tests : Suite complète de tests unitaires et d'intégration
- Gestion d'erreurs : Exceptions personnalisées et validation des données
Configuration
Le fichier data/config_reseau.json permet de configurer :
- Les routes (nom, longueur, limite de vitesse)
- Les véhicules (identifiant, route, position initiale, vitesse)
Auteurs
Projet développé dans le cadre d'un TP Python.
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 Distribution
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 simulateur_trafic_ysf-1.0.0.tar.gz.
File metadata
- Download URL: simulateur_trafic_ysf-1.0.0.tar.gz
- Upload date:
- Size: 12.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4f722555fceb86dbb5de7541706c2d4101a867fc9456d1c303b2b4c459e3c4e8
|
|
| MD5 |
1f7ac575bcb495f7e22eb8d0cab1d5ba
|
|
| BLAKE2b-256 |
11e299bf1918f978fd78153b2b98e5328bcc3511bd7cdbc4fbaa714289441381
|
Provenance
The following attestation bundles were made for simulateur_trafic_ysf-1.0.0.tar.gz:
Publisher:
publish.yml on Jojoussef/simulateur_trafic
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
simulateur_trafic_ysf-1.0.0.tar.gz -
Subject digest:
4f722555fceb86dbb5de7541706c2d4101a867fc9456d1c303b2b4c459e3c4e8 - Sigstore transparency entry: 680692965
- Sigstore integration time:
-
Permalink:
Jojoussef/simulateur_trafic@a1c1408918adbd07e6449f9ccf7378f0a1669f45 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Jojoussef
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@a1c1408918adbd07e6449f9ccf7378f0a1669f45 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file simulateur_trafic_ysf-1.0.0-py3-none-any.whl.
File metadata
- Download URL: simulateur_trafic_ysf-1.0.0-py3-none-any.whl
- Upload date:
- Size: 12.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2e719b3a10c5fca114b2b74d22ac139fca50b3701f5f9b50fb4a875fa2e6d92a
|
|
| MD5 |
9f0d61317ab774e9a744521a33754ae7
|
|
| BLAKE2b-256 |
7207474a0689b79e198c8a39e0f9c205c5ec239fcfe41bc3c459c57f75b1d535
|
Provenance
The following attestation bundles were made for simulateur_trafic_ysf-1.0.0-py3-none-any.whl:
Publisher:
publish.yml on Jojoussef/simulateur_trafic
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
simulateur_trafic_ysf-1.0.0-py3-none-any.whl -
Subject digest:
2e719b3a10c5fca114b2b74d22ac139fca50b3701f5f9b50fb4a875fa2e6d92a - Sigstore transparency entry: 680693013
- Sigstore integration time:
-
Permalink:
Jojoussef/simulateur_trafic@a1c1408918adbd07e6449f9ccf7378f0a1669f45 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Jojoussef
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@a1c1408918adbd07e6449f9ccf7378f0a1669f45 -
Trigger Event:
workflow_dispatch
-
Statement type: