Algorithm Deploy-Random(num_deployable, limit_candidate, Max_CCL, sen_covrate, num_deployed) |
/* |
Step 1: Initialization */ |
1. |
Initialize deployment area; |
2. |
Add sink node to Nodedeployed and Nodebase; |
3. |
Calculate Max_SCL based on Max_CCL and type of sensor; |
4. |
while (Nodebase is not empty){ |
|
/* Step 2: Base node selection */ |
5. |
Select a Sbase from Nodebase; |
6. |
base_deployable = true; |
7. |
while (base_deployable is true){ |
|
/* Step 3: Candidate positions generation */ |
8. |
Clear Candidate and set num_candidate = 0; |
9. |
while (num_candidate < limit_candidate){ |
10. |
Generates a position Pi randomly within AreaC(Sbase); |
11. |
if (Pi is eligible under the topology control mechanism with Max_CCL and Max_SCL){ |
12. |
Add Pi to Candidate; |
13. |
num_candidate++; |
14. |
} |
15. |
} |
16. |
if(num_candidate == 0)base_deployable = false;/* select a new Sbase */ |
17. |
else{/* Step 4: Scoring and deployment */ |
18. |
Generate a new sensor node Snew; |
19. |
for (all Pi in Candidate)Call Score(Pi) and save score to CandidateScore[Pi]; |
20. |
Deploy Snew to Pi that has the highest score in CandidateScore; |
21. |
Add Snew to Nodedeployed and Nodebase; |
22. |
num_deployable--; |
23. |
if (num_deployable == 0)break; |
24. |
} |
25. |
} |
26. |
Remove Sbase from Nodebase;/* restart from Step 2 */ |
27. |
} |
28. |
returnsen_covrate and num_deployed; |
End_of_Deploy-Random |