|
Algorithm 1 The Competitive Swarm Optimizer Algorithm |
-
1:
Initialize ; // is the swarm ingeneration t, is the maximum number of iterations.
-
2:
for
to
do
-
3:
calculate the fitness of all particles in ;
-
4:
//L denotes a set of particles that have not yet participated in a competition.
-
5:
while
do
-
6:
randomly choose two particles
-
7:
if
then// is the fitness function for
-
8:
; // is the winner particle in generation t, and is the loser particle in generation t
-
9:
else
-
10:
-
11:
end if
-
12:
add into ;
-
13:
update using (1) and (2)
-
14:
add the updated into ;
-
15:
remove from L
-
16:
end while
-
17:
end for
|