Home▸AI & Machine Learning▸Smart City Traffic & Energy Grid (2D)

Smart City Traffic & Energy Grid (2D)

A 2D top-down smart-city simulator: IDM-driven traffic flows through a one-way street grid past traffic signals you can run on fixed timers or switch to adaptive AI queue-sensing control, while a linked solar + battery energy grid balances daytime generation, traffic load and overnight battery drain in real time.

AI & Machine Learning2DModerate60 FPS⇄ 3D version
2d-cyber-city-model ↗ Open standalone

The 3D original wraps this sim's title in a decorative scene — randomly scattered buildings, holograms and neon cubes that flicker on a timer but never actually respond to a real control system. This 2D companion builds the mechanic the title implies instead: a working traffic microsimulation using the Intelligent Driver Model (the same car-following math used in real transportation engineering) running on a one-way street grid, with each intersection's signal switchable between a dumb fixed timer and an adaptive AI controller that reads queue lengths and only changes phase once the waiting approach is genuinely backed up. Alongside it, a solar + battery energy grid tracks a real two-peak household demand curve, a daylight-bounded solar output curve, and a battery state of charge integrated step by step from the surplus or deficit between them — so raising traffic density, solar capacity or battery size has a visible, physically grounded effect on both congestion and grid self-sufficiency.

⚙ Under the hood

IDM car-following traffic on a one-way grid, fixed-timer vs. adaptive AI-queue traffic signals per intersection, and a solar + battery energy grid balanced by a real supply/demand integral each step.

traffic simulationintelligent transportationcar-following modelsmart gridsolar energyadaptive traffic signals

2D · HTML5 Canvas 2D · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)