ABC PsuedoCode
ABC PsuedoCode
3: cycle=1
4: repeat
5: Produce new solutions (food source positions) υi,j in the neighbourhood of xi,j for the
employed bees using the formula υi,j = xi,j + Φij(xi,j - xk,j) (k is a solution in the
neighbourhood of i, Φ is a random number in the range [-1,1] )and evaluate them
7: Calculate the probability values Pi for the solutions xi by means of their fitness
values using the equation (1)
fit i
Pi = SN
(1)
∑ fit
i =1
i
⎧ 1 ⎫
⎪1 + f if f i ≥ 0⎪
⎪ i
⎪
fit i = ⎨ ⎬ (2)
⎪1 + abs ( f ) if f i < 0⎪
⎪ i
⎪
⎩ ⎭
8: Produce the new solutions (new positions) υi for the onlookers from the solutions xi,
selected depending on Pi, and evaluate them
9: Apply the greedy selection process for the onlookers between xi and υi
10: Determine the abandoned solution (source), if exists, and replace it with a new
randomly produced solution xi for the scout using the equation (3)
xij=minj+rand(0,1)*(maxj-minj) (3)
11: Memorize the best food source position (solution) achieved so far
12: cycle=cycle+1