January 2020
Intermediate to advanced
346 pages
9h 8m
English
It is always a good idea to put a limit on the number of generations, to guarantee that the algorithm does not run forever. This gives us one stopping condition.
In addition, since we happen to know the best solution for the OneMax problem—a binary string with all 1s, and a fitness value equal to the length of the individual—we can use that as a second stopping condition.
If either of these conditions is met, that is, the number of generations reaches the limit or best solution is found, the genetic algorithm will stop.
Read now
Unlock full access