Skip to main content
. 2023 Feb 8;25(2):314. doi: 10.3390/e25020314
Algorithm 3 Pseudocode of ABBFGO
  •   1:

    Initialize the parameters of BFGO: N (number of search agents), T (maximum iteration), n (number of bamboo shoots) and K (number of bamboo whips)

  •   2:

    Initialize the positions of the search agents

  •   3:

    Calculate the fitness of each search agent

  •   4:

    The search agents are sorted in descending order of fitness and divided into K groups according to the uniform grouping in Figure 2

  •   5:

    Update XG, XP(k), f(XG) and f(XP(k))

  •   6:

    t=2

  •   7:

    whilet<T+1do

  •   8:

       if t>10&&Convergence(t)==Convergence(t-3) then

  •   9:

         Use the long-mutation strategy to generate new solutions

  • 10:

         If the fitness value of the new solution is greater than the global optimal value, replace it

  • 11:

         Update XG, XP(k), f(XG) and f(XP(k))

  • 12:

       end if

  • 13:

       for i = 1;i ≤ k;i++ do

  • 14:

         if XP(k) not updated then

  • 15:

            P++

  • 16:

         end if

  • 17:

       end for

  • 18:

       if P = k then

  • 19:

         Do Random grouping

  • 20:

       end if

  • 21:

       for each bamboo whip do

  • 22:

         Update C(k) using Equation (1)

  • 23:

         Update the Xt+1 using Equations (2)–(6)

  • 24:

         Calculate the position under binary conditions of each search agent by Equations (11)–(21)

  • 25:

         Calculate f(Xt+1)

  • 26:

       end for

  • 27:

       Update XG, XP(k), f(XG) and f(XP(k))

  • 28:

       for each bamboo whip do

  • 29:

         Update C(k) using Equation (1)

  • 30:

         Update the Xtemp using Equations (7)–(10)

  • 31:

         Calculate the position under binary conditions of each search agent by Equations (11)–(21)

  • 32:

         Calculate f(Xtemp)

  • 33:

       end for

  • 34:

       Update XG, XP(k), f(XG) and f(XP(k))

  • 35:

       Convergence(t) = f(XG)

  • 36:

       t=t+1

  • 37:

       Repeat step 4

  • 38:

    end while