class_docstr: An SOS class, inherited from Optimizer.
  
  This is the designed class to define SOS-related
  variables and methods.
  
  References:
      M.-Y. Cheng and D. Prayogo. Symbiotic Organisms Search: A new metaheuristic optimization algorithm.
      Computers & Structures (2014).
docstr: Performs the commensalism operation.
  
  Args:
      agent_i: Selected `i` agent.
      agent_j: Selected `j` agent.
      best_agent: Global best agent.
      function: A Function object that will be used as the objective function.
docstr_tok: ["Performs","the","commensalism","operation",".","Args",":","agent_i",":","Selected","`","i","`","agent",".","agent_j",":","Selected","`","j","`","agent",".","best_agent",":","Global","best","agent",".","function",":","A","Function","object","that","will","be","used","as","the","objective","function","."]
code: def _commensalism(
      self,
      agent_i: Agent,
      agent_j: Agent,
      best_agent: Agent,
      function: Function,
  ) -> None:
      """Performs the commensalism operation.
  
      Args:
          agent_i: Selected `i` agent.
          agent_j: Selected `j` agent.
          best_agent: Global best agent.
          function: A Function object that will be used as the objective function.
  
      """
  
      a = copy.deepcopy(agent_i)
  
      # Updates the agent's position (eq. 4)
      r1 = r.generate_uniform_random_number(-1, 1)
      a.position += r1 * (best_agent.position - agent_j.position)
      a.clip_by_bound()
  
      a.fit = function(a.position)
      if a.fit < agent_i.fit:
          agent_i.position = copy.deepcopy(a.position)
          agent_i.fit = copy.deepcopy(a.fit)
  
file_path: opytimizer/opytimizer/optimizers/swarm/sos.py
imports: import copy
  from typing import Any, Dict, Optional
  import numpy
  import opytimizer.math.random
  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 3 for calling the SOS obj's underlying member method code with example usage: obj._commensalism(agent_i, agent_j, best_agent, function) without return types