Skip to main content
. 2022 Dec 16;16:1029690. doi: 10.3389/fninf.2022.1029690

Algorithm 1.

Pseudo-code of CS.

     Initialize the fitness value function
     f(x),x = (x1,x2,x3,⋯,xd)T
     Initialize the number of
     iterationst = 0, discovered parameters
     Pa = 0.25
     Initialize the individual solution xi0 of
     the overall N solutions, (i = 1,2,…,N)
     While lMaximum number of iterations
       Using Lévy flight
       Update all search agents xit in the
       population
       Evaluate the new solution xtnew,i for its
       fitness value ftnew,i
       If the new solution has a better
       fitness value
         Replace the old solution xjt with the
         updated solution xtnew,i
       End If
       Discard some poor-quality solutions
       by probability Pa and replace them
       with random ones
       Increase in the number of iterations
       t = t + 1
     End While
     Return the best solution