Skip to main content
. 2023 Feb 8;25(2):314. doi: 10.3390/e25020314
Algorithm 1 Pseudocode of BFGO
  •   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:

       for each bamboo whip do

  •   9:

         Update C(k) using Equation (1)

  • 10:

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

  • 11:

         Calculate f(Xt+1)

  • 12:

       end for

  • 13:

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

  • 14:

       for each bamboo whip do

  • 15:

         Update C(k) using Equation (1)

  • 16:

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

  • 17:

         Calculate f(Xtemp)

  • 18:

       end for

  • 19:

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

  • 20:

       t=t+1

  • 21:

       Repeat step 4

  • 22:

    end while