Skip to main content
. 2023 Feb 3;23(3):1722. doi: 10.3390/s23031722
Algorithm 4 Pseudocode of AO.
1:
                 Initialization part.
2: Set up parameters of AO algorithm.
3: Initialize population in a random way {x1,x2,…,xN}.
4:
                  Iterative part.
5: for iterationi=1,2,…,I do
6:  Determine values of the fitness function F for each agent in the population.
7:  Establish the best solution xbest in the population.
8:  for k=1,2,…,N do
9:    Calculate mean solution xmean in the population.
10:    Improve parameters G1,G2,QF of the algorithm.
11:    if iterationi≤23I then
12:      if rd<0.5 then
13:        Perform step expanded exploration (17) by updating solution xk.
14:        In the result solution xnew,k is obtained.
15:        if F(xnew,k)<F(xk) then make substitution xk=xnew,k
16:        end if
17:        if F(xnew,k)<F(xbest) then make substitution xbest=xnew,k
18:        end if
19:      else
20:        Perform step narrowed exploration (19) by updating solution xk.
21:        In the result solution xnew,k is obtained.
22:        if F(xnew,k)<F(xk) then make substitution xk=xnew,k.
23:        end if
24:        if F(xnew,k)<F(xbest) then make substitution xbest=xnew,k.
25:        end if
26:      end if
27:    else
28:      if rd<0.5 then
29:        Perform step Expanded exploitation (23) by updating solution xk.
30:        In the result solution xnew,k is obtained.
31:        if F(xnew,k)<F(xk) then make substitution xk=xnew,k.
32:        end if
33:        if F(xnew,k)<F(xbest) then make substitution xbest=xnew,k.
34:        end if
35:      else
36:        Perform step narrowed exploitation (24) by updating solution xk.
37:        In the result solution xnew,k is obtained.
38:        if F(xnew,k)<F(xk) then make substitution xk=xnew,k.
39:        end if
40:        if F(xnew,k)<F(xbest) then make substitution xbest=xnew,k.
41:        end if
42:      end if
43:    end if
44:  end for
45: end for
46: return xbest.