Skip to main content
. 2026 Aug 12;11(8):576. doi: 10.3390/biomimetics11080576
Algorithm 2 Reptile Search Algorithm (RSA)
  •   1:

    Initialize RSA parameters α,β and initialize the population.

  •   2:

    while t<T do

  •   3:

          Calculate the fitness of individuals and the global best individual.

  •   4:

          Update the ES

  •      

    The beginning of the RSA

  •   5:

          for i=1 to N do

  •   6:

                for j=1 to D do

  •   7:

                   Update the η(i,j)(t), R(i,j)(t), P(i,j)(t).  

  •      

                    Exploration phase

  •   8:

                   if t⩽T4 then

  •   9:

                       x(i,j)(t+1)=Bestj(t)×−η(i,j)(t)×β−R(i,j)(t)×rand                        High walking

  • 10:

                   else if t⩽2T4 and t>T4 then

  • 11:

                       x(i,j)(t+1)=Bestj(t)×x(r1,j)×ES(t)×rand                                Belly walking  

  •      

                    Exploitation phase

  • 12:

                   else if t⩽3T4 and t>2T4 then

  • 13:

                       x(i,j)(t+1)=Bestj(t)×P(i,j)(t)×rand                              Hunting Coordination

  • 14:

                   else

  • 15:

                       x(i,j)(t+1)=Bestj(t)−η(i,j)(t)×ϵ−R(i,j)(t)×rand               Hunting cooperation

  • 16:

                   end if

  • 17:

                end for

  • 18:

          end for

  • 19:

          t=t+1

  • 20:

    end while

  • 21:

    return the global best.