From 66e86342f52a24fb1dde5ddd362099fd049aa96a Mon Sep 17 00:00:00 2001 From: cclauss Date: Wed, 28 Jun 2017 16:00:27 +0200 Subject: [PATCH] placate flake8 --- Solid/ParticleSwarm.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Solid/ParticleSwarm.py b/Solid/ParticleSwarm.py index 07ab738..572da28 100644 --- a/Solid/ParticleSwarm.py +++ b/Solid/ParticleSwarm.py @@ -65,7 +65,8 @@ def __init__(self, swarm_size, member_size, lower_bound, upper_bound, c1, c2, c3 self.pos = uniform(self.lower_bound, self.upper_bound, size=(swarm_size, member_size)) - self.vel = uniform(self.lower_bound - self.upper_bound, self.upper_bound - self.lower_bound, size=(swarm_size, member_size)) + self.vel = uniform(self.lower_bound - self.upper_bound, self.upper_bound - self.lower_bound, + size=(swarm_size, member_size)) self.best = copy(self.pos) @@ -104,7 +105,8 @@ def _clear(self): :return: None """ self.pos = uniform(self.lower_bound, self.upper_bound, size=(self.swarm_size, self.member_size)) - self.vel = uniform(self.lower_bound - self.upper_bound, self.upper_bound - self.lower_bound, size=(self.swarm_size, self.member_size)) + self.vel = uniform(self.lower_bound - self.upper_bound, self.upper_bound - self.lower_bound, + size=(self.swarm_size, self.member_size)) self.scores = self._score(self.pos) self.best = copy(self.pos) self.cur_steps = 0 @@ -155,7 +157,7 @@ def _global_best(self): :return: None """ if self.global_best is None or min(self.scores) < self._objective(self.global_best[0]): - self.global_best = array([self.pos[argmin(self.scores)],] * self.swarm_size) + self.global_best = array([self.pos[argmin(self.scores)]] * self.swarm_size) def run(self, verbose=True): """