Skip to main content
. 2025 Feb 28;11:e2722. doi: 10.7717/peerj-cs.2722

Algorithm 1. Pseudo-code of ASO algorithm.

1: Input: upper and lower bounds of variables (xmax and xmin), dimension of the problem (D), maximum number of iterations (T), number of population (N), β, and α.
2: Initialize the velocity and position of atoms randomly.
3: Calculate the fitness of atoms.
4: Record the best solution.
5: Initialize iteration count: t=1.
6: while (tT) do
7:   for i = 1 to N do
8:     Compute mass by Eqs. (13) and (14).
9:     Define subset K atoms by Eq. (2).
10:     Calculate the interaction force by Eq. (1).
11:     Compute the constraint force by Eq. (9).
12:     Calculate the acceleration by Eq. (12).
13:     Update the velocity of the atoms by Eq. (15).
14:     Update the position of atoms by Eq. (16).
15:     Check if the new position is within boundaries.
16:     Evaluate the current fitness.
17:   end for
18:    t=t+1.
19: end while
20: Output: Return the best solution.