Algorithm 2 Simulation algorithm for SS process |
-
1:
Initialize , , R, , , , , N, , , , , , consumed energies in SS;
-
2:
for to
do
-
3:
if
then
-
4:
if
then
-
5:
;
-
6:
;
-
7:
;
-
8:
end if
-
9:
if
then
-
10:
;
-
11:
;
-
12:
end if
-
13:
if
then
-
14:
;
-
15:
;
-
16:
if visited CHs by UAV ==
then
-
17:
-
18:
return UAV to BS;
-
19:
end if
-
20:
end if
-
21:
else
-
22:
if
then
-
23:
;
-
24:
;
-
25:
;
-
26:
end if
-
27:
if
then
-
28:
;
-
29:
;
-
30:
end if
-
31:
if
then
-
32:
;
-
33:
;
-
34:
if UAV visits CHsink
then
-
35:
-
36:
return UAV to BS;
-
37:
end if
-
38:
end if
-
39:
end if
-
40:
end for
|