PyGAD-2.18.0
- Raise an exception if the sum of fitness values is zero while either roulette wheel or stochastic universal parent selection is used. #129
- Initialize the value of the
run_completed
property toFalse
. #122 - The values of these properties are no longer reset with each call to the
run()
methodself.best_solutions, self.best_solutions_fitness, self.solutions, self.solutions_fitness
: #123. Now, the user can have the flexibility of calling therun()
method more than once while extending the data collected after each generation. Another advantage happens when the instance is loaded and therun()
method is called, as the old fitness value are shown on the graph alongside with the new fitness values. Read more in this section: [Continue without Loosing Progress](https://pygad.readthedocs.io/en/latest/README_pygad_ReadTheDocs.html#continue-without-loosing-progress) - Thanks [Prof. Fernando Jiménez Barrionuevo](http://webs.um.es/fernan) (Dept. of Information and Communications Engineering, University of Murcia, Murcia, Spain) for editing this [comment](https://github.com/ahmedfgad/GeneticAlgorithmPython/blob/5315bbec02777df96ce1ec665c94dece81c440f4/pygad.py#L73) in the code. 5315bbe
- A bug fixed when
crossover_type=None
. - Support of elitism selection through a new parameter named
keep_elitism
. It defaults to 1 which means for each generation keep only the best solution in the next generation. If assigned 0, then it has no effect. Read more in this section: [Elitism Selection](https://pygad.readthedocs.io/en/latest/README_pygad_ReadTheDocs.html#elitism-selection). #74 - A new instance attribute named
last_generation_elitism
added to hold the elitism in the last generation. - A new parameter called
random_seed
added to accept a seed for the random function generators. Credit to this issue #70 and [Prof. Fernando Jiménez Barrionuevo](http://webs.um.es/fernan). Read more in this section: [Random Seed](https://pygad.readthedocs.io/en/latest/README_pygad_ReadTheDocs.html#random-seed). - Editing the
pygad.TorchGA
module to make sure the tensor data is moved from GPU to CPU. Thanks to Rasmus Johansson for opening this pull request: ahmedfgad/TorchGA#2