class_docstr: A BMRFO class, inherited from Optimizer.
  
  This is the designed class to define boolean MRFO-related
  variables and methods.
  
  References:
      Publication pending.
class_docstr_tok: ["A","BMRFO","class",",","inherited","from","Optimizer",".","This","is","the","designed","class","to","define","boolean","MRFO-related","variables","and","methods",".","References",":","Publication","pending","."]
docstr: Performs the chain foraging procedure.
  
  Args:
      agents: List of agents.
      best_position: Global best position.
      i: Current agent's index.
  
  Returns:
      (np.ndarray): A new chain foraging.
docstr_tok: ["Performs","the","chain","foraging","procedure",".","Args",":","agents",":","List","of","agents",".","best_position",":","Global","best","position",".","i",":","Current","agent","'s","index",".","Returns",":","(","np.ndarray",")",":","A","new","chain","foraging","."]
code: def _chain_foraging(
      self, agents: List[Agent], best_position: np.ndarray, i: int
  ) -> np.ndarray:
      """Performs the chain foraging procedure.
  
      Args:
          agents: List of agents.
          best_position: Global best position.
          i: Current agent's index.
  
      Returns:
          (np.ndarray): A new chain foraging.
  
      """
  
      r1 = r.generate_binary_random_number(best_position.shape)
      alpha = r.generate_binary_random_number(best_position.shape)
  
      if i == 0:
          partial_one = np.logical_and(
              r1, np.logical_xor(best_position, agents[i].position)
          )
          partial_two = np.logical_and(
              alpha, np.logical_xor(best_position, agents[i].position)
          )
          chain_foraging = np.logical_or(
              agents[i].position,
              np.logical_or(partial_one, partial_two),
          )
      else:
          partial_one = np.logical_and(
              r1,
              np.logical_xor(
                  agents[i - 1].position, agents[i].position
              ),
          )
          partial_two = np.logical_and(
              alpha, np.logical_xor(best_position, agents[i].position)
          )
          chain_foraging = np.logical_or(
              agents[i].position,
              np.logical_or(partial_one, partial_two),
          )
  
      return chain_foraging
  
file_path: opytimizer/opytimizer/optimizers/boolean/bmrfo.py
imports: import copy
  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.function import Function
  from opytimizer.core.space import Space
  from opytimizer.utils import logging
label_desc: Use image node_id 5 for calling the BMRFO obj's underlying member method code with example usage: obj._chain_foraging(agents, best_position, i) and returns: chain_foraging