A GTFS data collection, analysis, and optimization system designed to reduce tram delays.
- GTFS Data Collection: Real-time data acquisition at 20-second intervals
- Simulation: Traffic simulation using SUMO/FLOW
- Optimization: Delay reduction through reinforcement learning and mathematical optimization
sudo apt update
# Docker (optional if you prefer Podman)
sudo apt install docker.io docker-compose-plugin -y
# Podman (optional alternative runtime)
sudo apt install podman podman-compose -y# Fetch GTFS static feeds (tram + bus) once
make run-ingest-static
# Fetch GTFS real-time feeds once (containerized)
make run-ingest-realtime
# Continuous GTFS real-time ingestion (pauses 00:00–04:59 JST)
make run-ingest-realtime-loop
# Use compose helpers (single-run containers)
make compose-ingest-realtime
# Compose helper for continuous ingestion
make compose-ingest-realtime-loop REALTIME_INTERVAL=20
# Example using Podman instead of Docker
CONTAINER_RUNTIME=podman COMPOSE_CMD="podman compose" make run-ingest-static
> If your Podman installation uses `podman-compose`, set `COMPOSE_CMD="podman-compose"` instead.- The Makefile is the canonical entry point for builds and one-off tasks.
- macOS/Linux include
makeby default. On Windows, install a POSIX shell withmakesupport (e.g. WSL, Git Bash, MSYS2) before running the commands above. - If you need to invoke the underlying shell scripts directly, see
scripts/, butmakekeeps workflows consistent across laptops, servers, and CI/cloud runners.
adaptive-signal-open-data/
├── configs/ # Configuration templates (ingestion, simulation)
├── data/ # Local storage layers for collected feeds
│ ├── bronze/
│ ├── raw_GCP/
│ ├── raw_test/
│ └── silver/
├── docker/ # Container definitions and compose manifests
├── docs/ # Project documentation (setup guides, notes)
├── logs/ # Runtime and ingestion logs
├── requirements/ # Python dependency lockfiles per component
├── results/ # Analysis outputs, evaluation artefacts
├── reveal-slides/ # Presentation material (assets, slide decks)
├── scripts/ # Operational utilities (schedulers, helpers)
├── src/ # Application source code
│ ├── gtfs_pipeline/ # GTFS ingestion CLI, config, persistence glue
│ ├── sim_bridge/ # Interfaces bridging to SUMO/FLOW simulations
│ └── training/ # RL/optimisation experiments and notebooks
├── Makefile # Top-level automation and shortcuts
├── README.md
└── http-server.log # Local dev HTTP server output (optional)
Note: Auxiliary directories such as .github/ (CI configuration) and venv/ (local virtual environment) are created only when needed.
- Interval: 20 seconds (real-time feeds)
- Data: GTFS Static (manual trigger), Trip Updates, Vehicle Positions
- Storage: Local filesystem
- Engine: SUMO/FLOW
- Purpose: Traffic flow simulation
- Output: Delay analysis results
- Methods: Reinforcement learning (Q-DDQN), mathematical optimization
- Goal: Delay reduction
- Output: Optimized operation plans
# GTFS static feeds (tram & bus). Set CLEAN_PREVIOUS=1 to clear old snapshots.
make run-ingest-static
# GTFS real-time feeds (one-off snapshot)
make run-ingest-realtime
# GTFS real-time feeds with raw protobuf/ZIP archives
make run-ingest-realtime-raw
# Compose helpers (one-off containers)
make compose-ingest-realtime
# Continuous real-time ingestion via scheduler (skips 00:00–04:59 JST)
make run-ingest-realtime-loop
# Compose helper for manual continuous run (no quiet hours, runs until stopped)
make compose-ingest-realtime-loop REALTIME_INTERVAL=20To run with Podman instead of Docker, set
CONTAINER_RUNTIME=podmanandCOMPOSE_CMD="podman compose"(orpodman-compose) before invokingmake.
make run-simmake run-trainGTFS_RT_SAVE_PROTO: Set to1to archive raw GTFS-RT protobuf (.pb) alongside parsed JSONGTFS_STATIC_SAVE_ZIP: Set to1to archive raw GTFS Static ZIP payloads alongside parsed JSONREALTIME_INTERVAL: Override the loop interval (seconds) for compose-based continuous runsCLEAN_PREVIOUS: Set to1when runningmake run-ingest-staticto purge existing snapshots before downloadCONTAINER_RUNTIME: Override container runtime (docker,podman, etc.). Defaults todocker.COMPOSE_CMD: Explicit compose command (e.g.podman composeorpodman-compose). Defaults to${CONTAINER_RUNTIME} compose.
docs/REQUIREMENTS.md: Dependencies management guide
make clean
make build-all# Application logs
tail -f logs/ingest.log
tail -f logs/scheduler-realtime.log# Common for all jobs
echo "package>=1.0.0" >> requirements/base.txt
# Specific job only
echo "package>=1.0.0" >> requirements/ingest.txt# Individual builds
make build-ingest
make build-sim
make build-train
# Build all
make build-allMIT License
Pull requests and issue reports are welcome.