Algorithm 3 Firefly Algorithm |
-
1:
Objective function ,
-
2:
Generate initial population of fireflies
-
3:
Light intensity I is given by where is the chosen objective function
-
4:
Define light absorption coefficient
-
5:
while maxGeneration do
-
6:
for
do
-
7:
for
do
-
8:
if
then
-
9:
Move firefly i towards firefly j
-
10:
end if
Vary attractiveness according to r
-
11:
Evaluate new solution and update light intensity
-
12:
end for
-
13:
end for
-
14:
Rank the fireflies and find the current global best
-
15:
end while
|