def setUp(self): self.max_velocity = [10.0, 10.0] self.bounds = [[0, 10], [0, 10]] self.best = PSOParticle(score=0.0, position=[1.0, 1.0], velocity=[1.0, 1.0], max_velocity=self.max_velocity, bounds=self.bounds) self.particle = PSOParticle(score=0.1, position=[3.0, 4.0], velocity=[1.0, 1.0], max_velocity=self.max_velocity, bounds=self.bounds)
def setUp(self): self.max_velocity = [10.0, 10.0] self.bounds = [[0, 10], [0, 10]] config = { "max_population": 5, "max_velocity": self.max_velocity, "bounds": self.bounds, "objective_function": self.obj_func } self.particle = PSOParticle(score=0.0, position=[1.0, 1.0], velocity=[1.0, 1.0], max_velocity=self.max_velocity, bounds=self.bounds) self.generator = PSOParticleGenerator(config)