-
Notifications
You must be signed in to change notification settings - Fork 0
/
ReadmeRyanlacroix
8 lines (8 loc) · 967 Bytes
/
ReadmeRyanlacroix
1
2
3
4
5
6
7
8
A C++ implementation of the all-ones problem. A population is generated consisting of individuals each containing a chromosome,
represented by a random string of 1s and 0s. Individuals breed with eachother, producing offspring whose genetic makeup is a
random mix of both parents as well as the occasional mutation (where one or more gene is randomly changed with no relation to
the parents' genetics). If an individual becomes marked as 'elite', that is, if their fitness score is in some specified top
percentile, they are immune to mutations. This helps to preserve good genetics and get the next generation of offspring closer
to the solution. A solution is found when a string is generated consisting of only 1s.
Mutation rate, population size, chromosome size, crossover rate and number of protected elites all profoundly effect the speed
and/or possibility of finding a solution. These values can be optimized using the #define statements found in defs.h