class_docstr: A RFO class, inherited from Optimizer.
  
  This is the designed class to define RFO-related
  variables and methods.
  
  References:
      D. Polap and M. Woźniak. Red fox optimization algorithm.
      Expert Systems with Applications (2021).
class_docstr_tok: ["A","RFO","class",",","inherited","from","Optimizer",".","This","is","the","designed","class","to","define","RFO-related","variables","and","methods",".","References",":","D.","Polap","and","M.","Wo\u017aniak",".","Red","fox","optimization","algorithm",".","Expert","Systems","with","Applications","(","2021",")","."]
docstr: Wraps Red Fox Optimization 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","Red","Fox","Optimization","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 Red Fox Optimization 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.
  
      """
  
      alpha = r.generate_uniform_random_number(0, 0.2)
  
      for agent in space.agents:
          self._rellocation(agent, space.best_agent, function)
          self._noticing(agent, function, alpha)
  
      space.agents.sort(key=lambda x: x.fit)
  
      # Calculates the habitat's center and diameter (eq. 6 and 7)
      habitat_center = (
          space.agents[0].position + space.agents[1].position
      ) / 2
      habitat_diameter = np.sqrt(
          g.euclidean_distance(
              space.agents[0].position, space.agents[1].position
          )
      )
  
      k = r.generate_uniform_random_number()
  
      for agent in space.agents[-self.n_replacement :]:
          # If sampled number is bigger than 0.45 (eq. 8 - top)
          if k >= 0.45:
              agent.fill_with_uniform()
              agent.position += habitat_center + habitat_diameter / 2
  
          # If sampled number is smaller than 0.45 (eq. 8 - bottom)
          else:
              # Reproduces parents into a new position (eq. 9)
              agent.position = (
                  k
                  * (
                      space.agents[0].position
                      + space.agents[1].position
                  )
                  / 2
              )
  
          agent.clip_by_bound()
  
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.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 13 for calling the RFO obj's underlying member method code with example usage: obj.update(space, function) without return types