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: Generate a new Particle.
docstr_tok: ["Generate","a","new","Particle","."]
code: def generate(self):
      """Generate a new Particle."""
      if len(self.bounds) < Sobol.maxdim():
          sobol_vector, self.sobolseed = Sobol.i4_sobol(
              len(self.bounds), self.sobolseed
          )
          vector = util.scale_unit_to_bounds(
              sobol_vector, self.bounds.values()
          )
      else:
          vector = uniform_in_bounds(self.bounds)
  
      part = ParticleSwarm.Particle(
          position=array.array("d", vector),
          speed=array.array(
              "d", map(random.uniform, self.smin, self.smax)
          ),
          best=None,
          fitness=None,
          best_fitness=None,
      )
      return part
  
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 13 for calling the ParticleSwarm obj's underlying member method code with example usage: obj.generate() and returns: part