# The Optimization of UAV-Assisted Downlink Transmission Based on RSMA
## 4 Optimization Problem Solving  
### Memory-Based Dynamic Artificial Fish Swarm Algorithm  
This paper employs the improved Artificial Fish Swarm Algorithm to resolve the UAV parameter optimization problem presented in Section 3. The position of the artificial fish in AFSA provides a feasible solution to the optimization problem. AFSA's optimization objective is to find the best position with the highest food concentration in the fish swarm, which represents the best solution [24]. Because the traditional Artificial Fish Swarm Algorithm (AFSA) is based on fixed step and fixed field of view for iteration, which may lead to relatively slow convergence or failure to reach the convergence point later. Therefore, this paper introduces a memory approach, dynamic step size, and dynamic field of view strategies. Finally, we design a Dynamic Memory Artificial Fish Swarm Algorithm (MD-AFSA) that can adjust the current movement strategy of the fish swarm according to the historical operation to achieve rapid convergence. Figure 2 illustrates the improved model MD-AFSA proposed in this paper. Building upon the basic operations of the standard fish swarm algorithm, this model introduces a memory-based behavior operation, allowing the simultaneous execution of three search paths to locate the next state. After completing the state transition of the artificial fish, the step size and visual range are updated accordingly. * First search path Use \(f(X_{t})<f(X_{t-1})\) to determine whether to perform the memory operation, indicating the artificial fish found a better position in the last iteration. If the condition is met, the Memory behavior is executed and the position of the artificial fish is updated by \(X_{i}^{t+1}=X_{i}^{t}+rand[0,1]\times step_{i}^{t}*\left(\beta_{1}dir_{c}+ \beta_{2}dir_{p}\right)\), where \(X_{i}^{t}\) denotes the position of the artificial fish \(i\) after \(t\) iterations. \(step_{i}^{t}\) is the step size after iterating \(t\) times. \(\beta_{1}+\beta_{2}=\)1, which is the constant coefficient factor. \(dir_{c}\) and \(dir_{p}\) are calculated as shown in (9), representing the current and historical direction. \(X_{t}^{\text{best}}\) represents the optimal solution among all solutions after iterating for \(t\) times. \(\mu_{t}\) and \(\mu_{t-1}\) represent the current and historical position validity, respectively. * Second search path Use \(\frac{f(X_{c})}{n_{nb}}<\phi f(X_{i})\) to determine whether to perform Swarm behavior, where \(X_{c}\) is the center position of the current artificial fish's neighbors, \(n_{nb}\) is the number of neighbors of the current artificial fish, and \(\phi\) is the crowding factor. Satisfying this condition means that the partner center is not crowded, and thus Swarm behavior can be executed by \(X_{i}^{t+1}=X_{i}^{t}+rand[0,1]\times step_{i}^{t}*\frac{X_{c}-X_{i}^{t}}{|X_{ c}-X_{i}^{t}|}\). On the contrary, the artificial fish attempts to perform Foraging behavior. The prerequisite for performing Foraging behavior is that in the number of \(try_{max}\) attempts, the presence of \(X_{n}=X_{i}^{t}+visual_{i}^{t}\times Rand[-1,1]\) and  
Figure 2: Memory-based dynamic fish swarming algorithm. \(f(X_{n})<f\big{(}X_{i}^{t}\big{)}\). If the condition is met, the artificial fish will perform Foraging behavior by \(X_{i}^{t+1}=X_{i}^{t}+rand[0,1]\times step_{i}^{t}*\frac{X_{n}-X_{i}^{t}}{|X_{n} -X_{i}^{t}|}\). Otherwise, it will execute Random behavior by \(X_{i}^{t+1}=X_{i}^{t}+visual_{i}^{t}\times Rand[-1,1]\). * Third search path Use \(\frac{f\big{(}X_{i}\big{)}}{n_{nb}}<\vartheta f(X_{i})\) to determine whether the artificial fish is capable of Rear-End behavior, where \(X_{j}\) is the position of the optimal node between the current neighbor nodes. \[\left\{\begin{array}{l}\begin{array}{l}