Self-parking car using genetic algorithm (2021)
3 hours ago
- The article describes training a self-parking car using a genetic algorithm.
- The first generation of cars has random genomes and behaves poorly, but by around the 40th generation they start learning to park and get closer to the parking spot.
- A browser-based Self-parking Car Evolution Simulator lets users train cars from scratch, adjust genetic parameters, watch trained cars in action, or try manual parking.
- The genetic algorithm is implemented in TypeScript, with full source code shown in the article and final examples in the Evolution Simulator repository.
- The article only covers genetic algorithm basics and is by no means a complete guide to the topic.
- The self-parking task is broken down into finding the optimal combination of 180 bits, called the car genome.
- The car is given muscles (engine and steering), sensors to see obstacles, and a brain that controls movements based on sensor input: movements = f(sensors).
- A genetic algorithm evolves the brain over generations so the car learns to move toward the parking spot based on what its sensors detect.
- The car has an engine muscle for moving back, forth, or neutral, and a steering wheel muscle for turning.