Skip to main content
. 2016 Sep 25;16(10):1576. doi: 10.3390/s16101576
Algorithm 6. Power Adjustment for Cluster Members (PA-CM)
Run at a FCH node (e.g., w)
Input: the hello messages of all neighbors
Output: NULL
1. Broadcast a PAREQ packet at its maximum transmission power to the cluster members
2. if receive the first PAREP packet from any cluster member (e.g., x) then
3.   Add IDx to the power acknowledge list message
4.   Set the timer tφ as φ
5.   while the timer t does not expire do
6.    if receive the PAREP packet from any cluster member (e.g., y) then add IDy to the power acknowledge list message
7.   end while
8. end if
9. Broadcast the power acknowledge list message at its maximum transmission power
10. if the PAREP packet of any cluster member (e.g., x) arrives after the time φ then go to step 3
Run at any cluster member (e.g., x)
Input: the hello messages of all neighbors and the very small real number ε
Output: the adjusted transmission power from cluster member to FCH
11. if receive the PAREQ packet from the FCH (e.g., w) then
12.   Adjust the transmission power ptx,w according to the Formula (11)
13.   Send a PAREP packet at ptx,w to the FCH
14. end if
15. if receive the “power acknowledge list message” from the FCH (e.g., w) then
16.   if the IDx is not in the “power acknowledge list message” then
17.    ptx,w = ptx,w + ε
18.    Send a PAREP packet at ptx,w to the FCH
19.   else return end if
20. end if