class_docstr: A CI class, inherited from Optimizer.
  
  This is the designed class to define CI-related
  variables and methods.
  
  References:
      A. J. Kulkarni, I. P. Durugkar, M. Kumar. Cohort Intelligence: A Self Supervised Learning Behavior.
      IEEE International Conference on Systems, Man, and Cybernetics (2013).
docstr: Wraps Cohort Intelligence over all agents and variables.
  
  Args:
      space: Space containing agents and update-related information.
      function: A Function object that will be used as the objective function.
docstr_tok: ["Wraps","Cohort","Intelligence","over","all","agents","and","variables",".","Args",":","space",":","Space","containing","agents","and","update-related","information",".","function",":","A","Function","object","that","will","be","used","as","the","objective","function","."]
code: def update(self, space: Space, function: Function) -> None:
      """Wraps Cohort Intelligence over all agents and variables.
  
      Args:
          space: Space containing agents and update-related information.
          function: A Function object that will be used as the objective function.
  
      """
  
      fitness = [agent.fit for agent in space.agents]
  
      for i, agent in enumerate(space.agents):
          s = g.weighted_wheel_selection(fitness)
  
          self.lower[i] = (
              space.agents[s].position - self.lower[i] * self.r / 2
          )
          self.upper[i] = (
              space.agents[s].position - self.upper[i] * self.r / 2
          )
  
          for _ in range(self.t):
              a = copy.deepcopy(agent)
  
              for j, (lb, ub) in enumerate(
                  zip(self.lower[i], self.upper[i])
              ):
                  a.position[j] = rnd.generate_uniform_random_number(
                      lb, ub, agent.n_dimensions
                  )
              a.clip_by_bound()
  
              a.fit = function(a.position)
              if a.fit < agent.fit:
                  agent.position = copy.deepcopy(a.position)
                  agent.fit = copy.deepcopy(a.fit)
  
imports: import copy
  from typing import Any, Dict, Optional
  import numpy
  import opytimizer.math.general
  import opytimizer.math.random
  import opytimizer.utils.exception
  from opytimizer.core.function import Function
  from opytimizer.core.optimizer import Optimizer
  from opytimizer.core.space import Space
  from opytimizer.utils import logging
label_desc: Use image node_id 11 for calling the CI obj's underlying member method code with example usage: obj.update(space, function) without return types