Input:  𝑛 : The population size of particles
    𝑃 G e n : The iterated generations for searching process
    k: The population size of swarm
Output:The allele of the offspring’s antibodies (particles)
Process:
   For each swarm 𝑖 [ 1 𝑘 ]
    For each particle 𝑚 [ 1 𝑛 / 𝑘 ]
   Clone operation: 𝑁 𝑐 = 𝛼 𝑁
   Mutation operation: 𝑐 𝑖 = 𝑥 𝑖 + 𝛽 r a n d
      Replacement (restrain) operation:
    𝑑 ( 𝑖 , 𝑗 ) = 𝑛 𝑖 = 1 ( 𝑐 𝑖 𝑡 𝑦 𝑗 𝑡 ) 2 , 𝐴 ( 𝑖 , 𝑗 ) = 1 / 𝑑 ( 𝑖 , 𝑗 )
    If 𝐴 ( 𝑖 , 𝑗 ) > threshold, the particle (antibody) is replaced
   End For
   End For
Algorithm 3: Immune mechanism in the ICPSOA.