Examples¶
The repository ships runnable example scripts under
examples/. Run
any with python examples/<name>.py; each writes its figures (and any CSVs) to
examples/output/<script_name>/. This page is just an index — the concepts are
covered in the guide pages linked in the last column.
| Script | What it shows | Guide |
|---|---|---|
grid_demo.py |
A partial grid with shortest-path routing | Routing |
freeway_onramp.py |
A freeway on-ramp merge on a calibrated topology with a synthetic demand profile | Building networks |
parallel_links_demo.py |
Fast lane, slow lane, and a detour: free-flow vs congestion-aware routing | Routing |
congestion_aware_routing.py |
A ReroutingPlugin balancing a burst across a short and long route by load |
Plugins |
rerouting_demo.py |
Manual per-vehicle rerouting onto a detour mid-run | Plugins |
adaptive_rerouting_intersection.py |
An uncontrolled 2-in/2-out junction; agents re-checked against the live shortest path each step | Plugins, Routing |
bottleneck_access_policy.py |
A coin-toss bottleneck admission policy driven with start/step/inject, recorded as a video |
Stepping & injection, Animations |
multi_trip_injection.py |
Re-injecting one vehicle for several consecutive trips, tracked as multiple journeys, with the re-injection guardrails | Stepping & injection, Metrics |
vehicle_metrics_demo.py |
Per-vehicle travel times and travel-time plots | Metrics, Visualizations |
grid_visualization.py |
Congestion-aware grid rerouting recorded as a video, coloured by next link and by custom props |
Animations |
paper_validation.py |
Reproduces the paper's Section 4 figures through the shipped pipeline | Deviations from the paper |
Reproducing the paper
paper_validation.py is the canonical paper-reproduction script — it
reproduces the paper's lane-drop, diverge, and merge figures and surfaces the
deliberate divergences (discrete-only, CFL rejection, out-of-scope scenarios)
on the figures themselves.