Skip to main content
. 2023 Aug 29;23(17):7508. doi: 10.3390/s23177508
Algorithm 5 Parallel Compact Food Digestion Algorithm
Output: Population size Np; Dimension D; Maximum number of iterations Maxiter; Lower boundary lb; Upper boundary ub;
Input: Global optimal position Bestp, Global optimal fitness value Bestf;
  • 1:
    Initialize the parameters a,b,a1,Km,Vmax,iter and the number of groups groups as well as the mean and standard deviation μ and δ for each group;
  • 2:
    while  iter<Maxiter  do
  • 3:
        for i=1:groups do
  • 4:
            Sampling generates particles Food1t and calculates their fitness values;
  • 5:
            Calculate the values of F1,F2,F3,C1,C2,Em and S;
  • 6:
            Calculate the values of F1d and V;
  • 7:
            Update the particle to get Food2t and calculate its fitness value;
  • 8:
            Calculate the values of F2d and V;
  • 9:
            Update the particle to get Food3t and calculate its fitness value;
  • 10:
          Calculate the values of F3d and V;
  • 11:
          Update the particle to get Food4t and calculate its fitness value;
  • 12:
          Find the particle with the best and worst fitness value among the four particles, denoted as winner and loser;
  • 13:
          Use winner and loser to update PV;
  • 14:
        end for
  • 15:
        Intergroup communication using parallel strategies;
  • 16:
        Find the global optimal solution Bestp and its fitness value Bestf;
  • 17:
        iter=iter+1;
  • 18:
    end while