## 4 Fuzzy Logic Model
### Inference Engine
#### 4.2.2 Energy-Aware Three-Tiered Node Selection  
In order to ensure the desired real-time performance and to guarantee the pre-configured lifetime \(\alpha\), it is important to define a node selection strategy so that each sensor and relay node can forward its data to multiple relay nodes or directly to the sink. The nodes in the active list are further grouped into sensing, _NTR_ and _ETR_ nodes to perform different tasks, that is sensing, non-real-time and real-time packets forwarding, respectively.  
The key function of the node selection scheme is a three-tier node selection model in the network field. In the first tier, all active sensor nodes are considered as sensing nodes. In the second tier, a minimum number of _NTR_ relay nodes are selected to ensure the connectivity of sensor nodes in the network field. A sensing node \(i\) is said to be covered by the NTR relay node \(j\) if \(i\) can transmit its data directly to \(j\). Similarly, in the third tier, _ETR_ relay nodes are selected to ensure the connectivity of _NTR_ nodes and at least one neighbor _ETR_ node toward the sink.  
\begin{table}
\begin{tabular}{c c c c c c} \hline \hline
**Rules** & **Energy** & \(\text{A}_{\textit{time}}\) & **Velocity** & **Active Mode** & **ETR** \\ \hline  
H\) & \(VH\) & \(M\) & \(VH\) \\ \hline \hline \end{tabular}
\end{table}
Table 1: Inference rules for active and extended transmission range (ETR) node selection.  
Based on the above operations, the objective function of this formulation is to select the minimum number of _NTR_ and _ETR_ relay nodes in the network field. Let \(X\) = \(\{x_{1},x_{1},\ldots,x_{n}\}\) be a set of active sensor nodes with known locations in the network field with communication range \(r>0\). Similarly, let \(Y\) = \(\{y_{1},y_{2},\ldots,y_{n}\}\) and \(Z\) = \(\{z_{1},z_{2},\ldots,z_{n}\}\) be the sets of _NTR_ and _ETR_ relay nodes with known locations in the network field, and each _NTR_ and _ETR_ relay node communication range is \(T_{NTR}>r\) and \(T_{ETR}>T_{NTR}\), respectively. A set of _NTR_ relay nodes, \(Y\) = \(\{y_{1},y_{2},\ldots,y_{n}\}\), is considered to be a feasible two-tiered _NTR_ relay node selection for _(X, r, T\({}_{NTR}\))_ at any position in the network if:  
1. Select node \(j\) having maximum remaining energy _RE_ as the _NTR_ relay node from active set \(X\); \[\mathop{\arg\max}_{\forall i,j\in AL}f(RE_{j}):=\{RE_{j}\mid\forall i:\ \ RE_{j}>RE_{i}\}\]
2. For each sensor node \(x_{i}\in X\), there is at least one _NTR_ relay node \(y_{j}\in Y\), such that \(||x_{i}\:y_{j}||\leq r\);
3. Each _NTR_ relay node \(\in Y\) must be connected with at least one other _NTR_ relay node toward the sink. Thus, the graph \(G=(Y,\ T_{NTR}\)) is said to be connected if the vertex set of \(G\) is \(V\) = \(Y\) and the edge set of \(G\) is; \[E=\{(y_{i},y_{j})|\;(y_{i},y_{j})\in Y,\ ||y_{i}\:y_{j}||\leq T_{NTR}\}\]  
Similar to the two-tier _NTR_ relay selection in the previous step, the three-tier _ETR_ relay nodes' set \(Z\) = \(\{z_{1},z_{2},\ldots,z_{n}\}\) is considered to be a feasible selection for \((Y,T_{NTR},T_{ETR})\) if:  
1. Select node \(k\) having a maximum remaining energy _RE_ as the _ETR_ relay node from the active set \(X\); \[\mathop{\arg\max}_{\forall i,k\in AL}f(RE_{k}):=\{RE_{k}\mid\forall i:\ \ RE_{k}>RE_{i}\}\]
2. For each _NTR_ relay node \(y_{i}\in Y\), there is at least one _ETR_ relay node \(z_{k}\in Z\), such that \(||y_{i}\:y_{j}||\leq T_{NTR}\);
3. Each _ETR_ relay node \(\in Z\) must be connected to at least one other _ETR_ relay node toward the sink. Thus, the graph \(G=(Z,\ T_{ETR})\) is said to be connected if the vertex set of G is V = Z and the edge set of G is: \[E=\{(z_{i},z_{j})|\;(z_{i},z_{j})\in Z,\ ||z_{i}\:z_{j}||\leq T_{ETR}\}\]