Skip to main content
. 2023 Jul 11;8(3):305. doi: 10.3390/biomimetics8030305
Algorithm 1. Pseudo-code of RSA
1. Define Dim, UB, LB, Max_Iter(T), Curr_Iter(t), α, β, etc
2. Initialize the population randomly pi(i=1,2,…,m)
3. while (t < T) do
4.  Evaluate the fitness of each pi(i=1,2,…,m)
5.  Find Best solution
6.  Update the ES using Equation (6).
7.  for (i = 1 to m) do
8.   for (j = 1 to n) do
9.   Update the η, R, P and values using Equations (4), (5) and (7), respectively.
10.   If (t ≤ T/4) then
11.    Calculate pi,jt+1 using Equation (3)
12.   else if (t ≤ 2T/4 and t > T/4) then
13.    Calculate pi,jt+1 using Equation (3)
14.   else if (t ≤ 3T/4 and t > 2T/4) then
15.    Calculate pi,jt+1 using Equation (8)
16.   else
17.    Calculate pi,jt+1 using Equation (8)
19.    end if
20.   end for
21.  end for
22.  t = t+1
23. end while
24. Return the best solution.