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: Updates a single particle position over a single variable (eq. 3.3).
  
  Args:
      agent_position: Agent's current position.
      best_position: Global best position.
      r1: Controls the next position's region.
      r2: Defines how far the movement should be.
      r3: Random weight for emphasizing or deemphasizing the movement.
      r4: Random number to decide whether sine or cosine should be used.
  
  Returns:
      (np.ndarray): A new position.
docstr_tok: ["Updates","a","single","particle","position","over","a","single","variable","(","eq",".","3.3",")",".","Args",":","agent_position",":","Agent","'s","current","position",".","best_position",":","Global","best","position",".","r1",":","Controls","the","next","position","'s","region",".","r2",":","Defines","how","far","the","movement","should","be",".","r3",":","Random","weight","for","emphasizing","or","deemphasizing","the","movement",".","r4",":","Random","number","to","decide","whether","sine","or","cosine","should","be","used",".","Returns",":","(","np.ndarray",")",":","A","new","position","."]
code: def _update_position(
      self,
      agent_position: np.ndarray,
      best_position: np.ndarray,
      r1: float,
      r2: float,
      r3: float,
      r4: float,
  ) -> np.ndarray:
      """Updates a single particle position over a single variable (eq. 3.3).
  
      Args:
          agent_position: Agent's current position.
          best_position: Global best position.
          r1: Controls the next position's region.
          r2: Defines how far the movement should be.
          r3: Random weight for emphasizing or deemphasizing the movement.
          r4: Random number to decide whether sine or cosine should be used.
  
      Returns:
          (np.ndarray): A new position.
  
      """
  
      if r4 < 0.5:
          new_position = agent_position + r1 * np.sin(r2) * np.fabs(
              r3 * best_position - agent_position
          )
  
      else:
          new_position = agent_position + r1 * np.cos(r2) * np.fabs(
              r3 * best_position - agent_position
          )
  
      return new_position
  
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 8 for calling the SCA obj's underlying member method code with example usage: obj._update_position(agent_position, best_position, r1, r2, r3, r4) and returns: new_position