|
Algorithm 2: Pseudocode of new BGOA |
-
1:
Initialize , (two extreme values of parameter c), (iterations’ maximum) and N (population of grasshoppers)
-
2:
Set the best solution as Target
-
3:
whilet ≤ Maxiter do
-
4:
Update c with Equation (6)
-
5:
for each agent do
-
6:
Normalize the distance among two individuals to [1, 4]
-
7:
Calculate probability using Equation (9) or Equation (10) or Equation (11)
-
8:
Update using Equation (12) or Equation (13)
-
9:
Update Target, if a better value is obtained
-
10:
end for
-
11:
-
12:
end while
-
13:
Output Target
|