← Tuesday, September 29, 2026Models & trainingGuide

A genetic algorithm trains simulated cars to self-park

trekhleb.dev 33 min read Editor score 6/10

A TypeScript simulator evolves randomly initialized cars over generations, with vehicles beginning to approach a parking spot around generation 40. It offers a hands-on example of evolutionary optimization and its limitations.

What
A genetic algorithm evolves car genomes to teach simulated vehicles to self-park.
How
A 180-bit genome controls a brain mapping sensor readings to engine and steering signals every 100 ms; cars improve across generations.
Why it matters
This illustrates evolving a sensor-to-action controller for autonomous systems, though early cars still collide and miss the parking spot.
readings signals sensors brain muscles
Sensor readings feed the car's brain, which sends movement signals to its muscles. Sketched from the article's own text.

Discussion

Discussion is not switched on yet. Use Note above to keep your own thoughts on this story.

Headline, summary, brief and diagram are written by a model from the source's own text; the link, byline and numbers come from the source. Read the original before relying on a claim.

Your note

Private to you. Stored in this browser, and synced to your account when you are signed in.