This repository comprises the code to learn a Combinatorial Optimization Augmented Machine Learning (COAML) pipeline that predicts traffic flow from contextual information.
This method is proposed in:
Kai Jungel, Dario Paccagnan, Axel Parmentier, and Maximilian Schiffer. WardropNet: Traffic Flow Predictions via Equilibrium-Augmented Learning. arXiv preprint: arxiv:2410.06656, 2024.
This repository contains all relevant scripts and data sets to reproduce the results from the paper.
To run the code for reproducing the results we assume using slurm, and require a Gurobi license.
We used Gurobi version 10.0.0.
We used Python version 3.8.10.
We run the code on a Linux system.
The structure of this repository is as follows:
./matsim-berlin: Multi Agent Transport Simulation to simulate oracle scenarios
./runnables: comprises all scripts to execute the code
./surrogate: code of the Combinatorial Optimization Augmented Machine Learning (COAML) pipeline
./toySimulation: code to construct toy simulations that create toy scenarios
Each of these folders comprises respective README.md files.
To reproduce the results from the paper follow these steps:
In the matsim-berlin directory, install MATSim: https://github.com/matsim-scenarios/matsim-berlin
We recommend to install the packages in a virtual environment called venv
.
pip install -r requirements.txt
- Install the random road network creator in
./surrogate/generating
: https://github.com/arun1729/road-network - To create a scenario run
bash runnables/scenario_name.sh
- Recommendation: Run the training on a cluster using
slurm
. - We provide pre-caculated instances in
surrogate/data
. Please unpack them, if you did not run step 3. Create scenarios - On the cluster, define the parameters in the
runnables/cluster/master.sh
file. - On the cluster, in
runnables/cluster/master.sh
uncomment the training or evaluation, depending on what you want to run. - On the cluster, run
bash runnables/cluster/master.sh
- Unpack
./surrogate/results_paper.zip
and./surrogate/data/read_in_best_learning_iteration.zip
- Move to
./surrogate/visualization
and run:learning_results.py
to compare the benchmark modelsinput_data.py
to visualize the scenariosoutput_data.py
to visualize the traffic flow
Please note that the benchmark names in the paper were updated: multicommodityflow / MCFP -> CL, wardropequilibria / WE -> PL, wardropequilibriaRegularized / WE-reg -> ER