English

News

Self-parking Car Evolution Using Genetic Algorithm in TypeScript

A developer has demonstrated the evolution of self-parking capabilities in cars using a genetic algorithm implemented in TypeScript. The process involves optimizing a car's genome, which consists of 180 bits that dictate movements through "muscles" and environmental perception via eight distance sensors.

The simulation breaks down the complex task of autonomous parking into a low-level optimization problem. Each car's behavior is controlled by a brain that sends signals to the engine and steering wheel. The fitness of each generation is measured by the distance between the car's wheels and the corners of a parking spot.

In the simulation, the 40th generation shows the cars beginning to learn the mechanics of self-parking and approaching the designated spots. The algorithm achieves results in several hours that would otherwise take years of naive computation. The implementation utilizes a sigmoid function to convert brain signals into muscle actions and employs a selection process based on fitness to produce successive generations.

Sources

  1. Self-parking car using genetic algorithm (2021) (Hacker News Frontpage, 2026-09-28)