Skip to main content
. 2023 Feb 3;23(3):1722. doi: 10.3390/s23031722
Algorithm 1 Pseudocode of ACO algorithm.
1:
                Initialization part.
2: Configuration of ACO algorithm parameters.
3: Initialization of starting population {x1,x2,…,xL} in a random way.
4: Calculation value of the fitness function F for all pheromone spots and sorting them according to their rank (quality).
5:
                Iterative part.
6: for iterationi=1,2,…,I do
7:  Assignment of probability to pheromone spots according to the Equation (10).
8:  for antm=1,2,…,M do
9:    The ant chooses the k-th (k=1,2,…,L) solution with probability pk.
10:    for coordinatej=1,2,…,n do
11:      Using the probability density function (12) in the sampling process, the ant changes the j-th coordinate of the k-th solution.
12:    end for
13:  end for
14:  Calculation the value of the fitness function F for M new solutions.
15:  Adding M new solutions to the set of archive of old, sorting the archive by quality and then rejection of the M worst solutions.
16: end for
17: return best solution xbest.