Skip to content

Commit e97c46a

Browse files
committed
PyGAD 2.19.2 Release
PyGAD 2.19.2 Release Notes 1. Fix an issue when paralell processing was used where the elitism solutions' fitness values are not re-used. #160 (comment)
1 parent 742eb31 commit e97c46a

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
from .pygad import * # Relative import.
22

3-
__version__ = "2.19.1"
3+
__version__ = "2.19.2"

pygad.py

+2
Original file line numberDiff line numberDiff line change
@@ -1431,6 +1431,8 @@ def cal_pop_fitness(self):
14311431
elitism_idx = self.last_generation_elitism_indices[elitism_idx]
14321432
# Use the elitism's index to return its pre-calculated fitness value.
14331433
fitness = self.previous_generation_fitness[elitism_idx]
1434+
1435+
pop_fitness[sol_idx] = fitness
14341436
# If the solutions are not saved (i.e. `save_solutions=False`), check if this solution is a parent from the previous generation and its fitness value is already calculated. If so, use the fitness value instead of calling the fitness function.
14351437
# We cannot use the `numpy.where()` function directly because it does not support the `axis` parameter. This is why the `numpy.all()` function is used to match the solutions on axis=1.
14361438
# elif (self.last_generation_parents is not None) and len(numpy.where(numpy.all(self.last_generation_parents == sol, axis=1))[0] > 0):

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
setuptools.setup(
77
name="pygad",
8-
version="2.19.1",
8+
version="2.19.2",
99
author="Ahmed Fawzy Gad",
1010
install_requires=["numpy", "matplotlib", "cloudpickle",],
1111
author_email="[email protected]",

0 commit comments

Comments
 (0)