Skip to main content
. 2023 Aug 6;8(4):348. doi: 10.3390/biomimetics8040348
Algorithm 1 Pseudo-code of the ASFAOA algorithm.
1 Initialize the Arithmetic Optimization Algorithm parameters α, µ
2 Initialize the parameters a
3 Initialize the solutions’ positions randomly. (Solutions: i = 1,...,Np)
4 while (t < tmax) do
5  Calculate the Fitness Function for the given solutions
6  Find the best solution (Determined best so far).
7  Update the MOA value using Equation (15).
8  Update the MOP value using Equation (4).
9  Update the k value using Equation (10).
10  Update the Cov value using Equations (18)~(20).
11  for (i = 1 to Solutions) do
12   Update positions by Equations (7) and (9)
13   Generate a random values between [0, 1] (r1, r2, and r3)
14   if r1 > MOA then
15    if r2 > 0.5 then
16      Update positions by Equation (3)
17    else
18      Update positions by Equation (16)
19    end if
20   else
21    if r3 > 0.5 then
22      Update positions by Equation (5)
23    else
24      Update positions by Equation (11)
25    end if
26   end if
27   Update positions by Equation (21)
28  end for
29  t = t + 1
30 end while
31 Return the best solution.