code: def __init__(
      self,
      func,
      n_dim,
      size_pop=50,
      max_iter=200,
      w=0.8,
      c1=0.1,
      c2=0.1,
  ):
      self.func = func_transformer(func)
      self.func_raw = func
      self.n_dim = n_dim
      self.size_pop = size_pop
      self.max_iter = max_iter
  
      self.w = w
      self.cp = c1
      self.cg = c2
  
      self.X = self.crt_X()
      self.Y = self.cal_y()
      self.pbest_x = self.X.copy()
      self.pbest_y = np.array([[np.inf]] * self.size_pop)
  
      self.gbest_x = self.pbest_x[0, :]
      self.gbest_y = np.inf
      self.gbest_y_hist = []
      self.update_gbest()
      self.update_pbest()
  
      # record verbose values
      self.record_mode = False
      self.record_value = {"X": [], "V": [], "Y": []}
      self.verbose = False
  
imports: import numpy
  from sko.tools import func_transformer
  from .base import SkoBase
  from .operators import crossover, mutation, ranking, selection
  from .operators import mutation
label_desc: Use image node_id 1 to create a new PSO_TSP object from inherited base classes: SkoBase with example: obj = PSO_TSP(func, n_dim, size_pop, max_iter, w, c1, c2)