# Communication Interface Manager for Improving Performance of Heterogeneous UAV Networks
## 4 Heuristic and System Model
Thus, the value of a condition \(c_{i}\) used in the decision heuristic is the average of the values obtained in the last sensed or calculated samples \(\sum_{n-1}^{n}c_{n}^{i}\) for each interface belonging to the \(INT\) set. \[INT_{x}^{c_{i}}=\frac{\sum_{n-1}^{n}c_{n}^{i}}{(n+1)}\,\forall n\in N \tag{2}\]  
Each condition in Table 1 represents a level from the decision tree presented in Figure 2. It reaches the target state (final decision) after checking all the decision conditions, comparing the interfaces that compose the \(INT\) set. For cases where the DT does not make any decision for an interface, or at the beginning of the mission, at least one sample interval is considered of the operating samples for each interface. This prevents having no values (null) in a given sample of Equation (2). So, for example, if three interfaces are used, the first three samples correspond to the exchange of messages between the UAVs, alternating using one of the interfaces, without implying the IM decisions. As such, the DT is established, constituting a heuristic based on the accumulation of points for each interface \(INT_{x}\), with the decision of each level by the interface that presented the best performance in the condition that composes the level. The target state consists of the interface with the best performance in a larger number of conditions featuring a stronger connection. \begin{table}
\begin{tabular}{c c} \hline \hline
**Condition (\(c_{i}\))** & **Network Metric** \\ \hline \(c_{1}\) & Throughput \\ \(c_{2}\) & Total Bytes Sent \\ \(c_{3}\) & Total Bytes Received \\ \(c_{4}\) & RSSI \\ \(c_{5}\) & SNR \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Metrics used as requirements for decision making. The target state of the DT is reached from a non-complete binary subtree, since only one interface is chosen for the next message flow. Therefore, the definition of an interface is an optimal local choice based on the decision conditions evaluated along the levels of the tree,  
\[ \begin{split} INT_{x}=\sum_{h}^{H}r_{h}^{x},\textit{where }r_{h}=1,\forall h\in H\\ x_{k}=INT_{x}\Rightarrow INT_{x}>INT.\end{split}  \tag{3}\]  
The DT score is composed of the points added by each interface \(\sum_{h}^{H}r_{h}^{x}\), where \(r_{h}^{x}\) is the accumulative variable that stores the sum of points of an interface along the levels \(h\) of the set of levels that comprise a tree \(H\), in which the interface with the highest sum of points \(INT_{x}>INT\) is chosen by a UAV \(x_{k}\) for the next sending of messages \(x_{k}=INT_{x}\). The other interfaces (not chosen) stay in a state of listening to receive the messages sent by other UAVs that are using other interfaces. The algorithm worst case complexity is \(O\ log(n)\), where \(n\) is the number of tree levels. The number of decision conditions compose the height of tree. It happens that, for a fixed number of conditions like in our case, the system presents a linear complexity \(n\). As such, the algorithm can be implemented with low computational costs. The single requirement is allowing parallel readings of the sensed conditions by the set of interfaces applied, enabling the heterogeneous sensing of the environment. The aggregation of sensing samples from the medium, from the different interfaces applied by interface manager, must be stored in buffering schemes so that the sample intervals are the same.