class_docstr: A MVO class, inherited from Optimizer.
  
  This is the designed class to define MVO-related
  variables and methods.
  
  References:
      S. Mirjalili, S. M. Mirjalili and A. Hatamlou.
      Multi-verse optimizer: a nature-inspired algorithm for global optimization.
      Neural Computing and Applications (2016).
class_docstr_tok: ["A","MVO","class",",","inherited","from","Optimizer",".","This","is","the","designed","class","to","define","MVO-related","variables","and","methods",".","References",":","S.","Mirjalili",",","S.","M.","Mirjalili","and","A.","Hatamlou",".","Multi-verse","optimizer",":","a","nature-inspired","algorithm","for","global","optimization",".","Neural","Computing","and","Applications","(","2016",")","."]
docstr: Wraps Multi-Verse Optimizer over all agents and variables (eq. 3.1-3.4).
  
  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","Multi-Verse","Optimizer","over","all","agents","and","variables","(","eq",".","3.1-3.4",")",".","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 Multi-Verse Optimizer over all agents and variables (eq. 3.1-3.4).
  
      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.
  
      """
  
      WEP = self.WEP_min + (iteration + 1) * (
          (self.WEP_max - self.WEP_min) / n_iterations
      )
      TDR = 1 - (
          (iteration + 1) ** (1 / self.p) / n_iterations ** (1 / self.p)
      )
  
      fitness = [agent.fit for agent in space.agents]
  
      norm = np.linalg.norm(fitness)
      norm_fitness = fitness / norm
  
      for i, agent in enumerate(space.agents):
          for j in range(agent.n_variables):
              r1 = r.generate_uniform_random_number()
              if r1 < norm_fitness[i]:
                  white_hole = g.weighted_wheel_selection(norm_fitness)
                  agent.position[j] = space.agents[white_hole].position[
                      j
                  ]
  
              r2 = r.generate_uniform_random_number()
              if r2 < WEP:
                  width = r.generate_uniform_random_number(
                      agent.lb[j], agent.ub[j]
                  )
  
                  r3 = r.generate_uniform_random_number()
                  if r3 < 0.5:
                      agent.position[j] = (
                          space.best_agent.position[j] + TDR * width
                      )
                  else:
                      agent.position[j] = (
                          space.best_agent.position[j] - TDR * width
                      )
          agent.clip_by_bound()
  
          agent.fit = function(agent.position)
  
file_path: opytimizer/opytimizer/optimizers/science/mvo.py
imports: 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.function import Function
  from opytimizer.core.space import Space
  from opytimizer.utils import logging
label_desc: Use image node_id 8 for calling the MVO obj's underlying member method code with example usage: obj.update(space, function, iteration, n_iterations) without return types