Skip to content

Commit aae6ff9

Browse files
committed
Fix bug missing local_target in CL-PSO
1 parent 96fe8f5 commit aae6ff9

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

mealpy/swarm_based/PSO.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -706,6 +706,7 @@ def evolve(self, epoch):
706706
pop_new.append(agent)
707707
if self.mode not in self.AVAILABLE_MODES:
708708
agent.target = self.get_target(pos_new)
709+
agent.local_target = agent.target.copy()
709710
self.pop[idx] = self.get_better_agent(self.pop[idx], agent, self.problem.minmax)
710711
if self.compare_target(agent.target, self.pop[idx].local_target, self.problem.minmax):
711712
self.pop[idx].update(local_solution=agent.solution.copy(), local_target=agent.target.copy())

0 commit comments

Comments
 (0)