Skip to main content
. 2023 Aug 29;23(17):7508. doi: 10.3390/s23177508
Algorithm 1 Food Digestion Algorithm
Output: Population size N; 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 populations and calculate their fitness values;
  • 2:
    Record the optimum global position Bestp;
  • 3:
    Initialize the parameters a,b,a1,Vmax,Km;
  • 4:
    while  iter<Maxiter  do
  • 5:
        Backup the initialized populations and their fitness values;
  • 6:
        Calculate the values of F1, F2, and F3 according to Equations (1), (9) and (14);
  • 7:
        Calculate the value of R according to Equation (8);
  • 8:
        Calculate the values of C1 and C2;
  • 9:
        for i=1:N do
  • 10:
            Calculate the values of Em and S according to Equations (3) and (5);
  • 11:
            if i<=N/3 then
  • 12:
               Calculate the values of F1d and V according to Equations (2) and (4);
  • 13:
               Update the particle according to Equation (6);
  • 14:
               Calculate the fitness value of the particle;
  • 15:
               if i==N/3 then
  • 16:
                   Find the minimum fitness value in the oral cavity fitnessm;
  • 17:
                   Update the particle according to Equation (13);
  • 18:
               end if
  • 19:
            end if
  • 20:
            if i>N/3 and i<=2N/3 then
  • 21:
               Calculate the values of F2d, V, and Mean according to Equations (4), (10) and (12);
  • 22:
               Update the particle according to Equation (11);
  • 23:
               Calculate the fitness value of the particle;
  • 24:
               if i==2N/3 then
  • 25:
                   Find the minimum fitness value in the stomach fitnessn;
  • 26:
                   Update the particle according to Equation (17);
  • 27:
               end if
  • 28:
            end if
  • 29:
            if i>2N/3 then
  • 30:
               Calculate the values of F3d and V according to Equations (15) and (4);
  • 31:
               Update the particle according to Equation (16);
  • 32:
               Calculate the fitness value of the particle;
  • 33:
            end if
  • 34:
        end for
  • 35:
        for i=1:N do
  • 36:
            if The historical optimal fitness value of the particle < Updated particle optimal fitness value then
  • 37:
               Replace the updated particle position and fitness value with the particles’ optimal historical position and fitness value;
  • 38:
            end if
  • 39:
        end for
  • 40:
        Backup of the particle’s historical optimal position and its fitness value;
  • 41:
        Update optimal global position and optimal global value;
  • 42:
        iter=iter+1;
  • 43:
    end while