From a17d425cb7b1490927fdd1d5bc013fe60adf5f60 Mon Sep 17 00:00:00 2001 From: cclauss Date: Thu, 6 Jul 2017 20:43:44 +0200 Subject: [PATCH] Update ParticleSwarm.py --- Solid/ParticleSwarm.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Solid/ParticleSwarm.py b/Solid/ParticleSwarm.py index 0661ec6..1752507 100644 --- a/Solid/ParticleSwarm.py +++ b/Solid/ParticleSwarm.py @@ -189,7 +189,7 @@ def run(self, verbose=True): self.scores = self._score(self.pos) self._global_best() - if self.min_objective is not None and self._objective(self.global_best[0]) < self.min_objective: + if self._objective(self.global_best[0]) < (self.min_objective or 0): print("TERMINATING - REACHED MINIMUM OBJECTIVE") return self.global_best[0], self._objective(self.global_best[0]) print("TERMINATING - REACHED MAXIMUM STEPS")