Skip to main content
. 2021 Jul 8;23(7):874. doi: 10.3390/e23070874
Algorithm 3 ABC
  • Input: the parameters M, N, δ, F, Limit

  • Begin

  • S1: initialize M individuals xi(t) randomly by Equation (2), and appoint M2 bees to the employed foragers, iterative times t = 1;

  • S2: compute f(i), 0<iM, update pg(t); if it satisfies (t > N or precision δ), then go to step S4; otherwise, go to step S3;

  • S3: employed foragers search new food sources by Equation (3) and compute f(i); update the food sources if the new one is better than the old one; onlookers choose food sources of employed foragers according to Equations (4) and (5), and generate new food sources by Equation (3); update the food sources if the new one is better than the old one; if there are some food sources which need to be given up (cannot be optimized after Limit times searches); the corresponding bees become the scouts, and generate new sources by Equation (2); increase times t = t + 1, go to step S2;

  • S4: output the optimized results.

  • End