Skip to main content
. 2023 Jun 25;23(13):5881. doi: 10.3390/s23135881
Algorithm 3 ABC main steps
  • Initialize the food source locations (solutions) xij, i=1,,SN e j=1,,D

  • Define Nexh e Eexp; t: = 1

  • while (tMCN) and (solution not yet found) do

  •    Compute vij=xij+ϕij·(xijxkj)

  •    Evaluate new solutions using objective function

  •    Apply selection greedy process

  •    Compute probabilities Pi=f(xi)1SNf(xn)

  •    Compute onlookers vij using selected xij and Pi

  •    Evaluate new solutions using objective function

  •    Apply selection greedy process

  •    Determine source to abandon when hitting Nexh

  •    Replace the abandoned source xij=xbestj+rand(0,1)·(xmaxj+xminj)

  •    Store the best solution (food source) found so fa

  •    t: = t + 1

  • end while

  • Return best solution