Dr. Mark Humphrys

School of Computing. Dublin City University.

Online coding site: Ancient Brain

coders   JavaScript worlds

Search:

Free AI exercises

Sample code for Genetic Algorithms

For what it is worth, here is some sample code for how to implement a Genetic Algorithm.

Be warned though:

  1. The code is C++. (In fact, it is simplified C++ pseudocode.)
  2. The code is a bit of a hack, and not very object-oriented. In particular, the separation of the abstract GA classes from the user application is not great. I'm sure you can figure out a more elegant design yourself.

  
The code:



ancientbrain.com      w2mind.org      humphrysfamilytree.com

On the Internet since 1987.      New 250 G VPS server.

Note: Links on this site to user-generated content like Wikipedia are highlighted in red as possibly unreliable. My view is that such links are highly useful but flawed.