Simulation Controls
Restart with new population
Set road for next generation
Genome
Hyperparameters
Save & Load
About
GeneticCars uses a simple implementation of the genetic algorithm to evolve 2D shapes
with wheels into cars. GeneticCars is inspired by boxCar2D but is
powered the matter.js physics engine. Additionally, it makes use of chart.js
and seedrandom.js.
Hyperparameters
Population
:
Number of cars in each generation
Mutation Rate
:
Percentage chance for elements of an offspring genome to be replaced with a random
value
Elitism
:
Percentage of the population that is carried over to the next generation
Selection Bias
:
Bias applied when selecting cars for crossover. Higher values increase the
likelihood that the best performing cars will be chosen
Selection Method
:
Method used to choose parents for crossover
Crossover Method
:
Method used for genetic crossover
Explanation
The cars' bodies are constructed from a set of vertices around a central point. Wheels are
attached at vertices specified in the cars' genome. The cars genomes consist of the
following elements:
magnitude_1
angle_1
...
magnitude_n
angle_n
wheels_displayed
wheel_vertex_1
wheel_size_1
...
wheel_vertex_m
wheel_size_m
Here 'n' is equal to the 'Num Triangles' parameter. The value of 'wheels_displayed' is a number
between the min and max 'NumWheels parameters' and corresponds to the number of wheels in the
genome that will be displayed. The max 'NumWheels' parameter determines the value of m. The wheels
are allowed to overlap, but each of a cars wheels must be placed on a different vertex.