class_docstr: .. include:: /global.rst
  
  Please refer to |pso| for details on this algorithm.
class_docstr_tok: ["..","include",":",":","\/global.rst","Please","refer","to","|pso|","for","details","on","this","algorithm","."]
docstr: Update the particle.
docstr_tok: ["Update","the","particle","."]
code: def updateParticle(self, part, best, phi1, phi2):
      """Update the particle."""
      u1 = (random.uniform(0, phi1) for _ in range(len(part.position)))
      u2 = (random.uniform(0, phi2) for _ in range(len(part.position)))
      v_u1 = map(op.mul, u1, map(op.sub, part.best, part.position))
      v_u2 = map(op.mul, u2, map(op.sub, best.position, part.position))
      part.speed = array.array(
          "d", map(op.add, part.speed, map(op.add, v_u1, v_u2))
      )
      for i, speed in enumerate(part.speed):
          if speed < self.smin[i]:
              part.speed[i] = self.smin[i]
          elif speed > self.smax[i]:
              part.speed[i] = self.smax[i]
      part.position[:] = array.array(
          "d", map(op.add, part.position, part.speed)
      )
  
imports: import math
  import operator
  import random
  import array
  import functools
  from .solver_registry import register_solver
  from .util import Solver, _copydoc, uniform_in_bounds
  from .None import util
  from .Sobol import Sobol
label_desc: Use image node_id 14 for calling the ParticleSwarm obj's underlying member method code with example usage: obj.updateParticle(part, best, phi1, phi2) without return types