class_docstr: A COA class, inherited from Optimizer.
  
  This is the designed class to define COA-related
  variables and methods.
  
  References:
      J. Pierezan and L. Coelho. Coyote Optimization Algorithm: A New Metaheuristic for Global Optimization Problems.
      IEEE Congress on Evolutionary Computation (2018).
class_docstr_tok: ["A","COA","class",",","inherited","from","Optimizer",".","This","is","the","designed","class","to","define","COA-related","variables","and","methods",".","References",":","J.","Pierezan","and","L.","Coelho",".","Coyote","Optimization","Algorithm",":","A","New","Metaheuristic","for","Global","Optimization","Problems",".","IEEE","Congress","on","Evolutionary","Computation","(","2018",")","."]
docstr: Wraps Coyote Optimization Algorithm 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","Coyote","Optimization","Algorithm","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 Coyote Optimization Algorithm 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.
  
      """
  
      for i in range(self.n_p):
          pack_agents = self._get_agents_from_pack(space.agents, i)
  
          # Gathers the alpha coyote (eq. 5)
          alpha = pack_agents[0]
  
          # Computes the cultural tendency (eq. 6)
          tendency = np.median(
              np.array([agent.position for agent in pack_agents]),
              axis=0,
          )
  
          for agent in pack_agents:
              a = copy.deepcopy(agent)
  
              cr1 = r.generate_integer_random_number(
                  high=len(pack_agents)
              )
              cr2 = r.generate_integer_random_number(
                  high=len(pack_agents)
              )
  
              lambda_1 = alpha.position - pack_agents[cr1].position
              lambda_2 = tendency - pack_agents[cr2].position
  
              r1 = r.generate_uniform_random_number()
              r2 = r.generate_uniform_random_number()
  
              # Updates the social condition (eq. 12)
              a.position += r1 * lambda_1 + r2 * lambda_2
              a.clip_by_bound()
  
              # Evaluates the agent (eq. 13)
              a.fit = function(a.position)
  
              # If the new potision is better than current agent's position (eq. 14)
              if a.fit < agent.fit:
                  agent.position = copy.deepcopy(a.position)
                  agent.fit = copy.deepcopy(a.fit)
  
          # Performs transition between packs (eq. 4)
          self._transition_packs(space.agents)
  
imports: import copy
  from typing import Any, Dict, List, Optional
  import numpy
  import opytimizer.math.random
  import opytimizer.utils.exception
  from opytimizer.core import Optimizer
  from opytimizer.core.agent import Agent
  from opytimizer.core.function import Function
  from opytimizer.core.space import Space
  from opytimizer.utils import logging
label_desc: Use image node_id 9 for calling the COA obj's underlying member method code with example usage: obj.update(space, function) without return types