Skip to content

Commit 0069c25

Browse files
authored
PyGAD 2.15.1
Fix a bug when keep_parents is set to a positive integer. #49
1 parent f5a09a5 commit 0069c25

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-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.15.0"
3+
__version__ = "2.15.1"

pygad.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1198,7 +1198,7 @@ def run(self):
11981198
self.population[0:self.last_generation_parents.shape[0], :] = self.last_generation_parents
11991199
self.population[self.last_generation_parents.shape[0]:, :] = self.last_generation_offspring_mutation
12001200
elif (self.keep_parents > 0):
1201-
parents_to_keep = self.steady_state_selection(self.last_generation_fitness, num_parents=self.keep_parents)
1201+
parents_to_keep, _ = self.steady_state_selection(self.last_generation_fitness, num_parents=self.keep_parents)
12021202
self.population[0:parents_to_keep.shape[0], :] = parents_to_keep
12031203
self.population[parents_to_keep.shape[0]:, :] = self.last_generation_offspring_mutation
12041204

0 commit comments

Comments
 (0)