## 4 Methods
### Offline Model Training to Reduce Online Processing Time  
When the number of units in the MATC system is larger, the transportation efficiency and load-carrying capacity will be significantly improved. At this point, reducing the system's online computational load and enabling the method to converge quickly are key to achieving stable straight-line sailing. Offline model training is an effective method to alleviate online computational demands. BP neural networks offer advantages such as strong generalization, high fault tolerance, and simplified models [24,25]. By utilizing the BP neural network model trained offline, the online processing time for stable straight-line sailing can be significantly reduced, thereby greatly lowering the computational complexity of rolling optimization. The structure of a BP neural network mainly consists of three components: the input layer, hidden layer, and output layer. By collecting a large dataset of thrust allocation, a neural network model can be trained to predict the thrust distribution results. Additionally,the HHO algorithm can be used to optimize the weights and biases of the BP neural network [26; 27]. By performing a global search on the weights of the BP neural network, HHO helps avoid the local optima issue often encountered by traditional gradient descent methods, leading to a more optimal network model. HHO not only improves the accuracy of network training but also accelerates the convergence rate. Let \(u_{i}\) denote the thrust that the \(i\)-th AUV unit is expected to adopt. The thrust allocation result for the MATC system can then be represented as \([u_{1},u_{2},\cdots,u_{n}]\), where this allocation scheme will be treated as a candidate solution (i.e., the position of the Harris Hawk) in the HHO algorithm. During the iterative process, HHO will apply various position update strategies in an attempt to converge toward the thrust allocation that minimizes the objective function (\(J_{n}\)'). The offline model training process is as follows. Initialize the population of Harris Hawks, where each Hawk represents a candidate thrust allocation solution:  
\[\mathbf{U}_{k}^{(0)}=\Big{[}u_{1}^{(k)},u_{2}^{(k)},\cdots,u_{n}^{(k)}\Big{]}, \qquad k=1,2,\cdots,N \tag{6}\]  
where \(N\) is the population size. Update the positions of the Hawks (i.e., thrust allocation values) at each iteration:  
\[\mathbf{U}_{k}^{(t+1)}=\left\{ \begin{aligned} &\mathbf{U}_{\text{best}}^{(t)}- \Delta(\text{Exploration phase})\\ &\mathbf{U}_{\text{prey}}^{(t)}-\Delta(\text{Exploitation phase}) \end{aligned} \right. \tag{7}\]  
where \(\Delta\) is the adjustment term, calculated based on random jumps or spiral trajectories. For each iteration, verify whether the updated solution satisfies the constraints (e.g., \(u_{i}\leq T_{\text{max}}\)). Record the optimal thrust allocation result as:  
\[\mathbf{U}_{\text{best}}=\left[u_{1},u_{2},\cdots,u_{n}\right]_{\text{best}} \tag{8}\]  
The system state vector is defined as:  
\[\mathbf{X}=\Big{[}v_{1},v_{2},\cdots,v_{n},v_{\text{p}},x_{12},x_{23},\cdots,x_{(n -1)n}\Big{]} \tag{9}\]  
Combine the system states \(\mathbf{X}\) with the corresponding optimal thrust allocation \(\mathbf{U}_{\text{best}}\) to form the training dataset:  
\[\mathbf{D}=\left\{(\mathbf{X}_{1},\mathbf{U}_{1}),(\mathbf{X}_{2},\mathbf{U}_{2}),\cdots,(\mathbf{X}_{ M},\mathbf{U}_{M})\right\} \tag{10}\]  
where \(M\) is the total number of samples. Use a BP neural network to establish the nonlinear mapping between system states and thrust allocation:  
\[\mathbf{U}=f(\mathbf{X};\mathbf{W},\mathbf{b}) \tag{11}\]  
where \(\mathbf{W}\) is the weight matrix, \(\mathbf{b}\) is the bias vector, \(f()\) is the neural network's mapping function.