class_docstr: A BPSO class, inherited from Optimizer.
  
  This is the designed class to define boolean PSO-related
  variables and methods.
  
  References:
      F. Afshinmanesh, A. Marandi and A. Rahimi-Kian.
      A Novel Binary Particle Swarm Optimization Method Using Artificial Immune System.
      IEEE International Conference on Smart Technologies (2005).
class_docstr_tok: ["A","BPSO","class",",","inherited","from","Optimizer",".","This","is","the","designed","class","to","define","boolean","PSO-related","variables","and","methods",".","References",":","F.","Afshinmanesh",",","A.","Marandi","and","A.","Rahimi-Kian",".","A","Novel","Binary","Particle","Swarm","Optimization","Method","Using","Artificial","Immune","System",".","IEEE","International","Conference","on","Smart","Technologies","(","2005",")","."]
docstr: Wraps Boolean Particle Swarm Optimization over all agents and variables.
  
  Args:
      space: Space containing agents and update-related information.
docstr_tok: ["Wraps","Boolean","Particle","Swarm","Optimization","over","all","agents","and","variables",".","Args",":","space",":","Space","containing","agents","and","update-related","information","."]
code: def update(self, space: Space) -> None:
      """Wraps Boolean Particle Swarm Optimization over all agents and variables.
  
      Args:
          space: Space containing agents and update-related information.
  
      """
  
      for i, agent in enumerate(space.agents):
          r1 = r.generate_binary_random_number(agent.position.shape)
          r2 = r.generate_binary_random_number(agent.position.shape)
  
          local_partial = np.logical_and(
              self.c1,
              np.logical_xor(
                  r1,
                  np.logical_xor(
                      self.local_position[i], agent.position
                  ),
              ),
          )
          global_partial = np.logical_and(
              self.c2,
              np.logical_xor(
                  r2,
                  np.logical_xor(
                      space.best_agent.position, agent.position
                  ),
              ),
          )
  
          # Updates current agent velocities (eq. 1)
          self.velocity[i] = np.logical_or(
              local_partial, global_partial
          )
  
          # Updates current agent positions (eq. 2)
          agent.position = np.logical_xor(
              agent.position, self.velocity[i]
          )
  
imports: import copy
  import time
  from typing import Any, Dict, Optional
  import numpy
  import opytimizer.math.random
  import opytimizer.utils.exception
  from opytimizer.core import Optimizer
  from opytimizer.core.function import Function
  from opytimizer.core.space import Space
  from opytimizer.utils import logging
label_desc: Use image node_id 12 for calling the BPSO obj's underlying member method code with example usage: obj.update(space) without return types