class_docstr: An SAVPSO class, inherited from Optimizer.
  
  This is the designed class to define SAVPSO-related
  variables and methods.
  
  References:
      H. Lu and W. Chen.
      Self-adaptive velocity particle swarm optimization for solving constrained optimization problems.
      Journal of global optimization (2008).
class_docstr_tok: ["An","SAVPSO","class",",","inherited","from","Optimizer",".","This","is","the","designed","class","to","define","SAVPSO-related","variables","and","methods",".","References",":","H.","Lu","and","W.","Chen",".","Self-adaptive","velocity","particle","swarm","optimization","for","solving","constrained","optimization","problems",".","Journal","of","global","optimization","(","2008",")","."]
docstr: Wraps Self-adaptive Velocity Particle Swarm Optimization over all agents and variables.
  
  Args:
      space: Space containing agents and update-related information.
docstr_tok: ["Wraps","Self-adaptive","Velocity","Particle","Swarm","Optimization","over","all","agents","and","variables",".","Args",":","space",":","Space","containing","agents","and","update-related","information","."]
code: def update(self, space: Space) -> None:
      """Wraps Self-adaptive Velocity Particle Swarm Optimization over all agents and variables.
  
      Args:
          space: Space containing agents and update-related information.
  
      """
  
      positions = np.zeros(
          (
              space.agents[0].position.shape[0],
              space.agents[0].position.shape[1],
          )
      )
  
      for agent in space.agents:
          positions += agent.position
      positions /= len(space.agents)
  
      for i, agent in enumerate(space.agents):
          idx = r.generate_integer_random_number(0, len(space.agents))
  
          # Updates current agent's velocity (eq. 8)
          r1 = r.generate_uniform_random_number()
          self.velocity[i] = (
              self.w
              * np.fabs(
                  self.local_position[idx] - self.local_position[i]
              )
              * np.sign(self.velocity[i])
              + r1 * (self.local_position[i] - agent.position)
              + (1 - r1) * (space.best_agent.position - agent.position)
          )
  
          agent.position += self.velocity[i]
  
          for j in range(agent.n_variables):
              r4 = r.generate_uniform_random_number(0, 1)
  
              if agent.position[j] > agent.ub[j]:
                  agent.position[j] = positions[j] + 1 * r4 * (
                      agent.ub[j] - positions[j]
                  )
  
              if agent.position[j] < agent.lb[j]:
                  agent.position[j] = positions[j] + 1 * r4 * (
                      agent.lb[j] - positions[j]
                  )
  
imports: import copy
  import time
  from typing import Any, Dict, List, Optional
  import numpy
  import opytimizer.math.random
  import opytimizer.utils.constant
  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 2 for calling the SAVPSO obj's underlying member method code with example usage: obj.update(space) without return types