Expand description
The selection phase, where chromosomes are lined up for pairing in the crossover phase, dropping the chromosomes outside of the target_population_size.
Structs§
- Select
Elite - Simply sort the chromosomes with fittest first. Then take the target_population_size (or full population when in shortage) of the populations best and drop excess chromosomes. This approach has the risk of locking in to a local optimum.
- Select
Tournament - Run tournaments with randomly chosen chromosomes and pick a single winner. Do this untill the target_population_size (or full population when in shortage) of the population is reached and drop excess chromosomes. This approach kind of sorts the fitness first, but not very strictly. This preserves a level of diversity, which avoids local optimum lock-in.