Skip to main content
. 2022 Nov 20;7(4):204. doi: 10.3390/biomimetics7040204
Algorithm 1 Pseudocode of the SOA.
Start SOA.
1. Input problem information: variables, the objective function, and constraints.
2. Set the population size (N) and the total number of iterations (T)
3. Generate the initial population matrix at random.
4. Evaluate the objective function.
5. For t = 1 to N
6.   For i = 1 to N
7.   Phase 1: Prey selection and attacking (exploration)
8.     Update the best member of population as prey location.
9.     Calculate the new position of the ith SOA member based on attack simulation using Equation (4). xi,jP1xi,j+ri,j·(PjIi,j·xi,j)
10.     Update the ith SOA member using Equation (5). Xi{XiP1, FiP1<Fi,Xi, else,
11.   Phase 2: Chase process (exploitation)
12.     Calculate new position of the ith SOA member based on simulation the chase using Equation (6).
xi,jP2xi,j+ri,j·(ubjlbj)t
13.     Update the ith SOA member using Equation (7). Xi{XiP2, FiP2<Fi,Xi, else,
14.   end
15.   Save the best candidate solution so far.
16. end.
17. Output the best quasi-optimal solution obtained with the SOA.
End SOA.