class_docstr: A FSO class, inherited from Optimizer.
  
  This is the designed class to define FSO-related
  variables and methods.
  
  References:
      G. Azizyan et al.
      Flying Squirrel Optimizer (FSO): A novel SI-based optimization algorithm for engineering problems.
      Iranian Journal of Optimization (2019).
docstr: Wraps Flying Squirrel 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","Flying","Squirrel","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 Flying Squirrel 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.
  
      """
  
      mean_position = np.mean(
          [agent.position for agent in space.agents], axis=0
      )
  
      # Calculates the Sigma Reduction Factor (eq. 5)
      SRF = (-np.log(1 - (1 / np.sqrt(iteration + 2)))) ** 2
  
      # Calculates the Beta Expansion Factor
      BEF = self.beta + (2 - self.beta) * (
          (iteration + 1) / n_iterations
      )
  
      for agent in space.agents:
          a = copy.deepcopy(agent)
  
          for j in range(agent.n_variables):
              # Calculates the random walk (eq. 2 and 3)
              random_step = r.generate_gaussian_random_number(
                  mean_position[j], SRF
              )
  
              # Calculates the Lévy flight (eq. 6 to 18)
              levy_step = d.generate_levy_distribution(BEF)
  
              a.position[j] += (
                  random_step
                  * levy_step
                  * (agent.position[j] - space.best_agent.position[j])
              )
          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/swarm/fso.py
imports: import copy
  from typing import Any, Dict, Optional
  import numpy
  import opytimizer.math.distribution
  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 4 for calling the FSO obj's underlying member method code with example usage: obj.update(space, function, iteration, n_iterations) without return types