Let's reach the target!
This page is an experimentation built with p5.js allowing the user to manipulate the parameters of a simulation running a genetic algorithm.
In the simulation the robots have the goal to reach the target. First the population of the robots is initialized with a random selection of moves (their "genes").
At the end of each generation each robot reports its distance to the target, and the robots with a distance below the average one are selected to be used to create the next generation.
In the new generation each robot uses a crossover of the genes of the previously selected robots.
In addition the genes of each robots "mutate", which means that some of their genes are randomly replaced by new ones.
This operation follows the "mutation rate" to know how much randomness should be injected in each generation.
In the next section you will find the different parameters you can manipulate and their description.
You will see the results in the section Simulation.
The Charts section shows a history of the generations you run previously and their efficiency.
Lifespan |
The number of moves a robot in a generation can do before the generation ends. If the robot crashes before it could do all of its moves the other will continue.
*Modifying this setting resets the simulation |
|
Population size |
The number of robots in each generation
*Modifying this setting resets the simulation |
|
Robots size |
The size of the robots
*Modifying this setting resets the simulation The robot size must be greater than 0 |
|
Robots in objective |
The number of robots which have to reach the target before we consider the objective reached and move the target elsewhere. | |
Mutation rate |
At the end of each generation the robots gets new genes from their ancestors and these genes then mutate. The mutation rate describe which percentage of the genes will mutate.
The mutation rate must be between 0 and 100% |
|
History size |
The number of generations to keep in the charts
The history size must be greater than 0 |
|
Position of the target |
At any time you can click anywhere on the simulation to move the target (the black dot). |