Adaptive Grid: Intelligence for the Roadway

Inspiration

If you’ve ever driven through Rolla, Missouri, you will have spent time sitting at a red light on Highway 63 or 10th Street while the cross-street is completely empty. In smaller municipalities like Rolla, traffic signals are typically fixed-time, operating on rigid timers based on historical studies that may be years out of date.

We wanted to bridge the gap between historical trends and real-time action. We were inspired to take the data already available, and use it to train a system that actually understands a city's unique traffic.

What it Does

Adaptive Grid is a universal optimization framework. While our case study focuses on Rolla, the engine is built to work regardless of initial location.

  • Universal Ingestion: The system pulls real-world road geometry for any city via OpenStreetMap. By swapping a few data files, the AI can pivot from a small town to a major metropolis.
  • Historical Logic: The engine ingests historical traffic reports to calculate hourly "demand multipliers." This ensures the simulation reflects actual morning rushes and late-night lulls, and is largely used for traffic flow logic.
  • Optimizes: Using Reinforcement Learning (RL), every intersection learns from these patterns. The signals pre-train on historical data to anticipate congestion, and then dynamically adjusts cycle lengths and green-light splits to maximize flow.

How we Built it

We maintained a modular, lightweight architecture:

  1. The Map: We utilized OSMnx to download the road geometry and intersection data for Rolla, MO.
  2. The Backend: A Flask-powered Python server runs the simulation logic, calculating car physics (acceleration, deceleration, and gap acceptance) 60 times per second.
  3. The RL Engine: We implemented a "Hill-Climbing" optimization algorithm. The agent monitors the average wait time and adjusts the green-light split. The system uses a feedback loop: if the total wait time decreases after a change, the agent reinforces that behavior; if it increases, the agent adjusts in the opposite direction.
  4. The Frontend: A reactive dashboard built with Leaflet.js visualizes traffic flow and provides a live feed of the RL agent's performance.

Challenges we Ran Into

  • Realistic Kinematics: Modeling human-like driving, including slowing for turns and maintaining safe following distances, was complex to code. We had to implement logic so that cars could react to what is around them.
  • Directional Geometry: OpenStreetMap data often lacks specific stop-sign orientations. We wrote custom logic to determine road priority based on intersection geometry.

Accomplishments that we're Proud Of

  • Proven Optimization: When switching from Fixed Light mode to Adaptive Learning mode, the simulation shows a measurable drop in city-wide wait times (In our Rolla demo, reducing average wait time from 13 seconds to 6 seconds). The RL actually learns the rhythm of the city.
  • Visual Realism: The vehicles aren't just dots; they accelerate, decelerate, and queue at lights with high fidelity, reflecting actual urban driving patterns and reacting to other cars around them.

What we Learned

We gained experience in:

  • Reinforcement Learning: Translating traffic flow into a reward/penalty system that an AI can optimize.
  • Full-Stack Integration: Connecting high-frequency Python simulations to web-based UIs via REST APIs and JSON streaming.
  • DevOps: Managing codebase versions with Git and self-hosting our development environment to handle the simulation's computational load.

What's Next for Adaptive Grid

  • Browser-Side Training: Allowing users to run the machine learning training directly in the client.
  • Infrastructure Testing: Allowing planners to "test" what happens if a stop sign is replaced by a traffic light, or vice versa.
  • Expansion: Scaling the tool to support any city across Missouri, helping planners reduce carbon emissions and get citizens home faster.
Share this project:

Updates