A population of chromosomes is randomly created inside an n-dimensional hypercube bounded by the lists of coordinates
The chromosomes’ coordinates can have any floating point values inside the hypercube.
Then the fitness of each chromosome is evaluated.
The fitness functions are in a separate file, continuous-fitness-functions.lisp.
Chromosomes are selected for reproduction according to the roulette wheel selection algorithm.
If selected, two chromosomes either mate and produce two children or are cloned into the new generation.
The probability of mating (or crossover) is
Mutation is also considered with the probability
Most children are born in the hypercube bounded by the coordinates of the parents.
Some children, however, have their coordinates outside the parental hypercube.
This is done in order to increase genetic diversity. The amount of such children and how far they are from the parental hypercube is determined by the parameter
The details of the crossover mechanism are in the functions
The algorithm runs (the function
run-ga) until either the termination condition (
termination) is satisfied or the maximum number of iterations (
max-iterations) is reached.
My termination condition is satisfied when the best value of the fitness in the population stops changing from generation to generation and is not less than the highest fitness value during the whole run.