Optimizations/updates
1. Deleted duplicate functions in EasyGA 2. Added new index-dependent fitness example 3. GA now auto-sorts by best fitness immediately after the fitness is calculated across the board 4. Removed 'selected' status flag from the Chromosome flag 5. Added mating_pool attribute to the population 6. Changed other code to be in line with 4 and 5 7. Optimized tournament selection method
This commit is contained in:
@ -14,10 +14,7 @@ class Crossover_Methods:
|
||||
"""Single point crossover is when a "point" is selected and the genetic
|
||||
make up of the two parent chromosomes are "Crossed" or better known as swapped"""
|
||||
|
||||
crossover_pool = []
|
||||
for i in range(ga.population_size):
|
||||
if ga.population.get_all_chromosomes()[i].selected:
|
||||
crossover_pool.append(ga.population.get_all_chromosomes()[i])
|
||||
crossover_pool = ga.population.mating_pool
|
||||
|
||||
new_population = Population()
|
||||
for i in range(len(crossover_pool)):
|
||||
|
||||
Reference in New Issue
Block a user