class_docstr: A FA class, inherited from Optimizer.
  
  This is the designed class to define FA-related
  variables and methods.
  
  References:
      X.-S. Yang. Firefly algorithms for multimodal optimization.
      International symposium on stochastic algorithms (2009).
class_docstr_tok: ["A","FA","class",",","inherited","from","Optimizer",".","This","is","the","designed","class","to","define","FA-related","variables","and","methods",".","References",":","X.-S.","Yang",".","Firefly","algorithms","for","multimodal","optimization",".","International","symposium","on","stochastic","algorithms","(","2009",")","."]
docstr: Wraps Firefly Algorithm over all agents and variables (eq. 3-9).
  
  Args:
      space: Space containing agents and update-related information.
      n_iterations: Maximum number of iterations.
docstr_tok: ["Wraps","Firefly","Algorithm","over","all","agents","and","variables","(","eq",".","3-9",")",".","Args",":","space",":","Space","containing","agents","and","update-related","information",".","n_iterations",":","Maximum","number","of","iterations","."]
code: def update(self, space: Space, n_iterations: int) -> None:
      """Wraps Firefly Algorithm over all agents and variables (eq. 3-9).
  
      Args:
          space: Space containing agents and update-related information.
          n_iterations: Maximum number of iterations.
  
      """
  
      delta = 1 - ((10e-4) / 0.9) ** (1 / n_iterations)
      self.alpha *= 1 - delta
  
      temp_agents = copy.deepcopy(space.agents)
  
      for agent in space.agents:
          for temp in temp_agents:
              # Distance is calculated by an euclidean distance between 'i' and 'j' (eq. 8)
              distance = g.euclidean_distance(
                  agent.position, temp.position
              )
  
              if agent.fit > temp.fit:
                  # Recalculate the attractiveness (eq. 6)
                  beta = self.beta * np.exp(-self.gamma * distance)
  
                  # Updates agent's position (eq. 9)
                  r1 = r.generate_uniform_random_number()
                  agent.position = beta * (
                      temp.position + agent.position
                  ) + self.alpha * (r1 - 0.5)
  
file_path: opytimizer/opytimizer/optimizers/swarm/fa.py
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 import Optimizer
  from opytimizer.core.space import Space
  from opytimizer.utils import logging
label_desc: Use image node_id 8 for calling the FA obj's underlying member method code with example usage: obj.update(space, n_iterations) without return types