Fisher-007 / Macro-micro-integration-for-large-scale-and-refined-traffic-simulation

Apache License 2.0
0 stars 0 forks source link

Macro-micro integration for large-scale and refined traffic simulation

Requirements

# Build SUMO First...

export SUMO_HOME=$SUMO_PATH
export PATH=$SUMO_PATH/bin:$PATH
export PYTHONPATH=$SUMO_PATH/tools:$PYTHONPATH

conda create -n MMIS python=3.8
conda activate MMIS

conda install tqdm lxml pandas matplotlib

Quick Start

Take xxx network as an example

Prepare data

Generate macro network

python macro/xml2csv/xml2csv.py --input-dir data/sumo --output-dir data/macro --net xxx

Generate OD matrix

python macro/OD/get_full_od.py --network xxx --base link-based
g++ macro/OD/test_net.cpp -o macro/OD/test.exe -std=c++11
macro/OD/test.exe xxx link-based
rm macro/OD/test.exe

If choose random mode, jump to next step (only need xxx_verified.csv)

If choose taz or rule mode

python macro/OD/generate.py --network suzhou --base link-based --method rule or taz

Simulation

# Use SUMO-DUA as macro method
python micro.py 4 1000 1 taz --sample --freq 15 --network suzhou --base link-based
# Use iGP algorithm as macro method
python mmis.py 4 1000 1 taz --macro iGP-MMI-qBPR --sample --freq 15 --network suzhou