# Dynamic Path Planning for Vehicles Based on Causal State-Masking Deep Reinforcement Learning
## 5 Comparison of Simulation Results
### Generalization Analyses
Figure 10: Comparison of the path-planning diagrams of the DQN, TD3, and the proposed GER-TD3 when the obstacle is moving and the endpoint is \((0,4)\). TD3 also manages to complete tasks in a static obstacle environment, but its paths are characterized by numerous unnecessary detours and twists. Especially when navigating narrow passages, the paths selected by TD3 lack smoothness, indicating either overly conservative obstacle avoidance or insufficient understanding of the environment. An analysis of the path trajectories reveals that TD3 experiences repeated adjustments in certain areas, suggesting that its strategy fails to optimize control decisions effectively when confronted with complex obstacle distributions. Although TD3 employs delayed policy updates to mitigate overestimation bias, it still faces limitations in extracting and utilizing critical state features in complex environments. Particularly when the agent encounters multiple obstacles, the lack of a global perspective on the optimal path results in redundant avoidance actions. In contrast, CSM-TD3 demonstrates significant advantages in static obstacle scenarios, producing the smoothest paths that closely approximate the shortest route. The agent is able to navigate around obstacles precisely, reaching the target point with minimal detour costs and optimal decision making. The path diagram indicates that CSM-TD3 avoids unnecessary turns and backtracking, showcasing its superior performance. This advantage is primarily attributed to the causal enhancement strategies introduced in CSM-TD3, which effectively identify key state features that directly impact control decisions through structural equation modeling. The state-masking mechanism filters out redundant noise features so that the agent can focus on the crucial information affecting path planning during decision making, enhancing both the effectiveness and efficiency of path planning. Notably, when the agent traverses narrow corridors, CSM-TD3 exhibits exceptional smoothness and agility in responding to environmental changes, minimizing fluctuations along the entire path. This reflects its accurate judgment of obstacle layouts and efficient planning capabilities. In the dynamic obstacle scenarios, as shown in Figures 10-12, the paths generated by the DQN frequently deviate from the optimal direction. Particularly when obstacles approach, the agent struggles to react in time to avoid them, resulting in repeated backtracking and detours. This behavior highlights the DQN's problems in handling rapidly changing dynamic obstacles, often causing its path planning to fall into local suboptimal traps and lack a global planning perspective. TD3's performance in the dynamic obstacle environment also declines. While TD3 ultimately manages to navigate around obstacles to reach the target point, its paths exhibit noticeable detours. Especially when dynamic obstacles suddenly come close, TD3's responses appear sluggish, and its path adjustments lag behind, leading to decreased overall smoothness and efficiency. This inflexibility becomes particularly evident in scenarios requiring frequent path adjustments to cope with moving obstacles, resulting in unnecessary circumventions. Such delays directly affect the overall quality of path planning, making the final planned paths more complex and less efficient compared to those generated by CSM-TD3. CSM-TD3, on the other hand, maintains exceptional performance in the dynamic obstacle environment. Its paths can adapt in real time to the dynamic changes of obstacles, demonstrating the rapid processing of dynamic information and real-time decision-making capabilities. The experimental results show that CSM-TD3 can swiftly adjust paths as obstacles approach, allowing the agent to maintain a smooth trajectory while effectively avoiding all dynamic obstacles, reaching the target point successfully.