NetLogo banner

Home
Download
Help
Forum
Resources
Extensions
FAQ
NetLogo Publications
Contact Us
Donate

Models:
Library
Community
Modeling Commons

Beginners Interactive NetLogo Dictionary (BIND)
NetLogo Dictionary

User Manuals:
Web
Printable
Chinese
Czech
Farsi / Persian
Japanese
Spanish

  Donate

NetLogo User Community Models

(back to the NetLogo User Community Models)

[screen shot]

Download
If clicking does not initiate a download, try right clicking or control clicking and choosing "Save" or "Download".(The run link is disabled for this model because it was made in a version prior to NetLogo 6.0, which NetLogo Web requires.)

Elementary Genetic Algorithm

This uses the basic features of genetic algorithms to solve a simple binary matching task. The 'target-size' sets the length of the binary sequence (zeros and ones) that must be found. This sequence can be thought of as the optimal genetic information (genome) for a particular environment. The 'population-size' sets the number of individuals that can try out their own genomes in that environment. Each generation the genetic algorithm runs through the following sequence of events, much like the process of evolution takes place in a typical ecosystem.

1. The individuals test their genomes against the environment ('compare-genomes' in the procedures).
2. Individuals with better genomes are more likely to become part of the mating pool for future generations ('mate-recombine' procedure).
3. Individuals in the mating pool then randomly recombine their genomes with their partners to generate new offspring genomes (called seed-genomes in 'mate-recombine')
4. Once the seed-genomes are constructed, they undergo mutation at a rate set by the 'mutation-rate' ('mutation' procedure).
5. Finally, the newly constructed and mutated seed-genomes are assigned to individuals in the next generation who start the process over again.

In this simulation, the fitness is assigned by counting the number of genes (individual zeros or ones in the genome) that match the target genome. After ranking the fitnesses, the half of the population with higher fitness are then chosen to reproduce. These individual genomes are then randomly chosen in pairs, who then randomly decide which parent gives their gene at each locus (i.e., the location of an individual gene). Mutation occurs by choosing a random number at each locus for each genome. If the random number is lower than the mutation rate, then the gene is switched to its opposite state.

This was created as a preliminary excercise for the ARS-Genetic, by Thomas Hills.
thills@mail.utexas.edu

(back to the NetLogo User Community Models)