Skip to main content
. 2022 Nov 30;22(23):9332. doi: 10.3390/s22239332
Algorithm 1: Pseudocode for boundary cut-off point of LSFZ and HSFZ.

Input:Psuci(loc(x)): LoRa device success probability

Input:N: number of IoT LoRa devices

Input:x: LoRa device’s location

Input: BW: bandwidth

Input: SF: spreading factor of a LoRa device

Output: Boundary point LSFZ and HSFZ, Pth

  • 1:

    Initialization

  • 2:

    Sum0

  • 3:

    Pmax0

  • 4:

    Popt0

  • 5:

    forΘth=0: 100 do

  • 6:

        for i=1: N do

  • 7:

            Calculate Psuci(loc(x)) in Equation (13)

  • 8:

            Calculate PΔsuci(Psuci(loc(x)),Θth)

  • 9:

            Sum+=PΔsuci(Psuci(loc(x)),Θth)

  • 10:

        end for

  • 11:

        Calculate Pavg(Θth) = SumN

  • 12:

        if Pmax <Pavg(Θth) then

  • 13:

            Pmax = Pavg(Θth)

  • 14:

            Popt = Θth

  • 15:

        end if

  • 16:

    end for

  • 17:

    return Popt