Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 0069c25

Browse files
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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)

AltStyle によって変換されたページ (->オリジナル) /