Genetic 3-Wheelers by WhileTrue

Generations:
Cars alive:
Distance: 0 m
250
187
125
62
0

Controls



Create new world:

Mutation rate
Mutation size
Floor
Gravity
Elite


Info

What is it?

The program uses a simple genetic algorithm to evolve random three-wheeled shapes into cars over generations; the terrain gets more complex with distance.

The code is on a GitHub repository. Feel free to contribute! Developed by WhileTrue, heavily inspired by HTML5 Genetic Cars.

Controls

  • Speed up! (hide cars): Toggles drawing, makes the simulation faster
  • New Population: Keeps the generated track and restarts the whole car population
  • Create new world: The same string (seed) always creates the same track, so you can agree on a string with your friends and compete. :)
  • Mutation rate: The chance that each gene in each individual will mutate to a random value when a new generation is born
  • Mutation size: The range each gene can mutate into. Lower numbers mean the gene will have values closer to the original
  • Floor: fixed or mutable for every next generation
  • Gravity: our Earth is the default, but you can try it in another planets :)
  • Elite: The top n cars that will be copied over to the next generation
  • View top replay: Pause the current simulation and show the top performing car. Click again to resume simulation

Graph

  • Red: Top score in each generation
  • Green: Average of the top 10 cars in each generation
  • Blue: Average of the entire generation

Genetic Algorithm Car Genome

The genome consists of:
  • Shape: (8 genes, 1 per vertex)
  • Chassis density: (1 gene) darker body means denser chassis
  • Wheel size: (3 genes, 1 per wheel)
  • Wheel position: (3 genes, 1 per wheel)
  • Wheel density: (3 genes, 1 per wheel) darker wheels mean denser wheels