class_docstr: An ABO class, inherited from Optimizer.
  
  This is the designed class to define ABO-related
  variables and methods.
  
  References:
      X. Qi, Y. Zhu and H. Zhang. A new meta-heuristic butterfly-inspired algorithm.
      Journal of Computational Science (2017).
class_docstr_tok: ["An","ABO","class",",","inherited","from","Optimizer",".","This","is","the","designed","class","to","define","ABO-related","variables","and","methods",".","References",":","X.","Qi",",","Y.","Zhu","and","H.","Zhang",".","A","new","meta-heuristic","butterfly-inspired","algorithm",".","Journal","of","Computational","Science","(","2017",")","."]
docstr: Flies to a new location according to the flight mode (eq. 1).
  
  Args:
      agent: Current agent.
      neighbour: Selected neigbour.
      function: A Function object that will be used as the objective function.
  
  Returns:
      (Tuple[Agent, bool]): Current agent or an agent with updated position, along with a boolean that indicates whether
      agent is better or not than current one.
docstr_tok: ["Flies","to","a","new","location","according","to","the","flight","mode","(","eq",".","1",")",".","Args",":","agent",":","Current","agent",".","neighbour",":","Selected","neigbour",".","function",":","A","Function","object","that","will","be","used","as","the","objective","function",".","Returns",":","(","Tuple","[","Agent",",","bool","]",")",":","Current","agent","or","an","agent","with","updated","position",",","along","with","a","boolean","that","indicates","whether","agent","is","better","or","not","than","current","one","."]
code: def _flight_mode(
      self, agent: Agent, neighbour: Agent, function: Function
  ) -> Tuple[Agent, bool]:
      """Flies to a new location according to the flight mode (eq. 1).
  
      Args:
          agent: Current agent.
          neighbour: Selected neigbour.
          function: A Function object that will be used as the objective function.
  
      Returns:
          (Tuple[Agent, bool]): Current agent or an agent with updated position, along with a boolean that indicates whether
          agent is better or not than current one.
  
      """
  
      j = r.generate_integer_random_number(0, agent.n_variables)
      r1 = r.generate_uniform_random_number(-1, 1)
  
      temp = copy.deepcopy(agent)
  
      # Updates temporary agent's position (eq. 1)
      temp.position[j] = (
          agent.position[j]
          + (agent.position[j] - neighbour.position[j]) * r1
      )
      temp.clip_by_bound()
  
      temp.fit = function(temp.position)
      if temp.fit < agent.fit:
          return temp.position, temp.fit, True
  
      return agent.position, agent.fit, False
  
file_path: opytimizer/opytimizer/optimizers/swarm/abo.py
imports: import copy
  from typing import Any, Dict, Optional, Tuple
  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 6 for calling the ABO obj's underlying member method code with example usage: obj._flight_mode(agent, neighbour, function) and returns: agent,  agent,  False, temp,  temp,  True