Skip to main content
. 2025 Nov 13;25(22):6943. doi: 10.3390/s25226943
Algorithm 2. The pseudocode of ARO
Inputs: number of search agents (N), number of iterations (mi), problem dimension (d), and lower (LB) and upper (UB) boundaries of search space
Outputs: the best rabbit (XB) and its fitness (FB)
//Initialization
i=1
while (iN)
   Initialize Xi by Equation (16)
   Calculate Fi
   i=i+1
end for
Find XB and FB
ci= 1
while (ci<mi)
   i=1
   while (iN)
      Calculate energy shrink (A) by Equation (17)
      if A>1
        //Detour foraging
        Update Xi using Equation (19)
      else
        //Random hiding
        Update Xi using Equation (27)
      end if
      Compute Fi
      i=i+1
   end for
   Update XB and FB
   ci= ci+ 1
end while
Return XB and FB