I quote below a personal portable implementation (in C++) of a classic genetic algorithm (evolutionary algorithm) used to maximize the function f(x, y) = sin(x) * sin(y) in the domain 0 <= x, y <= 2pi. You can compile the program with the g++ compiler.
The Genetic Algorithm implements the following features:
- Multi-parameter problems optimization (with constant parameters)
- Binary encoded genotypes (with integers)
- Genotypes of multiples chromosomes
- Number of iterations as the termination criterion
- Elitism by cloning of the best individuals
- Roulette wheel method for the selection of parents
- Generational replacement of parents and children
- One-point crossover and cloning of parents
- Deterministic method of mutation (probability of mutation per bit)
- Use of the climbing operator “phenotype mutation”
- Use of operator for chromosome replication or cloning
For more information you can get the project itself: