Skip to main content
. 2020 Feb 4;20(3):820. doi: 10.3390/s20030820
Algorithm 1 GWO pseudo-code
1: Initialize the grey wolf population Xi(i=1,2,,n);
2: Initialize a, A, and C;
3: Calculate the fitness value for each grey wolf;
4: Xα0= the initial position of the leader wolf;
5: Xβ0= the initial position of the second-best wolf;
6: Xδ0= the initial position of the third-best wolf;
7: Calculate the initial position of prey (XP0) according to Equation (5);
8: While (t < Max number of iterations)
9: For each grey wolf
10: Update the position of current grey wolf by Equation (1);
11: end For
12: Update a, A, and C;
13: Calculate the fitness value for each grey wolf;
14: Update Xαt, Xβt, and Xδt;
15: Calculate the position of prey (XPt) according to Equation (5);
16: t=t+1;
17: End while
18: return Xαt.