Algorithm 1 Virtual Lattice-Based Monitor Algorithm |
-
1:
Input: , the position of all SNs
-
2:
, the position of all ANs
-
3:
With GAF, a cuboid is partitioned into many virtual small lattices, their ID set is denoted by .
-
4:
for
, , 2, ⋯,
do
-
5:
AN locally broadcasts a HELLO message to all nodes in lattice with its max transmission range.
-
6:
if AN receives a number of HELLO-ACK message which is greater than or equal to two then
-
7:
Record
-
8:
else
-
9:
AN receives a number of HELLO-ACK message which equal to one
-
10:
Record
-
11:
end if
-
12:
Record center coordinates set ,,.
-
13:
end for
-
14:
Delete and corresponding center coordinates from ID set and .
-
15:
Record new ID set , new center coordinates set .
-
16:
Output: The lattices that are required to be patrolled by ANs, and the ID set is .
|