Skip to main content
. 2023 Jul 7;23(13):6224. doi: 10.3390/s23136224
Algorithm 1 Pseudocode of HHAOA technique.
  • Input: 

    Random WMN routers positions and manually calculated FOPPI controller parameters.

  • Output: 

    Optimal WMN connection and FOPPI parameters

  • 1:

    Initialize the search agents positions yj (j = 1, 2, 3, ..., N)

  • 2:

    Check search space boundary and initiate the tT case

  • 3:

    while (t T) do

  • 4:

        Attain the initial solution yB

  • 5:

        for (All hawks (yj)) do

  • 6:

            Amend the position update

  • 7:

            Use (4) to update the E

  • 8:

            Phase: Exploration

  • 9:

            if |E| 1 & q0.5 then

  • 10:

               if c0.5 then

  • 11:

                   Update the solution using Equation (1) condition 1

  • 12:

               else if c<0.5 then

  • 13:

                   Update the solution using Equation (1) condition 2

  • 14:

               end if

  • 15:

           else if |E| 1 & q<0.5 then

  • 16:

               Update the solution using Equation (1) condition 3

  • 17:

            end if

  • 18:

            Phase: Exploitation

  • 19:

            if |E| < 1 then

  • 20:

               if (|E| 0.5 and r ≥ 0.5) then

  • 21:

                   if c<0.5 then

  • 22:

                       Solution update using Equation (5) condition 1

  • 23:

                   else if c0.5 then

  • 24:

                       Solution update using Equation (5) condition 2

  • 25:

                   end if

  • 26:

               else if (|E| 0.5 and r < 0.5) then

  • 27:

                   if c<0.5 or c0.5 then

  • 28:

                       Solution update using Equation (7) condition 1

  • 29:

                   else if c<0.5 or c0.5 then

  • 30:

                       Solution update using Equation (7) condition 2

  • 31:

                   end if

  • 32:

               else if (|E|<0.5 & r ≥ 0.5) then

  • 33:

                   if c<0.5 then

  • 34:

                       Solution update using Equation (8) condition 1

  • 35:

                   else if c0.5 then

  • 36:

                       Solution update using Equation (8) condition 2

  • 37:

                   end if

  • 38:

               else if (|E|< 0.5 & r < 0.5) then

  • 39:

                   if c<0.5 or c0.5 then

  • 40:

                       Solution update using Equation (9) condition 1

  • 41:

                   else if c<0.5 or c0.5 then

  • 42:

                       Solution update using Equation (9) condition 2

  • 43:

                   end if

  • 44:

               end if

  • 45:

            end if

  • 46:

        end for

  • 47:

        t = t + 1

  • 48:

    end while 

  • 49:

    Return YB for optimal WMN connectivity with all the routers and optimal FOPPI controller parameters for real-time pressure process plant.