## 2 Modeling of UAV-Assisted Communication
### User Trajectory Prediction Model  
Before conducting optimization for UAV path planning and resource allocation, it is essential to define the ground users' moving trajectories as the initial input data for optimizing UAV strategies, as we consider user dynamics. In this context, we introduce the cellular automata (CA) method as a means to simulate and predict the users' moving trajectories.  
Cellular automata (CA) is a discrete grid-based dynamic model that encompasses discrete representations of time, space, and state variables. Notably, it exhibits a localized spatial interaction and temporal causality, enabling it to simulate the spatiotemporal evolution process of intricate systems. CA methods have been found with extensive applications, including fire spread simulations and other domains. Due to its capability to achieve a balance between accuracy and efficiency, CA is also well-suited for simulating evacuation scenarios.  
The CA model is kind of a multi-dimensional dynamic programming method to some degree, as shown in Figure 3. Grids represent states at each location and are influencedby neighbor grids based on certain transition probability matrices. With the idea of the CA model, the method for predicting users' trajectories is then derived. To simplify the evacuation model, we suppose all the mobile users in the earthquake-stricken compound have already left their residential buildings and, therefore, are initially located within so-called valid areas. Once a user successfully escapes from the evacuation exit, his or her location becomes invalid and is no longer considered in the calculation of the overall communication throughput.  
Considering that the moving ground users are residents of the neighborhood, it is reasonable to assume that they possess knowledge of the map, including the distribution of obstacles and the location of exits. Accordingly, it can be supposed that the moving trajectory of each ground user follows the shortest path from their current location to the evacuation exit.  
Suppose there are overall \(K\) users placed randomly in the valid area of the cellular zone, with only one exit, while residential buildings play as obstacles in the area. The environment is modeled as a 2-dimensional grid map, and the moving direction of the ground user can be defined in a discrete direction set \(D=\{\)east, south, west, north, northeast, southeast, northwest, southwest\(\}\), mapping to numbers 0 to 7.  
Mobile users select their moving direction from the direction set \(D\) according to the current location, and adjust moving speed regarding current crowd density, namely the influence of neighbor grids. The moving speed affected by the current density of adjacent users is defined in the following equation:  
\[v=v_{0}/\rho\ (m/s), \tag{7}\]  
in which \(v_{0}\) refers to the typical moving speed of humans with no obstacles and neighbors. \(\rho\) changes with the current number of users in a neighbor range, being an integer no less than 1 m/s. Therefore the state of any grid can be initialized and then transformed into a next state step by step, until reaching convergence.  
By this means, after gridding the current map, the evacuation trajectories of users with different initial distributions can be obtained through the CA method, and obtain the data of user positions at each time point. The gridded map is illustrated in Figure 4.  
Figure 3: **Cellular automata schemes.** States of grids change according to states of neighbors; thus, they can predict data along time sequence with an initial input. CA model is applied to generate the evacuation trajectory data of users.