We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 2
Data; Set the control parameters of the ABC algorithm
‘SN: Number of Foods
limit: Maximum number of trial for abandoning a source
-MFE: Maximum number of fitness evaluations
begin
//Initialization:
mun-eval — 0
for s=1 to SN do
X(s) — random solution by Eq. 1 (3:
fe— FM):
rrial(s) — 0:
num.eval ++:
end
repeat
//Employed Bees Phase:
for s= 110 SN do
x — anew solution produced by Eq. 2
f(x’) — evaluate new solution:
mum eval + +:
if f(x’) < f then
AS) Hf — Fl"): malls) — 0:
else
mrial(s) = wrial(s) +1:
end
if numeval == MFE then
‘Memorize the best solution achieved so far and exit main repeat:
end
end
Calculate the probability values p, for the solutions using fitness values by Eqs. 3 and 4 [3]:
/{0nlooker bee phase:
sohtel
repeat
7 rand(O.1):
itr < p(s) then
r+:
x’ — ancw solution produced by Eq. 2
f(x") — evaluate new solution;
mumeval + +5
if fl) < f, then
Xs) 3 fe — fy: alls) — 0:
else
trial(s) — trial(s) +1:
end
if num_eval == MFE then
‘Memorize the best solution achieved so far and exit main repeat;
end
end
s— (s mod SN) +1:
until r= SN:
//Scout Bee Phase:
ni (s =: trial(s) = max(@riai)}:
if rialont) >= init then
X(oni) — random solution by Eq. 1 (3:
Sos — SX)
mum-_eval + +3
srial(oni) — 0:
‘if num_eval MFE then
Memorize the best solution achieved so far and exit main repeat:
end
end
Memorize the best solution achieved so far:
until numeval = MFE :
end
Algorithm 1: The pseudo-code of ABCinp(FEs)Data: Set the control parameters of the ABC algorithm,
SN Number of Foods
Tinit: Maximum number of trial for abandoning a source
MCN: Maximum number of cycles
begin
//Initialization:
mum-eval — 0:
for s= 110 SN'do
X(6) —— random solution by Eq. 1 I:
Fe — FX):
trials) — 0:
num eval + +:
end
evele — 1:
while cycle < MCN do
//®mployed Bees Phase:
mi — (5: trial(s) = max(erial):
for s= 110 SN do
Af (ivial(s) < limit or s!= mi) then
Y — a new sohition produced by Eq,
f(x") — evaluate new solution:
mum eval ++:
if f(s") < f, then
A)
f, — fix’): wrial(s) — 0:
else
trials) — triai(s) +1:
end
end
end
Memorize the best solution achieved so far:
//Scout Bee Phase:
if (rrial(ni) >= limit then
X(ni) — random solution by Ea. 1 [3]:
Sot — FOXCni)y.
mum .eval ++:
sriai(ni) — 0;
end
Calculate the probability values p, for the solutions using fitness values by Eqs. 3 and 4 [3]:
//0nlooker Bees Phase:
sohrel:
while t< SN do
7 — rand(0, 1):
ifr < p(s) then
fo tel
x — anew solution produced by Eq. 2
(x?) — evaluate new solution:
um-eval ++:
it f(’) < f, then
NG) VL S00): rials) — 05
else
mrial(s) — trial(s) +1:
end
end
5 (5 mod SN) +1:
end
‘Memorize the best solution achieved so far:
cvcle ++:
end
end
Algorithm 2: The pseudo-code of the ABCinp2(F Es)