Skip to content

Commit

Permalink
Fix bug indies of wl and wg variables
Browse files Browse the repository at this point in the history
  • Loading branch information
thieu1995 committed Jan 3, 2024
1 parent 5117303 commit b628476
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion mealpy/human_based/WarSO.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ def evolve(self, epoch):
Args:
epoch (int): The current iteration
"""
pop_sorted = self.get_sorted_population(self.pop, self.problem.minmax)
pop_sorted, indices = self.get_sorted_population(self.pop, self.problem.minmax, return_index=True)
self.wl = self.wl[indices]
self.wg = self.wg[indices]
com = self.generator.permutation(self.pop_size)
for idx in range(0, self.pop_size):
r1 = self.generator.random()
Expand Down

0 comments on commit b628476

Please sign in to comment.