Please refer to the sites below for an introduction into Genetic Algorithms and their uses:
This project contains my own Genetic Algorithm C++ classes. I have implemented these classes in an example Win32 Console application (compiled using Visual Studio 2012). You are free to use this code under a MIT License.
The main source files are as follows:
- genetic.h - G.A. class declarations
- genetic.cpp - class definitions
- testGenetic.cpp - test program using the G.A. classes
The Genetic Algorithm uses 2 classes; a Chromosome class and a Population class. Full documentation of these classes can be found in: genetic.pdf . In brief, the Chromosome class defines the properties of an individual Chromosome object. The Population class is used to create whole populations of these chromosomes, and defines the selection and mating processes of all the chromosomes within the group. My classes currently support the following functions:
- Roulette Wheel and Tournament Selection methods
- Single-Point, Two-Point and Multi-Point crossover
- Elitism
- Mutation