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