Skip to main content
. 2023 Feb 9;25(2):317. doi: 10.3390/e25020317
Algorithm 1 Pseudo-code of the GOA.
  • Input: 

    N: population size; Dim: problem dimension; Tmax_iter: maximum number of iterations;

  • Output: 

    The position of the best individual and its fitness value;

  •   1:

    Initialize the population X randomly, r and q are all random numbers from 0 to 1;

  •   2:

    Generate memory matrix MX;

  •   3:

    Calculate the fitness value of X;

  •   4:

    while stopping condition is not met do

  •   5:

          if r>0.5 then

  •   6:

             for MXi do

  •   7:

                 if q0.5 then

  •   8:

                       Update the location Gannet using Equation (7),where q0.5;

  •   9:

                 else

  • 10:

                       Update the location Gannet using Equation (7),where q<0.5;

  • 11:

                 end if

  • 12:

             end for

  • 13:

        else

  • 14:

             for MXi do

  • 15:

                 if C0.2 then

  • 16:

                       Update the location Gannet using Equation (16),where C0.2;

  • 17:

                 else

  • 18:

                       Update the location Gannet using Equation (16),where C<0.2;

  • 19:

                 end if

  • 20:

             end for

  • 21:

        end if

  • 22:

        for MXi do

  • 23:

              Calculate the fitness value of MXi;

  • 24:

              If the value of MXi is better than the value of Xi, replace Xi with MXi;

  • 25:

        end for

  • 26:

    end while