|
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 do
-
4:
if not in the neighbor table AND Received ACK then
-
5:
Add to neighbor table
-
6:
set and 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:
-
15:
Update 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
-
23:
if (if optimal transmission power changes) then
-
24:
signals the demand () to the parent
-
25:
end if
-
26:
end for
|