## 7 Discussion  
The presented results and analyses suggest that selecting a trajectory planning algorithm for an underwater vehicle largely depends on the complexity of the task and the available computational resources. Classical algorithms such as the GA, PSO, and RRT* proved to be highly effective in finding collision-free paths. These methods do not require a training phase or precise knowledge of the AUV motion model, which can be advantageous when environmental information is limited or the preparation time is constrained. On the other hand, they operate by determining a series of intermediate waypoints, forcing the vehicle to frequently adjust its speed to minimize deviations from the planned route. This can lead to a higher energy consumption and longer mission durations, especially in more challenging maneuvering conditions or with complex route profiles. A comparative analysis of the RL algorithms indicates that training can bring benefits by producing smoother trajectories, as the vehicle's actual dynamics are taken into account during learning. An RL agent continuously modifies the heading and speed to maximize the cumulative reward, resulting in more natural maneuvers. This is crucial in restricted spaces and scenarios that require rapid decision-making. In practice, this allows for higher speeds throughout the mission, thus reducing the total mission time. At the same time, \begin{table}
\begin{tabular}{l c c c c c c c c} \hline \hline
**Algorithm** & **Avg. Succ.** & **Feas. Constr.** & **Total Avg.** & **Reward** & **Avg. Std. Dev.** & **Avg. Comp.** & **Avg. Direct** & **Feas. Constr.** \\  & **Rate** & **Dist. [m]** & **Speed [m/s]** & & **of Hdg. Diff. [\({}^{\circ}\)]** & **Time [s]** & **Path \%** & **Time [s]** \\ \hline SAC & \(0.80\) & \(288.61\) & \(1.86\) & \(-13.08\) & \(8.03\) & \(0.68\) & \(90.65\) & \(162.79\) \\ SAC-HER & \(0.79\) & \(278.80\) & \(1.88\) & \(-12.27\) & \(8.40\) & \(0.69\) & \(92.0\) & \(154.4\) \\ TD3 & \(0.84\) & \(290.43\) & \(1.90\) & \(-10.43\) & \(8.30\) & \(0.61\) & \(93.8\) & \(161.1\) \\ TD3-HER & \(0.83\) & \(276.77\) & \(1.94\) & \(-9.62\) & \(9.11\) & \(0.62\) & \(93.5\) & \(152.15\) \\ TQC & \(0.80\) & \(283.62\) & \(1.88\) & \(-11.28\) & \(8.09\) & \(1.53\) & \(93.1\) & \(158.1\) \\ TQC-HER & \(0.79\) & \(279.11\) & \(1.89\) & \(-11.52\) & \(8.45\) & \(0.59\) & \(93.4\) & \(153.7\) \\ \hline \hline \end{tabular}
\end{table} 
Table 7: A comparison of the average results for the analyzed algorithms on an unseen map. Figure 9: Trajectories computed by reinforcement learning models—SAC (**a**), SAC-HER (**b**), TD3 (**c**), TD3-HER (**d**), TQC (**e**), and TQC-HER (**f**)—on an unseen map of Gdarsk port. however, RL algorithms demand a lengthy training phase and a detailed, nonlinear vehicle model. Such requirements may pose significant constraints if accurate vehicle dynamics data are not available. It is also worth noting that in certain cases, RL-based approaches may cause the vehicle to circle around the target at an excessive speed, complicating precise arrival or stopping at the intended location. This phenomenon was especially pronounced for selected variants of SAC-HER, TD3-HER, and TQC-HER. Although RL methods can generally offer smoother guidance and more natural maneuvers, their parameters and reward functions must be carefully tuned to the specific mission requirements and vehicle characteristics. A major advantage of the experiments carried out in this study is the use of an actual port map, which narrows the gap between the test conditions and real-world scenarios. Constraints such as ignoring the currents or waves could be addressed in future work to broaden the generality and reliability of the tested methods. Whether implementing classical or RL-based approaches, special care must be taken to ensure accurate modeling of the vehicle's dynamics and the environment in which it operates. In summary, the final choice of algorithm is influenced by factors such as environmental knowledge, the mission objectives, and energy constraints.