PyGAD-2.12.0
Release Date: 20 February 2021
- 4 new instance attributes are added to hold temporary results after each generation:
last_generation_fitness
holds the fitness values of the solutions in the last generation,last_generation_parents
holds the parents selected from the last generation,last_generation_offspring_crossover
holds the offspring generated after applying the crossover in the last generation, andlast_generation_offspring_mutation
holds the offspring generated after applying the mutation in the last generation. You can access these attributes inside theon_generation()
method for example. - A bug fixed when the
initial_population
parameter is used. The bug occurred due to a mismatch between the data type of the array assigned toinitial_population
and the gene type in thegene_type
attribute. Assuming that the array assigned to theinitial_population
parameter is((1, 1), (3, 3), (5, 5), (7, 7))
which has typeint
. Whengene_type
is set tofloat
, then the genes will not be float but casted toint
because the defined array hasint
type. The bug is fixed by forcing the array assigned toinitial_population
to have the data type in thegene_type
attribute. Check the issue at GitHub: #27
Thanks to Marios Giouvanakis, a PhD candidate in Electrical & Computer Engineer, Aristotle University of Thessaloniki (Αριστοτέλειο Πανεπιστήμιο Θεσσαλονίκης), Greece, for emailing me about these issues.