Genetic algorithms follow a flow not unlike biological genetics to simulate evolution of a system. An initial population is created, generally randomly, and each element of that population is set through a fitness test. After these tests are run, a percentage of the population that is deemed most fit is selected and allowed to "breed." This select division of the population mix portions of their code together to generate a new population of children that will hopefully improve overall fitness of the new population. Along with the mixing of the genetic code the algorithm can introduce mutations to a percentage of the next generation, randomizing different segments of the code to introduce new traits and to prevent an evolutionary dead end.
|BoxCar2D in action|