# Q-Learning Empowered Highly Dynamic and Latency-Aware Routing Algorithm for Flying Ad-Hoc Networks
## 5 Simulation Results
### Evaluation Indicators  
(1) Packet Delivery Ratio  
The Packet Delivery Ratio is defined as the ratio of the number of packets received by the destination node to the number of packets sent by the source node. This metric measures the integrity and correctness of the routing protocol. A higher PDR indicates better protocol performance. The formal definition of this metric is given by Equation (20).  
\[\text{PDR}=(\frac{\sum\text{DataPackets}_{\text{rcv}}}{\sum\text{DataPackets}_{ \text{sent}}})\times 100\% \tag{20}\]  
(2) Throughput  
Throughput is defined as the number of bytes received by the destination node per unit of time. Throughput can be divided into node throughput and network throughput. Node throughput refers to the number of bytes of packets received by a single destination node, while network throughput refers to the number of bytes received by all destination nodes per unit of time. In this paper, we focus on network throughput in Kbps, which is calculated by Equation (21).  
\[\text{Throughput}(\text{Kbps})=(\frac{\text{CBRbyte}_{\text{rcv}}\times 8}{ \text{Time}_{\text{simulation}}\times 1000}) \tag{21}\]  
(3) Average End-to-End Delay  
Average End-to-End Delay is the average time taken for a packet to propagate from the source node to the destination node. It includes all delays that may occur throughout  
\begin{table}
\begin{tabular}{c c c c c c c c} \hline \hline  & & & & \multicolumn{2}{c}{**Gateway Node**} & & \\ \hline \multirow{4}{*}{
\begin{tabular}{c} **S**  
the routing process, such as queuing delays at the interface, retransmission delays at the MAC layer, and propagation delays. The definition of Average End-to-End Delay is shown in Equation (22).  
\[\text{AverageEndToEndDelay}=\frac{\sum\left(\text{Time}_{\text{rcv}}-\text{ Time}_{\text{send}}\right)}{\sum\text{DataPackets}_{\text{rcv}}} \tag{22}\]  
(4) Average Jitter  
Jitter describes the degree of variation in packet delay. If the network is congested, queuing delays will affect the end-to-end delay and cause packets transmitted over the same connection to have different delays. Jitter is used to describe the extent of this delay variation and is an essential parameter for real-time transmission. It is usually triggered by network congestion or time drift. The smaller the jitter, the better the network performance. Equation (23) defines jitter as follows:  
\[\text{Jitter}\{\text{P}_{\text{N}}\}=\left|\text{Delay}\{\text{P}_{\text{N}} \}-\text{Delay}\{\text{P}_{\text{N-1}}\}\right| \tag{23}\]  
where \(\text{P}_{\text{N}}\) is the current packet and \(\text{P}_{\text{N-1}}\) is the previous packet in the data stream, the average jitter is the sum of all end-to-end delay jitter (delay variation) values for each received packet on average, as in Equation (24).  
\[\text{AverageJitter}=\frac{\sum\left(\text{Jitter}_{\text{sum}}\right)}{\sum \text{DataPackets}_{\text{rcv}}} \tag{24}\]  
(5) Running Time  
The running efficiency of a program can be measured specifically in terms of its running time. Time complexity is defined as the amount of time taken by an algorithm to run. The algorithm runs more efficiently when the program runs in less time and uses less memory during the runtime. Therefore, analyzing the running time and complexity of a program is crucial for evaluating its efficiency and performance.