|
Algorithm 2 The pseudocode of the FBCA |
-
1:
Input: Population Size: N, Problem Dimension: D, Max Iteration: Max_Gen, The Number Of Soldiers: nSoldiers
-
2:
Output: Obtained best solution
-
3:
Initialize the solutions’ positions randomly
-
4:
Initialize the velocities and BCB parameters
-
5:
while t ← 1 to Max_Gen do
-
6:
for i ← 1 to nArmies do
-
7:
for j ← 1 to nSoldiers do
-
8:
for to D do
-
9:
if rand < BCB then
-
10:
if rand < then
-
11:
Creation1: Sine-Guided Soft Asymmetric Gaussian Perturbation
-
12:
initial Gaussian perturbation item
-
13:
Update the soldier position by Equation (9)
-
14:
End Creation1
-
15:
else
-
16:
Creation2: Exponentially Modulated Spiral Perturbation
-
17:
Update by Equation (10)
-
18:
Update the soldier position by Equation (11)
-
19:
End Creation2
-
20:
end if
-
21:
Update the soldier position that exceeds the search boundaries By Equation (3)
-
22:
else
-
23:
Update by Equation (16)
-
24:
if rand < then
-
25:
Creation3: Nonlinear Cognitive Velocity Update
-
26:
Update by Equation (14)
-
27:
Update the position by Equation (13)
-
28:
End Creation3
-
29:
else
-
30:
Update the position by Equation (2)
-
31:
end if
-
32:
Update the soldier position that exceeds the search boundaries By Equation (4)
-
33:
end if
-
34:
end for
-
35:
end for
-
36:
end for
-
37:
Update gBest and gBestPos.
-
38:
end while
|