class_docstr: An EO class, inherited from Optimizer.
  
  This is the designed class to define EO-related
  variables and methods.
  
  References:
      A. Faramarzi et al. Equilibrium optimizer: A novel optimization algorithm.
      Knowledge-Based Systems (2020).
class_docstr_tok: ["An","EO","class",",","inherited","from","Optimizer",".","This","is","the","designed","class","to","define","EO-related","variables","and","methods",".","References",":","A.","Faramarzi","et","al",".","Equilibrium","optimizer",":","A","novel","optimization","algorithm",".","Knowledge-Based","Systems","(","2020",")","."]
docstr: Wraps Equilibrium Optimizer 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.
      iteration: Current iteration.
      n_iterations: Maximum number of iterations.
docstr_tok: ["Wraps","Equilibrium","Optimizer","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",".","iteration",":","Current","iteration",".","n_iterations",":","Maximum","number","of","iterations","."]
code: def update(
      self,
      space: Space,
      function: Function,
      iteration: int,
      n_iterations: int,
  ) -> None:
      """Wraps Equilibrium Optimizer 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.
          iteration: Current iteration.
          n_iterations: Maximum number of iterations.
  
      """
  
      self._calculate_equilibrium(space.agents)
      C_avg = self._average_concentration(function)
  
      # Makes a pool of both concentrations and their average (eq. 7)
      C_pool = self.C + [C_avg]
  
      # Calculates the time (eq. 9)
      t = (1 - iteration / n_iterations) ** (
          self.a2 * iteration / n_iterations
      )
  
      for agent in space.agents:
          i = rnd.generate_integer_random_number(0, 5)
  
          # Generates two uniform random vectors (eq. 11)
          r = rnd.generate_uniform_random_number(
              size=(agent.n_variables, agent.n_dimensions)
          )
          lambd = rnd.generate_uniform_random_number(
              size=(agent.n_variables, agent.n_dimensions)
          )
  
          # Calculates the exponential term (eq. 11)
          F = self.a1 * np.sign(r - 0.5) * (np.exp(-lambd * t) - 1)
  
          r1 = rnd.generate_uniform_random_number()
          r2 = rnd.generate_uniform_random_number()
  
          # If `r2` is bigger than generation probability (eq. 15)
          if r2 >= self.GP:
              GCP = 0.5 * r1
          else:
              GCP = 0
  
          # Calculates the initial generation value (eq. 14)
          G_0 = GCP * (C_pool[i].position - lambd * agent.position)
  
          # Calculates the generation value (eq. 13)
          G = G_0 * F
  
          # Updates agent's position (eq. 16)
          agent.position = (
              C_pool[i].position
              + (agent.position - C_pool[i].position) * F
              + (G / (lambd * self.V)) * (1 - F)
          )
  
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 15 for calling the EO obj's underlying member method code with example usage: obj.update(space, function, iteration, n_iterations) without return types