# Geographic Routing Decision Method for Flying Ad Hoc Networks Based on Mobile Prediction
## 3 System Model
### Routing Decisions  
In the process of routing decisions within high dynamic flying ad hoc networks, data packets are sent from the source node, relayed through a series of intermediate nodes, and ultimately reach the destination node. The learning process of the MP-QGRD algorithm focuses on finding an optimal transmission path for these data packets. This algorithm is primarily composed of three key steps: mobility prediction, neighbor discovery, and routing decision. Mobility prediction is responsible for forecasting the dynamic changes of nodes within the network, neighbor discovery is used to update the neighbor information of nodes in real-time, and the routing decision, based on the information from the first two steps and the Q-learning algorithm, selects the optimal forwarding path for the data packets. The overall architecture of the MP-QGRD algorithm is illustrated in Figure 2. Through the close collaboration of these steps, the algorithm ensures that data packets can be forwarded to their destination according to the optimal strategy. In flying ad hoc networks, Q-learning can be applied to problems such as routing selection and resource allocation. By defining states, actions, and reward functions, the flying ad hoc network can be modeled as a Markov decision process (MDP), and the Q-learning algorithm can be used to learn the optimal routing strategy. Utilizing Q-learning to model the process of data packet forwarding between nodes in a given Markov decision process, agents can select the optimal action based on the current state and update the corresponding Q-values by observing the reward signals. The model is defined as follows:  
1. Agent: The data packets transmitted by each node in the network represent the agents. 2. Environment: The entire flying ad hoc network serves as the learning environment for the agents. 3. State space: The set of all nodes' states. 4. Action space: The action space of the agents is the set of neighbor nodes. Selecting a node from the set of neighbors as the next hop for the data packet constitutes an action. 5. Reward function: The immediate reward value provided by the entire flight network to the nodes. The reward function is designed based on metrics such as link stability, distance to the destination, and energy consumption, aiming to enable nodes to adapt to the dynamic network environment. Figure 2: The overall architecture of the MP-QGRD. Design of the Reward Function  
Calculate the link stability factor. The link stability between nodes is one of the key factors in selecting reliable paths, ensuring stable packet transmission. If node \(i\) and node \(j\) can communicate with each other, the communication quality factor and link time factor between the two nodes can be represented as follows:  
\[LQ_{(i,j)}=\frac{P_{(i,j)r}}{P_{(i,j)t}} \tag{14}\]  
\[LP_{(i,j)}=\frac{R-d_{ij}}{R} \tag{15}\]  
where \(P_{(i,j)r}\) and \(P_{(i,j)t}\) represent the number of data packets received for node \(i\) to node \(j\) and the total number of data packets sent by node \(i\), respectively, \(R\) represents the communication radius of the node, and \(d_{ij}\) represents the communication distance between two nodes. Therefore, the measure of link stability between nodes is expressed as follows:  
\[LS_{(i,j)}=\lambda LQ_{(i,j)}+(1-\lambda)LP_{(i,j)} \tag{16}\]  
where \(LS_{(i,j)}\) represents the link stability, with higher values indicating greater stability between the two nodes. Calculate the energy factor. To prevent certain nodes from being excessively drained and to ensure that each node can operate sustainably and stably, the remaining energy status of each node must be fully considered. This section specifically introduces the energy factor as a metric for measuring the energy consumption level of nodes. The energy factor not only reflects the current remaining energy status of the node but also provides a reliable basis for energy consumption during route selection.