Multi-class ARZ traffic modeling + DQN signal control for motorcycle–car mixed traffic in West African urban corridors (data-scarce deployment pathway)
# Multi-Class ARZ + RL Traffic Signal Control (West Africa)
A reproducible Python implementation of a **multi-class macroscopic traffic model** (motorcycles + cars) coupled with **Deep Reinforcement Learning (DQN)** for adaptive signal control on a real 2×2 grid network extracted from OpenStreetMap.
This repository is the codebase associated with the paper:
> **A Multi-Class Macroscopic Traffic Model with Reinforcement Learning Signal Control for Heterogeneous Urban Networks in West Africa**
>
> Submitted to the *International Journal of Intelligent Transportation Systems Research* (Springer Nature).
## Why this project matters
Most RL traffic-signal papers assume data-rich environments (detectors, calibrated microsimulators, expensive tooling). This implementation demonstrates a practical pathway for **data-scarce cities**:
- model heterogeneous traffic (motos + cars) with a multi-class ARZ formulation,
- extract real urban topology from OpenStreetMap (Quartier Ganhi, Cotonou, Benin),
- train an adaptive controller on a standard CPU,
- evaluate across multiple demand regimes,
- generate publication-ready figures from the same pipeline.
## Key results
**Network case study** (2×2 grid, Quartier Ganhi, Cotonou):
| Scenario | Improvement vs fixed timing |
|------------|----------------------------|
| Light | **+83.8%** |
| Moderate | **+55.7%** |
| Heavy | **+34.8%** |
| Saturated | **+29.0%** |
| **Overall**| **+45.7%** |
- Training budget: **60,000 steps** (~53 min on a standard CPU)
- Hardware: standard CPU (no GPU required)
## Repository structure
```text
├─ params.py # Physical parameters, scenarios, DQN config
├─ solver.py # Multi-class ARZ finite-volume solver (LxF)
├─ environment.py # Single-link Gymnasium environment + baseline
├─ train.py # Single-link training pipeline
├─ network_params.py …