Genetic Algorithm

Description

A genetic algorithm is some variation of the following scheme:

  • Start with a random initial population.
  • Repeat the following:
    • Evaluate the fitness of each member of the population.
    • Kill the weak.
    • Replace them with variants (mutations, offspring etc.) of those still alive.

Darwin would conclude that the overall fitness of the population would increase, assuming a fixed fitness function. Instead of modeling the fitness function directly, the lifespan of each creature could be simulated until the point of death, this would result in an Artificial Life situation.

This model requires that each creature be encoded as a sequence that can be varied, and that each possible sequence (or at least the vast majority) can be interpreted as a viable solution/creature.

Code Example

PCG Wiki References

External Links

Roguelike Intelligence - Genetic Algorithms and Evolving State Machine AIs by David Dllinger at roguebasin. Includes discussion on population size, mutation rate, fitness function, gene map, and degree of elitism, all parameters that can make or break a genetic approach.
Genetic Algorithm - Wikipedia article on Genetic Algorithms.
Hello World in Genetic Algorithms

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License