Detailed Pseudocode of the ABC Algorithm
1: Initialize the population of solutions x
i,j
2: Evaluate the population
3: cycle=1
4: repeat
5: Produce new solutions (food source positions) υ
i,j
in the neighbourhood of x
i,j
for the
employed bees using the formula υ
i,j
= x
i,j
+ Φ
ij
(x
i,j
- x
k,j
) (k is a solution in the
neighbourhood of i, Φ is a random number in the range [-1,1] )and evaluate them
6: Apply the greedy selection process between x
i
and υ
i
7: Calculate the probability values P
i
for the solutions x
i
by means of their fitness
values using the equation (1)
∑
=
=
SN
i
i
i
i
fit
fit
P
1
(1)
In order to calculate the fitness values of solutions we employed the following
equation (eq. 2):
⎪
⎪
⎭
⎪
⎪
⎬
⎫
⎪
⎪
⎩
⎪
⎪
⎨
⎧
<+
≥
+
=
0 )(1
0
1
1
ii
i
i
i
fiffabs
fif
f
fit (2)
Normalize P
i
values into [0,1]
8: Produce the new solutions (new positions) υ
i
for the onlookers from the solutions x
i,
selected depending on P
i,
and evaluate them
9: Apply the greedy selection process for the onlookers between x
i
and υ
i
ABC算法的详细伪代码