class_docstr: A JS class, inherited from Optimizer.
  
  This is the designed class to define JS-related
  variables and methods.
  
  References:
      J.-S. Chou and D.-N. Truong. A novel metaheuristic optimizer inspired by behavior of jellyfish in ocean.
      Applied Mathematics and Computation (2020).
class_docstr_tok: ["A","JS","class",",","inherited","from","Optimizer",".","This","is","the","designed","class","to","define","JS-related","variables","and","methods",".","References",":","J.-S.","Chou","and","D.-N.","Truong",".","A","novel","metaheuristic","optimizer","inspired","by","behavior","of","jellyfish","in","ocean",".","Applied","Mathematics","and","Computation","(","2020",")","."]
docstr: Wraps Jellyfish Search over all agents and variables.
  
  Args:
      space: Space containing agents and update-related information.
      iteration: Current iteration.
      n_iterations: Maximum number of iterations.
docstr_tok: ["Wraps","Jellyfish","Search","over","all","agents","and","variables",".","Args",":","space",":","Space","containing","agents","and","update-related","information",".","iteration",":","Current","iteration",".","n_iterations",":","Maximum","number","of","iterations","."]
code: def update(
      self, space: Space, iteration: int, n_iterations: int
  ) -> None:
      """Wraps Jellyfish Search over all agents and variables.
  
      Args:
          space: Space containing agents and update-related information.
          iteration: Current iteration.
          n_iterations: Maximum number of iterations.
  
      """
  
      for agent in space.agents:
          r1 = r.generate_uniform_random_number()
  
          # Calculates the time control mechanism (eq. 17)
          c = np.fabs((1 - iteration / n_iterations) * (2 * r1 - 1))
  
          if c >= 0.5:
              # Calculates the ocean current (eq. 9)
              trend = self._ocean_current(
                  space.agents, space.best_agent
              )
  
              # Updates the location of current jellyfish (eq. 11)
              r2 = r.generate_uniform_random_number()
              agent.position += r2 * trend
          else:
              r2 = r.generate_uniform_random_number()
              if r2 > (1 - c):
                  # Update jellyfish's location with type A motion (eq. 12)
                  agent.position += self._motion_a(agent.lb, agent.ub)
              else:
                  # Updates jellyfish's location with type B motion (eq. 16)
                  j = r.generate_integer_random_number(
                      0, len(space.agents)
                  )
                  agent.position += self._motion_b(
                      agent, space.agents[j]
                  )
          agent.clip_by_bound()
  
imports: from typing import Any, Dict, List, Optional
  import numpy
  import opytimizer.math.random
  import opytimizer.utils.exception
  from opytimizer.core import Optimizer
  from opytimizer.core.agent import Agent
  from opytimizer.core.space import Space
  from opytimizer.utils import logging
label_desc: Use image node_id 13 for calling the JS obj's underlying member method code with example usage: obj.update(space, iteration, n_iterations) without return types