RL Lab

Explore how the reinforcement learning policy balances demand, energy costs, and grid constraints. Compare pre-configured strategies, adjust policy weights with sliders, and watch the simulation respond in real time.

Scenario: Audi Forum ↔ Nordbahnhof commuters spike demand around 08:00.
1

Ingest

Pull TomTom corridor delays, stop-level demand priors, and grid availability.

2

Simulate

Run 180 reinforcement-learning ticks across three policy variants and the baseline to compare reward and reliability.

3

Deploy

Write the updated hotspot plan, highlighting charging windows and spare capacity for the pitch deck.

What powers this reinforcement learner?

Gymnasium environment

A Python `IngolstadtEnv` recreates corridor demand, tariffs, and depot capacity. FastAPI exposes it to the Next.js frontend.

Stable Baselines3 PPO

A PPO agent trains on startup and fine-tunes whenever you request `retrain`, so weight tweaks come back with stronger reactions.

Instant feedback

The Next.js API proxies the Python service; if it is offline the TypeScript simulator kicks in as a fallback so the UI never stalls.

Policy playground
Baseline blendBalances reliability, grid load, and modest exploration.
Legend
Demand heat
Congestion line
Depots
Selected route

Policy profiles

Compare each reinforcement learning setting against the baseline blend. These averages come straight from the simulated 180-minute episodes.

Fetching RL episodes from the backend…

Demand vs supply timeline

Scrub across the 24-hour loop to see how the chosen policy handles peaks. The vertical bar marks the currently selected scenario hour.

Demand Supply Scenario focus

Tune the policy

Adjust individual levers to see how reward, reliability, and energy spend react. The chart re-simulates on every tweak.

Demand weight1.10

Higher values chase hotspots faster but risk empty batteries elsewhere.

Energy penalty0.25

Penalise charging when tariffs peak to protect the grid.

Charge threshold0.35

Battery ratio that triggers a charging decision.

Exploration0.08

Probability of trying a different neighbour to learn new patterns.

Adjust the sliders to fetch a fresh episode from the RL backend.

Traffic callouts

Route taps highlight the map above.

High pressure corridors
Recovery corridors

Fleet deployment visualization

The map shows real Ingolstadt corridors with live traffic data. The grid below simulates vehicle movements: blue icons serve demand, green icons charge at depots. Hover priority zone cards to highlight coverage.

Demand heat
Congestion
Charging depots

Grid simulation

Each cell represents a 500m zone. Vehicle icons show real-time policy decisions (blue = serving demand, green = charging at depot).

Charging hub
98% · 6 AVs
Charging hub
95% · 6 AVs
100% · 8 AVs
✓
Charging hub
95% · 6 AVs
Blue = serving
Green = charging
Depot station
Demand intensity

Simulation logic:

Vehicles serve high-demand zones (top 3 ranked cells). When battery drops, they route to the nearest depot (green background), charge, then return to their zone. This mirrors real fleet operations.

Priority zones

Top 3 demand hotspots. Hover to highlight vehicle allocation on the grid.

Zone 21
#1
Demand
100%
Coverage
8
Zone 14
#2
Demand
98%
Coverage
6
Zone 26
#3
Demand
96%
Coverage
6

Quick guide

  • → Brighter cells = higher demand
  • → Blue vehicles = serving riders
  • → Green vehicles = charging
  • → Depots (green background) = fixed hubs