HeadlinesBriefing favicon HeadlinesBriefing.com

Self-parking Car Evolution Simulator 2021

Hacker News •
×

In this article, we'll train the car to do self-parking using a genetic algorithm. We'll create the 1st generation of cars with random genomes that will behave erratically. On the 40th generation, the cars start learning what self-parking is and get closer to the parking spot.

Despite hitting other cars and imperfect fits, this early progress is celebrated as the simulator evolves. You may launch the Self-parking Car Evolution Simulator to see the process directly in your browser, train cars from scratch, adjust genetic parameters, or try manual parking with WASD controls. The genetic algorithm is implemented in TypeScript.

The plan involves breaking the high-level task of self-parking into a low-level optimization problem of finding the optimal 180-bit car genome. Muscles, in the form of engine and steering wheel signals (-1, 0, +1), allow movement. Sensors, or 'eyes', enable the car to see surroundings and obstacles.

The brain is a pure function controlling movements based on sensor input. Evolution occurs generation after generation as the brain function learns optimal moves. The full genetic source code is available in the Evolution Simulator repository.

The simulator offers opportunities to train cars from scratch, view trained cars in action, and attempt manual parking.