code: def updateVelocities(self, gBest):
      for i in range(dimension):
          r1 = random.random()
          r2 = random.random()
          social = c1 * r1 * (gBest[i] - self.pos[i])
          cognitive = c2 * r2 * (self.pBest[i] - self.pos[i])
          self.velocity[i] = (w * self.velocity[i]) + social + cognitive
      return
  
file_path: advisor/advisor_server/suggestion/algorithm/particle_swarm_optimization.py
imports: from __future__ import print_function
  import json
  import random
  from suggestion.models import Study
  from suggestion.models import Trial
  from suggestion.algorithm.abstract_algorithm import AbstractSuggestionAlgorithm
label_desc: Use image node_id 3 for calling the Particle obj's underlying member method code with example usage: obj.updateVelocities(gBest) without return types