rochaporto / ezgliding

Website and software for analyzing, visualizing and planning gliding flights
GNU General Public License v3.0
5 stars 2 forks source link

add optimizer using a genetic algorithm #90

Open rochaporto opened 9 years ago

rochaporto commented 9 years ago

This is a really good description: http://natureofcode.com/book/chapter-9-the-evolution-of-code/

And as a summary...

Population. Start with a variable number of random candidates

Fitness. Function evaluating the gene's fitness. Distance, prob squared or 2^distance so that we get an exponential increase for better solutions

Selection. Based on fitness. Should be a roulette wheel with the fittest candidates having a higher selection probability

Reproduction. Crossover between 1, 2 or even more parents. Take random position and take each side from a different parent.

Mutation. For each point mutate based on a probability, which should be low. Guarantees randomness when start population was bad

Play with population number and mutation rate to evaluate best results.

Genotype is the internal representation of a candidate. Phenotype the visual one

rochaporto commented 9 years ago

Another good pointer. http://www.obitko.com/tutorials/genetic-algorithms/ga-basic-description.php