Skip to main content
. 2026 Aug 17;11(8):584. doi: 10.3390/biomimetics11080584
Algorithm 1. Pseudo code of SRW-PO
Input: fx,LB,UB,N,T
Output: Xbest, fbest
 
1.    Initialize Xi, i=1,…,N, within LB,UB
2.    Evaluate all individuals and determine Xbest
3.    Set stagnation counter s=0
 
4.    for t=1 to T do
5.            Compute progress ratio p using Equation (16)
6.            Compute elite mean Xelite using Equation (17)
 
7.            for i=1 to N do
8.                    Select a random peer Xpeer
9.                    Generate the exploration candidate using Equation (18)
10.                  Generate the exploitation candidate using Equation (19)
11.                  Select the basic puma candidate using Equation (20)
12.                  Apply boundary control using Equation (26)
13.                  Update Xi by greedy selection using Equation (27)
14.              end for
 
15.              Update Xbest and fbest
16.              Update stagnation counter s
 
17.              if p<0.68 or s>0 then
18.                  Select weak individuals
19.                  Generate random walk candidates using Equations (21)–(23)
20.                  Apply boundary control using Equation (26)
21.                  Accept improved candidates using Equation (27)
22.              end if
23.              if p>0.18 then
24.                  Select weak individuals
25.                  Generate spiral candidates using Equations (24) and (25)
26.                  Apply boundary control using Equation (26)
27.                  Accept improved candidates using Equation (27)
28.              end if
 
29.              Update Xbest and fbest
30. end for
 
31. return Xbest, fbest