## 4 Proposed Work
### Coverage Hole Detection and Repair  
The above processes improve the energy efficiency which prevents the coverage hole, while this phase detects and repairs the coverage hole if this occurs. The coverage holes occur mainly due to the deployment of sensors in a random manner. Repairing coverage holes drastically improves the QoSensing. In our work, CHs are responsible for hole detection and BS is responsible for hole repair. The CHs detect the hole by the virtual sector-based hole detection (ViSHD) protocol. This protocol segments each triangle at the degree of 60. The coverage hole is formed in between the sensors deployed in a ring-like structure. The coverage hole is formed as there is no sensor to cover the area or the sensor covering the respective area has become redundant. Then, the hole detection is performed by locating the boundary nodes. Let the boundary nodes be \(\{\text{bn0,bn1}\dots\text{ bnm}\}\) the maximum distance between any two nodes is computed in order to locate the hole center. The maximum distance is expressed as,  
\[dist(bn_{a},bn_{b})=Max\left\{dist\left(b_{x},b_{y}\right)\left|b_{x}b_{y} \right.\in\{bn_{0},\;bn_{1},\;\dots,\;bn_{m}\}\right\} \tag{17}\]  
The center point of the distance is defined as the hole center which can be expressed as,  
\[\left\{\frac{x_{v}=(xbn_{a}+xbn_{b})/2}{y_{v}=(ybn_{a}+ybn_{b})/2}\right. \tag{18}\]  
Hole area computation procedure is applied in two cases as,  
* Case 1 (within a cell): In this case, the holes are detected within a cell for which the corresponding CH is responsible. The CH initiates the boundary nodes to find the hole area. * Case 2 (among cells): In this case, the holes are formed among two cells. In this case, two CHs are responsible to compute the area of the hole. Here, both CHs work cooperatively to determine the hole area. Once the coverage hole is detected, the BS takes appropriate action to repair the coverage holes. The repair process constitutes isolating the redundant node and replacing the redundant node with another optimal sensor node. We propose a novel multi-agent SARSA (MA-SARSA) algorithm. The proposed MA-SARSA learns the environment and \begin{table}
\begin{tabular}{c c} \hline \hline
**Mode** & **Consumption of Energy** \\ \hline ACTIVE (\(T_{x}(\mathbf{cn})\)) & 48 nl/bit \\ Active (\(R_{x}(\mathbf{cn})\)) & 48 nl/bit \\ Transmit amplifying & 120 pJ/bit/m2 \\ Active (\(\mathbf{idle}(\mathbf{cn})\)) & 35 nl/bit \\ Sleep & 0 J \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Energy consumption in sleep scheduling. selects optimal mobile to repair the hole. Here, we frame multiple parameters such as distance, node lifetime and coverage level. The distance of the node is obtained from the distance calculation between two nodes which is formulated in Equation (2). Selecting the node only based on distance may not be appropriate as the mobile nodes may travel in opposite directions to the location of the hole; therefore, the direction of the mobile node should also be considered for precise node selection. The direction of the mobile node is calculated from the formula given below,  
\[v_{direction}=\frac{\left[ \begin{array}{c}x_{center}-x_{mob.node}\\ y_{center}-y_{mob.node}\\ \parallel x_{center}-x_{mob.node}\\ y_{center}-y_{mob.node}\end{array} \right]}{\left\| \begin{array}{c}x_{ center}-x_{mob.node}\\ y_{center}-y_{mob.node}\end{array} \right]} \tag{19}\]  
In which \((x_{center},y_{center})\) is denoted as the center of the line segment between two nodes and the lifetime of the node is computed based on the future level of energy of the node which is denoted as \(E_{bn}(t+1)\) and is calculated from the prior energy history \(E_{bn}\) (t). It can be formulated as,  
\[E_{bn}(t+1)=\frac{1}{m}\sum_{t=1}^{m}E_{bn}\left(t\right) \tag{20}\]  
In which m denotes the number of history samples taken for the calculation of the future energy level.