(1) switch Event do |
(2) case Timer fired |
(3) , , , 0; |
(4) Measure and calculates ; |
(5) Share and information with neighbors; |
(6) for do |
(7) Update via Formula 5, 6, and 7; |
(8) if then ; |
(9) Call Receptor Selection method; |
(10) case Receive from node |
(11) ; |
(12) Call Receptor Selection Method; |
(13) case Receive from node |
(14) Conduct energy sharing control; |
(15) case Receive from node |
(16) ; |
(17) Wait until receives all the from neighbors; |
(18) From , select which has the maximum ; |
(19) Send to ; |
(20) Conduct energy sharing control; |
(21) ; |
(22) Send to all the nodes in ; |
(23) Receptor Selection method: |
(24) if then |
From , select node which has the maximum ; |
Send to ; |