| Algorithm 2: Discrete method to calculate data load and energy consumption |
|
Input: The whole network radius R, original broadcast radius r, common ratio q, the probability of generating data and energy parameters in Table 1 1. Initializetotal_Q to all zeros/*total_ denotes a set of total data load in the Sector i */ 2. InitializeQ to all zeros/* is a set of average data load for each node in Sector i */ 3. for i in [R...1] do 4. /*i is the distance from current node v to sink*/ 5. Treat i as and calculate using Equation (11) 6. Calculate using Equation (12) 7. total_Q(i) = total_Q(i) + i 8. tmpi = i − ⌊⌋ 9. if tmpi > 0 then 10. total_Q(tmpi) = total_Q(tmpi) + total_Q(i) 11. end 12. Q(i) = (total_Q(i)/i) 13. Calculate energy consumption E(i) using Equation (3) 14. end for 15. Output: Q and E |