Research Article

EER-RL: Energy-Efficient Routing Based on Reinforcement Learning

Algorithm 3

Data transmission.
(1)For i ← 1 to n, do
(2)If, then
(3)  
(4)  If
(5)   If S (i) is next-hop, then
(6)    Aggregate data
(7)    Send data to sink
(8)   Else
(9)    Send data to sink
(10)   End if
(11)  Else if, then
(12)   If CH within TXrange,then
(13)    Send data to CH
(14)   Else
(15)    Find closest neighbour in the cluster
(16)    Send data to closest neighbour
(17)   End if
(18)  End if
(19)  Compute reward
(20)  Update Q-value
(21)End if
(22)End for