docstr: Optimize the swarm for a number of iterations
  
  Performs the optimization to evaluate the objective
  function :code:`f` for a number of iterations :code:`iter.`
  
  Parameters
  ----------
  objective_func : callable
      objective function to be evaluated
  iters : int
      number of iterations
  n_processes : int
      number of processes to use for parallel particle evaluation (default: None = no parallelization)
  verbose : bool
      enable or disable the logs and progress bar (default: True = enable logs)
  kwargs : dict
      arguments for the objective function
  
  Returns
  -------
  tuple
      the global best cost and the global best position.
docstr_tok: ["Optimize","the","swarm","for","a","number","of","iterations","Performs","the","optimization","to","evaluate","the","objective","function",":","code",":","`","f","`","for","a","number","of","iterations",":","code",":","`","iter.","`","Parameters","--","--","--","--","--","objective_func",":","callable","objective","function","to","be","evaluated","iters",":","int","number","of","iterations","n_processes",":","int","number","of","processes","to","use","for","parallel","particle","evaluation","(","default",":","None","=","no","parallelization",")","verbose",":","bool","enable","or","disable","the","logs","and","progress","bar","(","default",":","True","=","enable","logs",")","kwargs",":","dict","arguments","for","the","objective","function","Returns","--","--","--","-","tuple","the","global","best","cost","and","the","global","best","position","."]
file_path: pyswarms/pyswarms/single/general_optimizer.py
imports: import logging
  import numpy
  import multiprocessing
  from collections import deque
  from ..backend.operators import compute_pbest, compute_objective_function
  from ..backend.topology import Topology
  from ..backend.handlers import BoundaryHandler, VelocityHandler, OptionsHandler
  from ..base import SwarmOptimizer
  from ..utils.reporter import Reporter
label_desc: Use image node_id 2 for calling the GeneralOptimizerPSO obj's underlying member method code with example usage: obj.optimize(objective_func, iters, n_processes, verbose) and returns: final_best_cost,  final_best_pos