# Performance Evaluation of UAV-Enabled LoRa Networks for Disaster Management Applications
## 3 Proposed UAV Topology Control Algorithm
### Movement Prediction (MP)  
During the operations, some GNs might go out of the range of the UAV swarm and become isolated. A recovery mechanism must, therefore, be implemented. The solution presented here is based on a combination of virtual forces and movement prediction. Using the same virtual forces that are used for the normal UAV's mobility, allows us to easily integrate the solution in the system and at the same time, it allows us to preserve the simplicity of the distributed approach that distinguishes UAV-enabled LoRa network. The recovery mechanism is centered around elements called holograms, whose purpose is to signal to the members of the swarm the presumed position of a lost GN or group of GNs. In practice, a hologram is simply a piece of information that in its most simple form contains a pair of spatial coordinates that can be used as a reference to compute a virtual AtG force between the hologram itself and one or more UAVs. For the system to be effective, holograms must be placed in convenient positions. Two alternatives have been considered:  
* Placing holograms in correspondence of the last known position of a GN or a group of GNs
* Placing holograms in the predicted position of a GN or a group of GNs. Since GNs are continuously moving, having only the information about their last known position is not enough to generate a useful hologram. While drones adjust their position, GNs in the meanwhile may have moved somewhere else. If we can assume that GNs keep a regular direction and speed for some time, it is possible to predict the future position of GNs from their previous recorded positions and update the hologram location accordingly at each time step. The prediction implemented in the UAV-enabled LoRa network is based on simple kinematic equations. If we consider a GN \(i\) at time \(t\), its position \(x_{i}\) and \(y_{i}\) at time \(t+1\) is given, respectively, as  
\[x_{i(t+1)}^{p} =x_{it}+v_{it}^{x}+\frac{1}{2}a_{it}^{x}\cdot\Delta t \tag{7}\] \[y_{i(t+1)}^{p} =y_{it}+v_{it}^{y}+\frac{1}{2}a_{it}^{y}\cdot\Delta t \tag{8}\]  
where \(v_{it}\) and \(a_{it}\) are respectively the velocity at time \(t\) and the expected variation of velocity between \(t\) and \(t+1\) (acceleration). The computation of all the necessary variables only requires the knowledge of the three most recent positions of a node, so that  
\[v_{it}^{x} =x_{it}-x_{i(t-1)} \tag{9}\] \[v_{i(t-1)}^{x} =x_{i(t-1)}-x_{i(t-2)}\] (10) \[v_{i(t-2)}^{x} =x_{i(t-2)}-x_{i(t-3)} \tag{11}\]  
where \(a_{it}^{x}=a_{i(t-1)}^{x}+\Delta a_{i(t-1)}^{x}\times\Delta t\), \(\Delta a_{i(t-1)}^{x}=\frac{a_{i(t-1)}^{x}-a_{i(t-2)}^{x}}{\Delta t}\), \(\Delta a_{i(t-2)}^{x}=\frac{v_{i(t-1)}^{x}-v_{i(t-2)}^{x}}{\Delta t}\), \(a_{i(t-1)}^{x}=\frac{v_{it}^{x}-v_{i(t-1)}^{x}}{\Delta t}\), and \(v_{i(t+1)}^{x}=v_{it}^{x}+a_{it}^{x}\times\Delta t\). It is also worth mentioning that the same applies to \(y\) coordinates. To simplify the problem, in the present work only GNs with constant velocity are considered, so that in the previous equations the acceleration can be set to zero and only the two most recent positions are needed to perform a prediction. Each UAV is responsible for keeping track of the GNs it has lost communication with and to send to the UAVs in proximity the information needed to predict the positions of the holograms. This information is included in a message called token and sent in unicast to all the UAVs that have an entry in the routing table. A token includes necessarily the last known position of a GN, its velocity vector and the time at which the last known position was recorded. Upon reception of a token, a hologram is created and an expiration time \(t_{exp}\) is attached to it. To avoid the disruption of local AtA and AtG forces, only UAVs that are inactive (load = 0) are influenced by forces produced by holograms. To reduce the amount of exchanged tokens, lost GNs can be first clustered in groups based on their position using a clustering algorithm.