# LSTM-DQN-APF Path Planning Algorithm Empowered by Twins in Complex Scenarios
## 4 Twin System Modeling and LSTM-DQN-APF Algorithm
### Algorithm Validation Test and Analysis
#### 4.3.4 Experiment 3: Algorithm Validation Test for Urban Warfare Scenario  
In this paper, we simulate a complex urban battlefield scenario that includes roads, trees, buildings, landscape trees, street lights, built-up areas, and walking pedestrians. As shown in Figure 8, it is a panoramic dynamic threat map of the urban scene. The main obstacle information in the urban scenario is shown in Table 4. \begin{table}
\begin{tabular}{c c c} \hline \hline
**Hindrance** & **Parameters** & **Position (x,y,z)/m** \\ \hline Building 1 & 5 m \(\times\) 5 m \(\times\) 10 m, building with rectangular collision body & (0,8,0), (10,5,0), (20,10,0), (30,10,0) \\ Building 2 & 5 m \(\times\) 8 m \(\times\) 30 m, building with rectangular collision body & (30,0,0), (10,40,0), (35,30,0) \\ Tree 1 & 1 m \(\times\) 1 m \(\times\) 5 m, the collision body is a rectangle & (10,20,0), (20,0,0), (40,10,0) \\ Tree 2 & 1 m \(\times\) 1 m \(\times\) 10 m, the collision body is a rectangle & (30,40,0), (30,20,0), (40,35,0) \\ Signage 1 & 1 m \(\times\) 1 m \(\times\) 0.1 m, collision body is a rectangle & (15,5,10), (25,30,10) \\ Signage 2 & 1 m \(\times\) 2 m \(\times\) 0.1 m, collision body is a rectangle & (25,10,15), (5,10,15) \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Table of obstacle parameters. \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Predicted Number of Steps** & **1** & **2** & **3** \\ \hline height & 2.99 & 4.40 & 31.77 \\ Latitude & 6.60 & 20.20 & 50.82 \\ Longitude & 6.91 & 11.10 & 59.49 \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Comparison of prediction errors MAE (m) of different prediction steps. Figure 7: Comparison of 2D (**a**) and 3D (**b**) real trajectory and trajectory prediction results of quadrotor UAV data set. In order to increase the sample diversity, this paper conducts three different experiments: (1) the presence of static obstacles; (2) the presence of dynamic obstacles; and (3) the introduction of the effect of wind. The setup of these experiments helps to provide richer training data for the intelligiences, thus enhancing their adaptive ability under different environmental conditions. The size of the experience pool in this paper is 10,000, and these experiments can make the samples stored in the experience pool more diversified, thus improving the performance of the model in various complex scenes. In order to further verify the performance of this method, the LSTM-DQN-APF path planning method was compared with APF and GE-APF [29; 30; 31] under the same testing environment, where the attraction and repulsion of the GE-APF algorithm can be defined as:  
\[\mathrm{F_{a}}\ =\frac{\mathrm{q_{t,m}}}{\left|\mathrm{q_{t,m}}\right|}\big{[} \mathrm{k_{a1}}\big{(}1-\mathrm{e}^{-\mathrm{b_{1}}\mathrm{q_{t,m}^{2}}}\big{)} +\mathrm{k_{a2}}\big{(}1-\mathrm{e}^{-\mathrm{b_{2}}\mathrm{v_{t,m}^{2}}} \big{)}\big{]} \tag{14}\]  
\[\mathrm{F_{r}}\ =-\frac{\mathrm{q_{0,m}}}{\left|\mathrm{q_{0,m}}\right|}\Big{[} \mathrm{k_{r1}}\mathrm{e}^{-\mathrm{b_{3}}\mathrm{q_{0,m}^{2}}}\Big{]}+\mathrm{ k_{r2}}\Big{(}1-\mathrm{e}^{-\mathrm{b_{4}}\mathrm{v_{0,m}^{2}}}\Big{)}\big{]} \mathrm{v_{0,m}}<0 \tag{15}\]  
\(K_{a1}\) and \(K_{a2}\) are the gain factors of the attractive force, where their summation produces the maximum attractive force. The gain factors of the repulsive force are denoted as \(K_{r1}\) and \(K_{r2}\), where their summation gives the maximum repulsive force. \(b_{1}\), \(b_{2}\), \(b_{3}\), and \(b_{4}\) are positive constants that contribute to identifying the required minimum velocity and minimum displacement that generate the maximum attractive and repulsive Forces. (1) Static obstacles  
In order to ensure the comprehensiveness and accuracy of the experiment, 2 task points were set up in the scene, each of which was independently experimented for testing the navigation performance of the UAV in different situations.