Skip to content

Commit

Permalink
Fix BinaryPSO return value (#293)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielcorreia96 authored and ljvmiranda921 committed Feb 18, 2019
1 parent c146c48 commit ddf20ce
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pyswarms/discrete/binary.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ def optimize(self, objective_func, iters, fast=False, **kwargs):
self.swarm.position = self._compute_position(self.swarm)
# Obtain the final best_cost and the final best_position
final_best_cost = self.swarm.best_cost.copy()
final_best_pos = self.swarm.best_pos.copy()
final_best_pos = self.swarm.position[self.swarm.pbest_cost.argmin(axis=0)].copy()
self.rep.log(
"Optimization finished | best cost: {}, best pos: {}".format(
final_best_cost, final_best_pos
Expand Down

0 comments on commit ddf20ce

Please sign in to comment.