| Algorithm 1. The pseudocode of the WOA algorithm. |
|
Input: G: the maximum iterations b: a constant for defining the shape of the logarithmic spiral n: the number of whale populations Output 1: Initialize the whale population 2: Calculate the fitness value of each individual 3: while (t < G) 4: for each individual 5: Update a, A, C, l, P (some constants) 6: if1 (P < 0.5) 7: if2 (|A| < 1) updates its position by encircling prey 9: else if2 (|A| ≥ 1) 10: updates its position by searching for prey 11: end if2 12: else if1 (P ≥ 0.5) updates its position by bubble-net attacking 14: end if1 15: end for 16: Check to see if any individuals are out of range and remove them if they are 17: Calculate the fitness value of each individual 19: end while , |