class_docstr: An ISA class, inherited from Optimizer.
  
  This is the designed class to define ISA-related
  variables and methods.
  
  References:
      A. Mortazavi, V. Toğan and A. Nuhoğlu.
      Interactive search algorithm: A new hybrid metaheuristic optimization algorithm.
      Engineering Applications of Artificial Intelligence (2018).
docstr: Wraps Interactive Search Algorithm over all agents and variables.
  
  Args:
      space: Space containing agents and update-related information.
      function: A Function object that will be used as the objective function.
docstr_tok: ["Wraps","Interactive","Search","Algorithm","over","all","agents","and","variables",".","Args",":","space",":","Space","containing","agents","and","update-related","information",".","function",":","A","Function","object","that","will","be","used","as","the","objective","function","."]
code: def update(self, space: Space, function: Function) -> None:
      """Wraps Interactive Search Algorithm over all agents and variables.
  
      Args:
          space: Space containing agents and update-related information.
          function: A Function object that will be used as the objective function.
  
      """
  
      space.agents.sort(key=lambda x: x.fit)
      best, worst = space.agents[0], space.agents[-1]
  
      coef = [
          (best.fit - agent.fit) / (best.fit - worst.fit + c.EPSILON)
          for agent in space.agents
      ]
      w_coef = [cf / (np.sum(coef) + c.EPSILON) for cf in coef]
  
      w_position = np.sum(
          [
              cf * agent.position
              for cf, agent in zip(w_coef, space.agents)
          ],
          axis=0,
      )
      w_fit = function(w_position)
  
      for i, agent in enumerate(space.agents):
          r1 = r.generate_uniform_random_number()
          idx = r.generate_integer_random_number(
              high=space.n_agents, exclude_value=i
          )
  
          if r1 >= self.tau:
              phi3 = r.generate_uniform_random_number()
              phi2 = 2 * r.generate_uniform_random_number()
              phi1 = -(phi2 + phi3) * r.generate_uniform_random_number()
  
              # Updates the agent's velocity (eq. 6.1)
              self.velocity[i] = (
                  self.w * self.velocity[i]
                  + phi1 * (self.local_position[idx] - agent.position)
                  + phi2
                  * (
                      space.best_agent.position
                      - self.local_position[idx]
                  )
                  + phi3 * (w_position - self.local_position[idx])
              )
          else:
              r2 = r.generate_uniform_random_number()
              if agent.fit < space.agents[idx].fit:
                  # Updates agent's velocity (eq. 6.2 - top)
                  self.velocity[i] = r2 * (
                      agent.position - space.agents[idx].position
                  )
              else:
                  # Updates agent's velocity (eq. 6.2 - bottom)
                  self.velocity[i] = r2 * (
                      space.agents[idx].position - agent.position
                  )
  
          # Updates agent's position and clip its bounds (eq. 6.3)
          agent.position += self.velocity[i]
          agent.clip_by_bound()
  
          agent.fit = function(agent.position)
          local_fit = function(self.local_position[i])
  
          if w_fit < agent.fit:
              if w_fit < local_fit:
                  self.local_position[i] = copy.deepcopy(w_position)
          else:
              if agent.fit < local_fit:
                  self.local_position[i] = copy.deepcopy(agent.position)
  
imports: import copy
  import time
  from typing import Any, Dict, Optional
  import numpy
  import opytimizer.math.random
  import opytimizer.utils.constant
  import opytimizer.utils.exception
  from opytimizer.core import Optimizer
  from opytimizer.core.function import Function
  from opytimizer.core.space import Space
  from opytimizer.utils import logging
label_desc: Use image node_id 12 for calling the ISA obj's underlying member method code with example usage: obj.update(space, function) without return types