class_docstr: An ESA class, inherited from Optimizer.
  
  This is the designed class to define ES-related
  variables and methods.
  
  References:
      A. Tabari and A. Ahmad. A new optimization method: Electro-Search algorithm.
      Computers & Chemical Engineering (2017).
class_docstr_tok: ["An","ESA","class",",","inherited","from","Optimizer",".","This","is","the","designed","class","to","define","ES-related","variables","and","methods",".","References",":","A.","Tabari","and","A.","Ahmad",".","A","new","optimization","method",":","Electro-Search","algorithm",".","Computers","&","Chemical","Engineering","(","2017",")","."]
docstr: Wraps EElectro-Search 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","EElectro-Search","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 EElectro-Search 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, agent in enumerate(space.agents):
          a = copy.deepcopy(agent)
  
          electrons = [
              copy.deepcopy(agent) for _ in range(self.n_electrons)
          ]
          for electron in electrons:
              r1 = r.generate_uniform_random_number()
              n = r.generate_integer_random_number(2, 6)
  
              # Updates the electron's position (eq. 3)
              electron.position += (
                  (2 * r1 - 1) * (1 - 1 / n**2) / self.D[i]
              )
              electron.clip_by_bound()
  
              electron.fit = function(electron.position)
  
          electrons.sort(key=lambda x: x.fit)
  
          # Generates both Rydberg constant and acceleration coefficient
          # Original implementation is missing up an informative description
          Re = r.generate_uniform_random_number()
          Ac = r.generate_uniform_random_number()
  
          # Updates the Orbital radius (eq. 4)
          self.D[i] = (
              electrons[0].position - space.best_agent.position
          ) + Re * (
              1 / space.best_agent.position**2 - 1 / a.position**2
          )
  
          # Updates the temporary agent's position (eq. 5)
          a.position += Ac * self.D[i]
          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)
  
file_path: opytimizer/opytimizer/optimizers/science/esa.py
imports: import copy
  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 7 for calling the ESA obj's underlying member method code with example usage: obj.update(space, function) without return types