Skip to main content
. 2019 Mar 8;19(5):1192. doi: 10.3390/s19051192
Algorithm 1: Coverage verification algorithm based on the sensing area of sensor node
Input: Sensor nodes group: s=s1,s2,sn
   Sensing direction and sensing radius of sensor node: D,R
   The length and width of target area: m1,m2
Output: The coverage situations of grid points in target area
1: Calculate the coordinates of four peak points xsl,xsh,ysl,ysh
2: for i=1 to n do
3:        for x=xsl to xsh do
4:               for y=ysl to ysh do
5:                     if Px,y can be covered by Sxs,ys then
6:                          Cxy=1;%Justify whether Px,y is covered.
7:                     end if
8:                     if Px,y can be covered by at least two sensor nodes. then
9:                          Rxy=1;%Justify whether Px,y is covered by at least two sensor nodes.
10:                   end if
11:              end for
12:       end for
13: end for