## 2 Energy-Aware Multi-UAV Dispatch Algorithm (EAMUD)
### The Event Queue and UAV Pool of GCS  
In this paper, we design an array, called the _event queue_ (\(Ev_{q}\)), to store all new and handover events chronologically for UAV dispatching. Data structure of \(Ev_{q}\) consists of four components as shown in Figure 2. Component A denotes \(Ev_{q}\) adopts the time of occurrence or that of handover, i.e., \(t\), as its array index. This time will be called as the processing time of the sub-event in this paper. Component B presents new or handover event \(j\), i.e., \(Ev_{j}^{t}\), which will be processed by the EAMUD algorithm at time \(t\). As mentioned above, every event may contain one or more sub-events that represent specific destinations of dispatched UAVs. As shown by component C in Figure 2, \(Ev_{j,i}^{t}\) denotes sub-event \(i\) of event \(j\) at time \(t\). There are three states, i.e., _New_, \(Ho\) and \(Res\), for each sub-event. The sub-event in state \(New\) will be dispatched a new UAV by EAMUD. The sub-event in state \(Ho\) is the one which will dispatch a handover UAV to replace the energy-drained one. Finally, the sub-event in state \(Res\) means it has reserved a charging UAV of GCS. Component D records information of each sub-event, including its ID, state, (x, y) location, ID of the reserved UAV (\(U_{Res}\)). GCS adopts a UAV pool to record information of all UAVs, as shown in Table 2. Each UAV is in one of the four states, i.e., Available, Charging, Dispatched and Reserved. If a UAV in GCS has been charged to an energy level higher than dispatch energy threshold \(E^{DTH}\), which means this UAV could be dispatched, its state is Available. However, the UAV state is Charging before its energy level has not reached \(E^{DTH}\). If a UAV has been dispatched to the location of a sub-event, its state is Dispatched. Finally, the state of a UAV that has been reserved for dispatching to a sub-event in the future is Reserved. Figure 3 shows how to calculate the handover interval, i.e., \(\Delta t\), for the original dispatched UAV. The yellow line is its time axis, starting from the time \(t\) when GCS dispatches this UAV to serve sub-event \(Ev_{j,i}\). Orange point 1 indicates the time when the dispatched UAV has reached the position of \(Ev_{j,i}\) with the flying duration \(f_{j,i}\). Orange point 2 is the time when the original UAV has consumed its energy to the level only enough for flying back to GCS. Hence, the original UAV serving \(Ev_{j,i}\) could communicate with its neighbors for the maximum duration of \(com_{j,i}\), which is between orange points 1 and 2. For replacing the original UAV and continuing the link communication of the event, GCS has to dispatch the handover UAV at time \(t_{next}\), which is equal to \(t+\Delta t\) as indicated by orange point 3 such that the handover UAV could reach the position of \(Ev_{j,i}\) at the time of orange point 2. As a result, the duration from time \(t\) to \(t_{next}\) is defined as the _handover interval_, i.e., \(\Delta t\), of the original dispatched UAV. In this paper, we assume the original and handover UAVs have the same flying durations \(f_{j,i}\). Hence, \(\Delta t\) is equal to \(com_{j,i}\), which is calculated as follows:  
\[\Delta t=f_{j,i}+com_{j,i}-f_{j,i}=com_{j,i}=\frac{E^{Rem}_{u}+E^{ Hom}_{u}}{E^{Com}_{u}+E^{Ho}_{u}}=\frac{E^{Bat}_{u}-2\times E^{Fly}_{j,i}}{E^{ Com}_{u}+E^{Ho}_{u}} \tag{8}\] \begin{table}
\begin{tabular}{c c c c c} \hline \hline  & & **UAV Pool** & & \\ \hline
**UAV\_id** & **State** & \(E^{Bat}_{u}\) & **Sub-ev ID** & \((x^{J}_{i}y^{J}_{i})\) & \(E^{Com}_{u}\) \\ \hline \(U_{1}\) & Available & 100 & & \\ \hline \(U_{2}\) & Available & 100 & & \\ \hline \(U_{3}\) & Available & 93 & & \\ \hline \(U_{4}\) & Charging & 40 & & \\ \hline \(U_{5}\) & Dispatched & 97 & \(Ev_{A,1}\) & \((x^{A}_{1},y^{A}_{1})\) & 3 \\ \hline \(U_{6}\) & Dispatched & 70.5 & \(Ev_{A,2}\) & \((x^{A}_{2},y^{A}_{2})\) & 3 \\ \hline \(U_{7}\) & Reserved & 45 & & \\ \hline \hline \end{tabular}
\end{table} 
Table 2: The UAV Pool of ground control station (GCS).