2026
UrbanFlow AI
A web environment for exploring urban traffic on real-world areas: it imports OpenStreetMap data, prepares a 3D scene and runs SUMO traffic scenarios. The project also includes metric visualizations, traffic-light controls and a heuristic controller for experimenting with signal phases.
Project roles
Technologies and tools
- Built a web application with a React, TypeScript and Three.js frontend and a FastAPI backend. Added separate web and server launch scripts, a combined development launcher and test scripts. Users search for a place with Nominatim, move the map, set the side length of a square area in metres in 100 m increments and send it to the backend.
- Implemented OSM import through Overpass with fallback across public endpoints. The normalizer parses nodes, ways and relations, clips geometry to the bounding box and converts coordinates to a local metric frame. It extracts roads, intersections, crossings, traffic lights, buildings and their height/levels, surfaces and zones, rail lines, transit stops and routes, and urban infrastructure. Road lanes, direction, speed, access, bridges, tunnels and levels are retained where mapped.
- Built the SUMO scenario-preparation pipeline: cache OSM XML, generate the road network, repair invalid traffic-light references, generate pedestrian trips and public-transport routes, merge route files, write simulation configuration and produce a debug report. It uses SUMO `netconvert`, `duarouter`, `randomTrips.py` and `ptlines2flows.py`; transit routes that cannot be built against the OSM/SUMO network are skipped.
- Connected the 3D scene to live microscopic SUMO simulation through TraCI: participant positions, speeds, headings and routes come from the simulator, and the scene smoothly renders state updates. Supports cars, taxis, trucks, buses, trams, emergency and other vehicles, pedestrians, transit stops and actual SUMO signal states. Vehicles are spawned dynamically, assigned SUMO routes and respond to signals, lane access and road closures; public transport is created from usable OSM routes and stops.
- Built an interactive 3D scene with roads, lane markings, intersections, buildings, surfaces, bridges, tunnels, rails, crossings, stops, traffic lights and event markers. Added mouse and keyboard camera controls, simple and detailed actor models, and quality settings for shadows, resolution, depth precision, geometry detail, buildings, ground and special zones. Road access and congestion can also be highlighted.
- Implemented simulation controls for start, pause, stepping, speed, reset, vehicle and pedestrian counts, signal scope and enabling signals at all available intersections. Supports SUMO's automatic programs (`rule_based`), a fixed cycle and UrbanFlow AI, with an override to set all signals to red, yellow or green and restore SUMO control. The API accepts up to 5,000 vehicles, 10,000 pedestrians and 300 steps per request.
- Added a live road-scenario editor: select a road, close or reopen it, apply roadworks that reduce speed, slow traffic near an accident point, configure automatic events by frequency and duration, and clear events. Closures restrict SUMO lanes; reopening restores access and reroutes affected vehicles. Changes are color-coded in the scene.
- Built live panels and charts for average speed, vehicle and pedestrian waiting time, active and stopped participants, throughput, road and intersection load, active events and reward. The client keeps up to 240 recent chart points; simulation state and metrics are exposed through FastAPI endpoints.
- Implemented the UrbanFlow AI runtime controller for real SUMO traffic lights through TraCI. For each intersection it collects queues, vehicle counts, waiting time, speed, lane occupancy and emergency-vehicle presence, scores available green phases and switches based on weighted pressure. It respects minimum/maximum green time, action intervals and a threshold for switching to a better phase; defaults are 12/45 ticks, a 3-tick decision interval and a switch margin of 4.
- Added a visual-training workflow to start and stop jobs, choose signal scope (OSM-only or all intersections), and display steps, reward, waiting time, congestion and stopped vehicles. Reward combines throughput with penalties for queues, waiting, stops, congestion, low speed and frequent switching. It writes CSV and JSONL history, a summary, Markdown dashboard, a `best_model.json` checkpoint file and periodic snapshots; a model registry supports saving, exporting and automatically loading the latest model for the selected scope.
- Implemented the current AI as a heuristic phase-pressure controller with configurable weights in a JSON policy checkpoint, without gradient training, a neural network or a finished RL model. Documented that ONNX and TorchScript are not implemented and retained pickle only as a container for JSON data. Built a generator for four Jupyter notebooks covering SUMO, reward, training-history and checkpoint analysis.
- Added Russian and English documentation with screenshots, setup instructions and OSM/SUMO limitations, 11 server-side pytest cases and 2 Vitest checks for frontend utilities. The documentation and training artifacts include metrics from individual runs, but there is no automated benchmark comparing SUMO and AI on the same area, seed and report; no verified performance improvement is claimed.

