Initialize number of particles, dimension of
  particle, maximum iterations, objective
  optimization criteria, , and , and so forth.
   For each particle i
Initialize and ;
Initialize ;
  Initialize ;
–Search the Best Solution
 For each particle
       Update according to Equation (3);
        Update according to Equation (4);
        Evaluate the fitness of current according to
        Equations (1) and (2);
        If current is better than , then
Update using the best particle;
  While max iterations or objective optimization
criteria is reached.
Algorithm 1: Process of APSCA.