Skip to main content
. 2024 Apr 6;24(7):2330. doi: 10.3390/s24072330
Algorithm 1 ACTOR
  • 1:

    Upon receiving a DIO, measure RSSI

  • 2:

      Initialize the Action Values-Based Equation (5)

  • 3:

    for each packet p sent through neighbor Nbr do

  • 4:

        if Nbr not in the neighbor table AND Received ACK then

  • 5:

            Add Nbr to neighbor table

  • 6:

            set Nt(a) and X¯t(a) to zero for all transmission power settings

  • 7:

        end if

  • 8:

        if Parent Switch happened then

  • 9:

            Reset the learned Action Values

  • 10:

        end if

  • 11:

        Calculate UCB index and select transmission power based on based on Equation (8)

  • 12:

        Select UCB index based on Equation (9)

  • 13:

        Transmit packet with selected transmission power

  • 14:

        Increment the counter for transmission power a: Nt(a)=Nt(a)+1

  • 15:

        Update demandNbr from

  • 16:

        if packet sent successfully then

  • 17:

            the Action Values based on Equation (7)

  • 18:

        end if

  • 19:

        if packet sent failed then

  • 20:

            the Action Values based on Equation (7)

  • 21:

        end if

  • 22:

        Set the transmission power to max(UCB,demandi)

  • 23:

        if AtAt1 (if optimal transmission power changes) then

  • 24:

            signals the demand (At) to the parent

  • 25:

        end if

  • 26:

    end for