Skip to main content
. 2026 Jan 8;11(1):57. doi: 10.3390/biomimetics11010057
Algorithm 1: Pseudo-code of PFA
1.  Load PFA parameter
2.  Initialize the population
3.  Calculate the fitness of initial population
4.  Find the pathfinder
5.  While K < maximum number of iterations
6.        α and β = random number in [1,2]
7.        Update the position of pathfinder using Equation (1) and check the bound
8.        if new pathfinder is better than old
9.               Update pathfinder
10.       end
11.       for i = 2 to maximum number of populations
12.             Update the position of members using Equation (2) and check the bound
13.       end
14.       Calculate new fitness of members
15.       Find the best fitness
16.       if best fitness < fitness of pathfinder
17.             Pathfinder = best member
18.             Fitness = best fitness
19.       end
20.       for i = 2 to maximum number of populations
21.             if new fitness of member(i) < fitness of member(i)
22.                 Update members
23.             end
24.       end
25.       Generate new A and ε.
26. end