Skip to main content
. 2024 Dec 16;9(12):765. doi: 10.3390/biomimetics9120765
Algorithm 1 The proposed SWO
Input: N, Nmin, CR, TR, tmax
Output: SW*
1. Initialize N female wasps, SWi (i=1, 2, ..., N), using Equation (3)
2. Evaluate each SWi and finding the one with the best fitness in SW*
3. t = 1; //the current function evaluation
4. while (t < tmax)
5.   r6: generating a random number between 0 and 1
6.   if (r6<TR) %% Hunting and Nesting behaviors
7.     for i=1:N
8.     Applying Figure 2
9.     Compute f(SWi)
10.     t = t + 1;
11.    End for
12.   Else %% Mating Behavior
13.    for i=1:N
14.    Applying Equation (21)
15.    t = t + 1;
16.    End for
17.   End if
18.   Applying Memory Saving
19.   Updating N using Equation (25)
20. End while