I quote below a personal portable implementation (in C++) of a classic Differential Evolution algorithm used to maximize the function f(x) = sin(x) in the domain 0 <= x <= 2pi. You can compile the program with the g++ compiler.
The Differential Evolution algorithm implements the following features:
- Monoparametric optimization problem (with continuous parameter)
- Natural representation of genotypes
- Genotypes of only one chromosome
- Number of iterations as the termination criterion
- Steady-State reproduction (replacement of parents and children)
- Crossover through breeding: v = x0 + a (x1 – x2)
- Climbing through breeding: v = x0 + a (x1 – x2)
For more information you can get the project itself: