class_docstr: A SCA class, inherited from Optimizer.
  
  This is the designed class to define SCA-related
  variables and methods.
  
  References:
      S. Mirjalili. SCA: A Sine Cosine Algorithm for solving optimization problems.
      Knowledge-Based Systems (2016).
class_docstr_tok: ["A","SCA","class",",","inherited","from","Optimizer",".","This","is","the","designed","class","to","define","SCA-related","variables","and","methods",".","References",":","S.","Mirjalili",".","SCA",":","A","Sine","Cosine","Algorithm","for","solving","optimization","problems",".","Knowledge-Based","Systems","(","2016",")","."]
docstr: Wraps Sine Cosine Algorithm 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","Sine","Cosine","Algorithm","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 Sine Cosine Algorithm over all agents and variables.
  
      Args:
          space: Space containing agents and update-related information.
          iteration: Current iteration.
          n_iterations: Maximum number of iterations.
  
      """
  
      # Adaptively changing the r1 parameter, which controls the next position's region
      r1 = self.a - (iteration * self.a / n_iterations)
  
      # The r2 parameter defines how far the movement should be
      r2 = r.generate_uniform_random_number(0, 2 * np.pi)
  
      # A random weight for emphasizing or deemphasizing the movement
      r3 = r.generate_uniform_random_number(self.r_min, self.r_max)
  
      # A random number to decide whether sine or cosine should be used
      r4 = r.generate_uniform_random_number()
  
      for agent in space.agents:
          agent.position = self._update_position(
              agent.position, space.best_agent.position, r1, r2, r3, r4
          )
  
file_path: opytimizer/opytimizer/optimizers/swarm/sca.py
imports: from typing import Any, Dict, Optional
  import numpy
  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 9 for calling the SCA obj's underlying member method code with example usage: obj.update(space, iteration, n_iterations) without return types