Skip to main content
. 2023 Dec 17;8(8):619. doi: 10.3390/biomimetics8080619
Algorithm 2: Pseudocode of GAO
Start GAO.
1. Input problem information: variables, objective function, and constraints.
2. Set GAO population size (N) and iterations (T).
3. Generate the initial population matrix at random using Equation (2). xi,dlbd+r·(ubdlbd)
4. Evaluate the objective function.
5. For t=1 to T
6. For i=1 to N
7. Phase 1: Attack on termite mounds (exploration phase)
8. Determine the termite mounds set for the ith GAO member using Equation (4). TMi{Xki:Fki<Fi and kii}
9. Select the termite mounds for the ith GAO member at random.
10. Calculate new position of ith GAO member using Equation (5). xi,dP1xi,d+r·(STMi,dI·xi,d)
11. Update ith GAO member using Equation (6). Xi{XiP1,  FiP1<FiXi,  else
12. Phase 2: Digging in termite mounds (exploitation phase)
13. Calculate new position of ith GAO member using Equation (7). xi,dP2xi,d+(12r)·(ubdlbd)t
14. Update ith GAO member using Equation (8). Xi{XiP2,  FiP2<FiXi,  else
15. end
16. Save the best candidate solution so far.
17. end
18. Output the best quasi-optimal solution obtained with the GAO.
End GAO.