2.2.3. Simplex Method

The simplex method is a direct search algorithm for optimizing multi-dimensional unconstrained problems proposed by Nelder et al. [26] in 1965. The algorithm takes *d* + 1 points in *d*-dimensional space to form a simplex and then calculates the function value of its vertices. The sub-optimal points are obtained by internal compression, external compression, reflection and expansion of the worst point of the simplex. Then, the worst point of the simplex is replaced by the sub-optimal point, and the simplex is reconstructed to approach the global optimum continuously [27]. Since the simplex method is not affected by the continuity and derivability of the objective function, it has an excellent optimization ability, thus improving its capacity to break out the regional optimum. For this, the simplex method is utilized to update the other white sharks' location in the fish school behavior, so as to urge them to approach the best white shark continuously and make their positions close to the global optimum, which accelerates the convergence to the optimal solution and enables it to overcome regional optimum. The diagram of the optimization process for the simplex method is shown in Figure 2.

**Figure 2.** Diagram of optimization process for the simplex method.

As is shown in the figure, the optimization steps of the simplex method can be summarized as follows:

**Step 1: Ranking and evaluating.** All individuals of the white shark population in the *d*-dimensional space were ranked and evaluated for fitness values, and the current best white shark *xg*, the second best white shark *xb* and the abandoned white shark *xs* will be selected, which is expressed as follows:

$$f(\mathbf{x}\_{d+1}) \ge \dots \ge f(\mathbf{x}\_b) \ge f(\mathbf{x}\_c) = f(\frac{\mathbf{x}\_{\mathcal{S}} + \mathbf{x}\_b}{2}) \ge f(\mathbf{x}\_{\mathcal{S}}) \ge f(\mathbf{x}\_1) \tag{10}$$

**Step 2: Reflection.** Performing a reflection operation to obtain a reflection point *xr*. The formula of reflection operation is:

$$\mathbf{x}\_r = (1+\delta) \cdot \mathbf{x}\_c - \delta \cdot \mathbf{x}\_s \tag{11}$$

Here, *xr* refers to the reflective point obtained from *xs*. *δ* is the reflective factor, typically set at 1.

**Step 3: Expansion.** If *f*(*xg*) > *f*(*xr*), the expansion process is carried out to obtain the expansion point *xe*. The basic formula of expansion operation is as follows:

$$\mathbf{x}\_{\mathbf{c}} = (1 - \chi) \cdot \mathbf{x}\_{\mathbf{c}} + \chi \cdot \mathbf{x}\_{\mathbf{r}} \tag{12}$$

where *χ* is the expansion factor. If *f*(*xe*) > *f*(*xr*), substitutes *xr* for *xs*.

**Step 4: Outside Contraction.** When *f*(*xr*) < *f*(*xs*), the outside contraction point *xoc* can be obtained by the outside contraction operation, which can be expressed as follows:

$$\mathbf{x}\_{\rm oc} = \mathbf{x}\_{\rm c} + \boldsymbol{\Phi} \cdot (\mathbf{x}\_{r} - \mathbf{x}\_{\rm c}) \tag{13}$$

where *φ* is the contraction coefficient. If *f*(*xr*) > *f*(*xoc*), substitutes *xoc* for *xs*.

**Step 5: Inside Contraction.** If *f*(*xs*) < *f*(*xr*), the inside contraction operation can be expressed as follows:

$$\mathbf{x}\_{\rm ic} = \mathbf{x}\_{\rm c} - \boldsymbol{\Phi} \cdot (\mathbf{x}\_{\rm r} - \mathbf{x}\_{\rm c}) \tag{14}$$

where *xic* is the inside contraction point. If *f*(*xic*) < *f*(*xs*), substitutes *xic* for *xs*.

**Step 6: Shrinkage.** For vertices *xi* in *d*-dimensional space, the shrinkage operation is expressed as follows:

$$\mathbf{x}\_{i} = \mathbf{x}\_{1} + \boldsymbol{\upxi} \cdot (\mathbf{x}\_{i} - \mathbf{x}\_{1}) \tag{15}$$

where *ξ* is the shrinkage coefficient.

After optimization by the simplex method, the position of the white shark individuals is closer to global optimum, which helps improve the probability of the algorithm breaking out the regional optimum.

#### 2.2.4. Performance of IWSO on IEEE CEC-2005

In this paper, a series of advanced strategies such as circle chaotic mapping, adaptive weight factor method and simplex method is used to enhance the WSO. Moreover, the CEC-2005 test suite is used to verify the improved effect of the presented IWSO and its outstanding performance. CEC-2005 is a test suite containing several challenging benchmark functions, which has a large number of local optimal solutions, so it could be used to simulate the complexity of real search space and further verify the IWSO's capability and reliability. The presented IWSO is compared with WSO and other five highly respected meta-heuristic algorithms such as BOA, GWO, MRFO, WOA and SSA over 25 independent runs in some benchmark functions of CEC-2005. The population size of the IWSO and other algorithms is set to 300, and the search agent is set to 50. The experimental simulation results are displayed in Table 1.

**Table 1.** Optimization results of IWSO and other algorithms (BOA,GWO,MRFO,WOA,SSA,WSO) running on the CEC-2005 test function.



**Table 1.** *Cont.*

The table presents the objective function values for the IWSO and other algorithms in terms of their best, worst, average and standard deviation. Based on the results, it can be concluded that the IWSO effectively identifies the global optimum solution for the majority of the CEC-2005 test functions, and its standard deviation is smaller than that of the WSO algorithm and the other five meta-heuristic algorithms, which shows that IWSO algorithm is effective in improving WSO algorithm. Therefore, when solving complex optimization problems, the proposed IWSO algorithm is robust and reliable.

#### **3. Dynamic Window Approach and Its Improvement**

### *3.1. USV Modeling*

Since there are many parameters in the actual USV motion model, it may be difficult to directly model it. Therefore, the following assumptions are used to simplify the USV motion model [28].


For the DWA method, it is important to construct the motion model of USV first. According to Ref. [29], the USV has restricted mobility and its motion trajectory can be regarded as consisting of each small arc. If Δ*t* is very small, the motion of the USV may be modeled as a uniform linear motion. In Ref. [30], USV's motion planning problem can be simplified to the motion of a rigid body with three freedom degrees (surge, sway and yaw) in plane space. Based on the above analysis, ignoring the influence of wind and ocean currents, USV's model can be formulated as:

$$\begin{cases} \begin{aligned} \boldsymbol{x}\_{t+1} - \boldsymbol{x}\_{t} &= \boldsymbol{v}\_{t} \cdot \Delta t \cdot \cos \,\theta\_{t} \\ \boldsymbol{y}\_{t+1} - \boldsymbol{y}\_{t} &= \boldsymbol{v}\_{t} \cdot \Delta t \cdot \sin \,\theta\_{t} \\ \boldsymbol{\theta}\_{t+1} - \boldsymbol{\theta}\_{t} &= \boldsymbol{\omega}\_{t} \cdot \Delta t \\ \dot{\boldsymbol{p}} &= \boldsymbol{R}\_{\boldsymbol{\psi}}(\boldsymbol{\psi}) \cdot \boldsymbol{v} \\ \dot{\boldsymbol{\psi}} &= \boldsymbol{r} \end{aligned} \tag{16}$$

where at time *t*, (*xt*, *yt*) and *θ<sup>t</sup>* are the USV's location and orientation, respectively. Similarly, (*xt*+1, *yt*+1) and *θt*+<sup>1</sup> represent the USV's location and orientation at time *t* + 1, respectively. *vt* represents the USV's linear velocity at time *t*. *ω<sup>t</sup>* represents the USV's angular velocity at time *t*. *p* = [*x*, *y*] *<sup>T</sup>* stands for the USV's spatial vector. *v* = [*u*, *v*] *<sup>T</sup>* represents the USV's velocity vector. *Rψ*(*ψ*) is a rotation matrix, which is expressed by the following formula:

$$\mathcal{R}\_{\Psi}(\psi) = \begin{bmatrix} \cos \ \psi & -\sin \ \psi \\ \sin \ \psi & \cos \ \psi \end{bmatrix} \tag{17}$$

**Figure 3.** Diagram of motion model for USV.

#### *3.2. Velocity Sampling*

Due to countless groups (*v*, *ω*) in the domain of motion vectors, sampling these velocities based on the real USV restrictions is required to obtain a workable velocity range [31].

1. Speed constraint: limited by the USV's maximal and minimal velocity:

$$V\_{\rm tr} = \left\{ (\upsilon, \omega) \middle| \upsilon \in \left[ \upsilon\_{\rm min}, \upsilon\_{\rm max} \right]\_{\prime} \omega \in \left[ \omega\_{\rm min}, \omega\_{\rm max} \right] \right\} \tag{18}$$

where the minimal and maximal linear velocities are represented by *v*min and *v*max, respectively. The minimal and maximal angular velocities are represented by *ω*min and *ω*max, respectively.

2. Dynamic constraint: influenced by the motor acceleration and deceleration performance of USV, which is expressed as follows:

$$V\_d = \left\{ (\upsilon, \omega) \middle| \upsilon \in \left[ \upsilon\_{\mathcal{S}} - \upsilon\_f \,' \cdot \Delta t, \upsilon\_{\mathcal{S}} + \upsilon\_\varepsilon \,' \cdot \Delta t \right] \land \omega \in \left[ \omega\_{\mathcal{S}} - \omega\_f \,' \cdot \Delta t, \omega\_{\mathcal{S}} + \omega\_\varepsilon \,' \cdot \Delta t \right] \right\} \tag{19}$$

where *vg*, *ω<sup>g</sup>* represents the USV's current linear and angular velocity, respectively. *ve* , *ω<sup>e</sup>* represent the USV's maximal linear acceleration and maximal angular acceleration, respectively. *vf* , *ω<sup>f</sup>* represent the USV's maximal linear deceleration and maximal angular deceleration, respectively.

3. Braking distance constraint: To prevent the USV from colliding with other ships or obstacles, the USV will be constrained by the braking distance, and the speed will be reduced to zero within the braking distance according to its maximum deceleration. The braking distance constraint is presented in the following formula:

$$V\_a = \left\{ (v, \omega) \middle| v \le \sqrt{2 \cdot \text{dist}(v, \omega) \cdot v\_f}' \land \omega \le \sqrt{2 \cdot \text{dist}(v, \omega) \cdot \omega\_f}' \right\} \tag{20}$$

where *dist*(*v*, *ω*) stands for the distance between the nearest obstacle to the USV and the end of the deduced trajectory.

#### *3.3. Evaluation Function and Its Improvement*

After sampling the velocity of USV, the DWA method will deduce the trajectory based on the sampled velocity, and the scoring mechanism is used to sort these trajectories, and the greatest score trajectory will be selected as the final trajectory of USV. Among them, the scoring mechanism of the DWA method is composed of three functions, speed function, azimuth evaluation function and obstacle distance function [32], which are expressed as follows:

$$F(\upsilon,\omega) = \mathfrak{a} \cdot \text{vel}(\upsilon,\omega) + \mathfrak{z} \cdot \text{head}(\upsilon,\omega) + \gamma \cdot \text{dist}(\upsilon,\omega) \tag{21}$$

where *α*, *β* and *γ* are the weight factor of the three functions. However, owing to the absence of knowledge on the global path, the DWA method is prone to slip into the regional optimum when encountering a complex marine environment. Therefore, global path information planned by the IWSO will be incorporated into the enhanced DWA method, so that the USV can break out the regional optimum.

Aiming at the shortcomings of the traditional DWA, some strategies are used to improve it in this paper. Firstly, *head*(*v*, *ω*) is changed to the tangent angle between the global optimal navigation path and the USV. Then, the current azimuth angle from the USV to the nearest sub-target point can be expressed by the following formula:

$$\theta\_c = \tan(\frac{y\_2 - y\_1}{x\_2 - x\_1}) \cdot \frac{180^\circ}{\pi} \tag{22}$$

where *θ<sup>c</sup>* represents the current azimuth of the USV. (*x*1, *y*1) represents the current position coordinates of USV. (*x*2, *y*2) represents the position coordinates of the sub-target point nearest the USV. What is more, the improved azimuth cost function is expressed as follows:

$$Ind^\prime(v,\omega) = |\theta\_c - \theta\_{st}|\tag{23}$$

where *θst* represents the azimuth between the predicted trajectory and the target point. The improved azimuth evaluation function can guide USV along the global optimal path planned by the IWSO while avoiding other obstacle ships or dynamic obstacles.

Secondly, in order to hasten USV arrival at the target point, the distance cost function within the USV's present location and the sub-target point is constructed, which is expressed as follows:

$$path(v, \omega) = \sqrt{(\mathbf{x}\_E - \mathbf{x}\_{ST})^2 + (y\_E - y\_{ST})^2} \tag{24}$$

where (*xE*, *yE*) represents the sub-target point coordinates. (*xST*, *yST*) represents the current predicted trajectory coordinates.

To sum up, the assessment function for the enhanced DWA is:

$$F(\upsilon,\omega) = \sigma(\mathfrak{a}\cdot\text{vel}(\upsilon,\omega) + \mathfrak{g}\cdot\text{head}'(\upsilon,\omega) + \gamma\cdot\text{dist}(\upsilon,\omega) + \eta\cdot\text{path}(\upsilon,\omega))\tag{25}$$

where *σ* represents the smoothing factor. *η* represents path cost weight coefficient.

#### **4. The Proposed Fusion Algorithm IWSO-DWA**

To further smooth the USV's navigation path and endow it with the ability of realtime dynamic collision avoidance, this paper combines the proposed IWSO algorithm with the improved DWA method and proposes a novel global dynamic optimal path planning method, which is named IWSO-DWA. Due to the complex maritime navigation environment and many ships coming and going, the COLREGs is introduced in this paper to construct the collision avoidance model of USV, so that it can avoid other obstacle ships reasonably while navigating along the optimal path globally. The pseudo-code of the proposed IWSO-DWA is illustrated in Algorithm 1.

#### **Algorithm 1**: IWSO-DWA

```
Input:
The set of population size: P;
The map information: G;
The maximum number of iterations: K.
Output: Optimal navigation path.
1. Initializing population by circle chaotic mapping;
2. While k < K do
3. Updating the parameters of WSO;
4. Identifying the current optimal solution;
5. for i = 1 to P do
6. Updating the motion velocity of white sharks;
7. end for
8. for i = 1 to P do
9. Refreshing the best white shark's location by the adaptive weight factor;
10. end for
11. for i = 1 to P do
12. If rand ≤ss then
13. →
     Dω =

           rand × (ωgbestk − ωi
                                k )

                                  ;
14. If i ==1 then
15. ωi
       k+1 = ωgbestk + r1
                        →
                        Dωsgn(r2 − 0.5);
16. else
17. ωi
       k+1 = ωgbestk + r1
                        →
                        Dωsgn(r2 − 0.5);
18. ωi
       k+1 = ωi
                k+ωi
                    k+1
                2×rand ;
19. end if
20. end if
21. Using the simplex method to update the white sharks' position;
22. end for
23. Modifying the position of any white shark that exceeds the boundary;
24. Assessing and revising the updated positions;
25. k = k + 1;
26. end while
27. Obtaining the optimal path globally and incorporating it into DWA;
28. Considering the COLREGs rules;
29. return optimal navigation path.
```
As can be seen from the pseudo-code of the proposed IWSO-DWA, the IWSO is responsible for planning the global optimal path under a given environment model. The global optimal path information is obtained to choose the present route's start point and sub-target point, and fed into the local path planner subsequently. Under the action of the IWSO-DWA algorithm, USV can travel along the global optimal path planned by the IWSO, and the other obstacle ships will be detected in real time as the process proceeds. When other obstacle ships approach, USV will avoid it in real time, and its dynamic behavior meets the COLREGs. After successful collision avoidance, USV will continue to move along the global optimal path. Finally, refresh the current path's status until the USV reaches the final target point. The flow chart of IWSO-DWA for global dynamic optimal path planning is displayed in Figure 4.

**Figure 4.** Flow chart of global dynamic optimal path planning method (IWSO-DWA).

#### *4.1. COLREGs Rules*

The International Regulations for Preventing Collisions at Sea (COLREGs) is a kind of sea traffic regulation that aims to avoid collisions between ships navigating the open seas.

According to Ref. [33], there are four representative rules of COLREGs: overtaking, head-on, port side crossing and starboard crossing. The four representative rules of COLREGs are shown in Figure 5.

**Figure 5.** Four representative rules of COLREGs: (**a**) overtaking situation; (**b**) head-on situation; (**c**) port side crossing situation; (**d**) starboard crossing situation.

The blue pentagon stands for USV, the red pentagon stands for obstacle ship, and the yellow oval dotted line stands for the shape range of the ship. In the overtaking situation, both USV and obstacle ship move from bottom to top. When the USV is behind the obstacle ship and on the same route, USV can overtake the obstacle ship from the port side or starboard. In the head-on situation, the obstacle ship moves from top to bottom, while the USV sails from bottom to top and meets the front of the obstacle ship, and USV can avoid the obstacle ship through starboard. In the port side crossing situation, the obstacle ship moves from left to right, while the USV sails from bottom to top and meets the obstacle ship. At this time, the obstacle ship has the obligation to avoid a collision. However, if the red dynamic obstacle ship (OS) fails to take relevant collision avoidance actions, USV should adjust the starboard in time to avoid collision with it. When the red dynamic obstacle is far away, the USV continues to move to the target point. In the starboard crossing situation, when the obstacle ship moves from right to left and the USV moves from bottom to top and meets the obstacle ship, the obstacle ship has no obligation to avoid a collision at this time. The USV needs to adjust the starboard and quickly cross the obstacle ship to avoid collision with it.

#### *4.2. Complexity Analysis*

An algorithm's time complexity might be determined by the magnitude of the input problem (*d*), the population size (*n*), the algorithm's iterations (*K*) and the cost function evaluation (*c*). In this paper, the total time complexity of the IWSO-DWA algorithm can be expressed as:

$$\begin{array}{rcl} \text{O(IVSO-DWA)} &= \text{O(optimal path problem)} + \text{O(initialization)}\\ &+ \text{O(cost function evaluation)} + \text{O(Solution update)}\\ &= O(1 + d \cdot n + n \cdot c \cdot K + d \cdot n \cdot K) \\ &\cong O(n \cdot c \cdot K + d \cdot n \cdot K) \end{array} \tag{26}$$

#### **5. Experimental Results and Analysis**

#### *5.1. Environment Modeling*

To replicate the intricate navigational marine conditions for USV simulation purposes, two map environment models of USV are established, both of which are 500 m × 500 m. The light blue arrow represents the direction of ocean currents, the black block represents the islands, the heavy blue triangle represents the starting point of USV with the coordinate (10,10), and the red star represents the target point of USV with the coordinate (490,490), as shown in Figure 6.

**Figure 6.** Environmental models for USV: (**a**) environmental model 1 (ENV.1); (**b**) environmental model 2 (ENV.2).

Additionally, the experiment was simulated on a laptop with an Intel(R) Core(TM) i7-5500 processor clocked at 2.40 GHz, 8 GB memory and Windows 7 64-bit operating system with MATLAB R2017b software.

#### *5.2. Static Path Planning Simulation Experiment*

There are two sets of static path planning simulation experiments to validate the proposed IWSO-DWA's advantages in the USV's path planning problems. The static path planning simulation experiment of USV is carried out by using the proposed IWSO-DWA, IWSO, WSO and five other common meta-heuristic algorithms (BOA, GWO, MRFO, WOA and SSA) in the same map. The parameters of the DWA part of the proposed IWSO-DWA are set as follows: The maximal linear velocity *v*max is 5 m/s and the maximal angular velocity *ω*max is 60 rad/s. The minimal linear velocity *v*min is 1 m/s and the minimal angular velocity *ω*min is 10 rad/s. The maximal linear acceleration *v <sup>e</sup>* is 0.7 m/s<sup>2</sup> and the maximal angular acceleration *ω <sup>e</sup>* is 75 rad/s2. The maximal linear deceleration *v <sup>f</sup>* is 0.8 m/s<sup>2</sup> and the maximal angular deceleration *ω <sup>f</sup>* is 80 rad/s2. The weight *<sup>α</sup>*, *<sup>β</sup>* and *<sup>γ</sup>* of the evaluation function are set to 0.3, 0.06 and 0.4, respectively. The population size of white sharks and five other meta-heuristic algorithms are all set to 50, and the maximal iteration is set to 300. The mentioned algorithms (BOA, GWO, MRFO, WOA, SSA, WSO, IWSO and IWSO-DWA) are used for the static path planning of USV in the ENV.1, and the results obtained from the simulation experiment are displayed in Figure 7.

**Figure 7.** Static path planned by the algorithms (BOA, GWO, MRFO, WOA, SSA, WSO, IWSO, IWSO-DWA) in ENV.1: (**a**) planned by BOA; (**b**) planned by GWO; (**c**) planned by MRFO; (**d**) planned by WOA; (**e**) planned by SSA; (**f**) planned by WSO; (**g**) planned by IWSO; (**h**) planned by IWSO-DWA. The dark blue triangle represents the start point and the red star represents the target point.

When taking into account the metrics of path length, steering times, path smoothness and time cost systematically, the static path planning performance of IWSO-DWA proposed in this study surpasses that of IWSO, WSO and other meta-heuristic algorithms (BOA, GWO, MRFO, WOA, SSA). Compared with the WSO, the path length, steering times and time cost planned by the IWSO decreased by 16.12%, 28.57% and 76.97%, respectively. And the path smoothness planned by the IWSO is improved by 30.22%.

Since the proposed IWSO-DWA algorithm is based on the IWSO algorithm to increase its dynamic characteristics, the proposed IWSO-DWA algorithm and the IWSO algorithm have equivalent effects on convergence performance when solely focusing on their static characteristics. Thus, when analyzing the algorithm's convergence, it suffices to only evaluate the IWSO. The convergence curves of the mentioned algorithms (BOA, GWO, MRFO, WOA, SSA, WSO and IWSO) in ENV.1 are displayed in Figure 8.

In the convergence curves, the horizontal axis label represents the iteration of the algorithms, and the vertical axis represents the fitness value of the algorithms. When compared with the WSO and five other meta-heuristic algorithms, the proposed IWSO algorithm has demonstrated the fastest convergence speed and highest accuracy of final convergence accuracy.

Based on its demonstrated performance, the second group of static path planning simulation experiments is executed to further validate the advancements of the proposed IWSO-DWA. The mentioned algorithms (BOA, GWO, MRFO, WOA, SSA, WSO, IWSO and IWSO-DWA) are utilized in the static path planning simulation experiment in ENV.2, and the results are illustrated in Figure 9.

**Figure 9.** Static path planned by the algorithms (BOA, GWO, MRFO, WOA, SSA, WSO, IWSO, IWSO-DWA) in ENV.2: (**a**) planned by BOA; (**b**) planned by GWO; (**c**) planned by MRFO; (**d**) planned by WOA; (**e**) planned by SSA; (**f**) planned by WSO; (**g**) planned by IWSO; (**h**) planned by IWSO-DWA. The dark blue triangle represents the start point and the red star represents the target point.

Similarly, when synthetically considering measurement criteria such as path length, steering times, path smoothness, and time cost, the proposed IWSO-DWA algorithm exhibited superior performance in the static path planning simulation experiments compared to the IWSO, the WSO and the five other meta-heuristic algorithms (BOA, GWO, MRFO, WOA and SSA). Compared with the WSO, the path length, steering times and time cost planned by the IWSO are decreased by 11.2%, 9% and 81.19%, respectively. Meanwhile, the path smoothness planned by the IWSO is improved by 9.49%. The convergence curves of the mentioned algorithms (BOA, GWO, MRFO, WOA, SSA, WSO, IWSO) in ENV.2 are shown in Figure 10.

**Figure 10.** Convergence curve of mentioned algorithms (BOA, GWO, MRFO, WOA, SSA, WSO, IWSO) in ENV.2.

In the convergence curves, the horizontal axis label represents the iteration of the algorithms and the vertical axis represents the fitness value of the algorithms. When compared with the WSO and five other meta-heuristic algorithms, the proposed IWSO algorithm reaches stability in about 15 iterations, which excelled in both convergence speed and accuracy.

After the completion of two static path planning simulation experiment sets, it is necessary to summarize the performance of the BOA, GWO, MRFO, WOA, SSA, WSO and IWSO algorithms in numerical format. Supposed the planned path of the algorithms can be represented by a group of points set *L*, and *L* = {*L*1, *L*2,..., *Lλ*}. *λ* is the number of path points in the set *L*. Then, the continuous steering angle between the path point *Li* and the subsequent path point *Li*+1 is denoted by *θi*. To better assess the smoothness of the path planned by the mentioned algorithms, a path smoothness cost metric denominated *mot* has been established, which is defined as follows:

$$mod = \sum\_{i=1}^{\lambda - 1} \frac{\varepsilon \cdot \pi \cdot \theta\_i}{180 \cdot (1 + \theta\_{i+1})^{\frac{3}{2}}} \tag{27}$$

where *i* = 1,2, ... , *λ* − 1. *ε* is the number of turns of the *L*. *θi+*<sup>1</sup> is the next rotation angle of the continuous rotation angle *θi*. The smaller the value of *mot*, the smoother the path.

In addition, to better evaluate the optimal path planning performance of the proposed algorithm, some metrics such as the steering cost, planning time cost and shortest path length cost are considered as the measure criteria of the mentioned algorithms. The steering cost indicates the total number of turns of the path planned by the algorithms. The planning time cost refers to the time it takes for an algorithm to plan its path in a static obstacle environment. The shortest path length cost means that the algorithm plans the shortest safe and collision-free path from the starting point to the target point, which can be defined as follows:

$$\mathcal{C}\_{L} = \mathcal{C}\_{safe} \cdot \sum\_{i=2}^{\lambda} \sqrt{(\mathbf{x}\_{L\_i} - \mathbf{x}\_{L\_{i-1}})^2 + (y\_{L\_i} - y\_{L\_{i-1}})^2} \tag{28}$$

where *CL* represents the shortest path length cost, which is the sum of the Euclidean distances between the points *Li*−<sup>1</sup> and *Li* in the set *L* of path points planned by the algorithms. *Csaf e* represents the safety path cost. In this paper, all the paths provided by the algorithms must be safe and collision-free, so here, *Csaf e* = 1.

In summary, the simulation experiments of the static path planning demonstrate that the proposed IWSO-DWA can effectively plan an optimal path globally that is both secure and smooth in the established environmental models, irrespective of any changes to the distribution of obstacles. As the proposed IWSO-DWA algorithm enhances its dynamic qualities based on the IWSO algorithm, it can be deemed equivalent to the IWSO algorithm when solely considering the static characteristics of path planning. Thus, when summarizing the simulation comparison experiments of the static path planning in digital form, it only needs to compare the performance of the proposed IWSO with WSO and five other algorithms (BOA, GWO, MRFO, WOA and SSA). The algorithms' performance in the simulation comparison experiments of the static path planning is summarized in Table 2.


**Table 2.** Comparison performance of the mentioned algorithms (BOA, GWO, MRFO, WOA, SSA, WSO, IWSO).

## *5.3. Dynamic Avoidance Simulation Experiment*

Two sets of dynamic collision avoidance simulation experiments were conducted to validate whether the proposed IWSO-DWA conforms to COLREGs rules and effectively avoids collisions in dynamic scenarios. Four situations are established in environmental model 1 and environmental model 2 of the COLREGs respectively: overtaking situation, head-on situation, port side crossing situation and starboard crossing situation. In the figures, the blue boat indicates the USV and the red boat indicates the obstacle ship. In ENV.1, the overtaking situation between the USV and the red obstacle ship is shown in Figure 11.

**Figure 11.** Overtaking situation in ENV.1: (**a**) the preparatory state; (**b**) the meeting state; (**c**) the completion state. The dark blue triangle and red star represent the start point and target point of the USV (in blue color), respectively, and the purple circle represents the start point of the obstacle ship (in red color).

The starting coordinate of the red dynamic obstacle ship is (260,120), and it moves in a straight line from bottom to top at a velocity of 2 m/s. The coordinate of the starting point of USV is (260,30), the target point of USV is (260,380), and it moves in a straight line from bottom to top at a velocity of 4 m/s. In the overtaking situation, when encountering the red dynamic obstacle ship, the USV initiates collision avoidance by veering toward the upper right direction at an angle of approximately 65 degrees. It expertly navigates past the red dynamic obstacle ship from its starboard side and continues towards the target point, following a previous path, thereby successfully avoiding a rear-end collision, and the dynamic collision avoidance behavior of the USV conforms to the COLREGs. The x, y position and yaw angle of the USV for its dynamic collision avoidance behavior are depicted in Figure 12.

**Figure 12.** The motion states of the USV for overtaking situation in ENV.1.

After completing the overtaking situation of USV in ENV.1, the head-on situation experiment of USV is carried out, and the results are displayed in Figure 13.

**Figure 13.** The head-on situation in ENV.1: (**a**) the preparatory state; (**b**) the meeting state; (**c**) the completion state. The dark blue triangle and red star represent the start point and target point of the USV (in blue color), respectively, and the purple circle represents the start point of the obstacle ship (in red color).

The starting point coordinate of the red dynamic obstacle ship is (260,350), and it moves in a straight line from top to bottom with a moving speed of 3 m/s. The coordinate of the starting point of USV is (260,30), the target point of USV is (260,380), and it moves in a straight line from bottom to top with a moving speed of 4 m/s. In the head-on situation, when encountering the red dynamic obstacle ship, the USV initiates adjusting starboard of the ship in a direction approximately 70 degrees towards the upper right direction, then skillfully navigates past the red dynamic obstacle ship's upper region from the USV's starboard side. After successfully avoiding the head-on collision with the red dynamic obstacle ship, the USV then progresses toward the target point, and the dynamic collision avoidance behavior of the USV conforms to the COLREGs. The x, y position and yaw angle of the USV for its dynamic collision avoidance behavior are depicted in Figure 14.

**Figure 14.** The motion states of the USV for head-on situation in ENV.1.

After completing the head-on situation of USV in ENV.1, the port side crossing situation experiment of USV is carried out, and the results are displayed in Figure 15.

**Figure 15.** Port side crossing situation in ENV.1: (**a**) the preparatory state; (**b**) the meeting state; (**c**) the completion state. The dark blue triangle and red star represent the start point and target point of the USV (in blue color), respectively, and the purple circle represents the start point of the obstacle ship (in red color).

The starting point coordinate of the red dynamic obstacle ship is (180,110), and it moves in a straight line from left to right with a moving speed of 4 m/s. The coordinate of the starting point of USV is (260,30), the target point of USV is (260,180), and it moves in a straight line from bottom to top with a moving speed of 4 m/s. In the port side crossing situation, since the red dynamic obstacle ship is a giving way vessel, it should stop to let the USV pass when it encounters the USV. However, if the red dynamic obstacle ship did not stop, the USV must take evasive action to prevent a collision. When the red obstacle ship enters the evasive range, the USV actively adjusts the starboard and keeps a safe distance from the red obstacle ship. After collision avoidance, the USV continued to move along the original path to the target point, thus finishing the port side crossing situation, and the dynamic collision avoidance behavior of the USV conforms to the COLREGs. The x, y position and yaw angle of the USV for its dynamic collision avoidance behavior are depicted in Figure 16.

**Figure 16.** The motion states of the USV for port side crossing situation in ENV.1.

After completing the port side crossing situation of USV in ENV.1, the starboard crossing situation experiment of USV is carried out, and the results are displayed in Figure 17.

**Figure 17.** Starboard crossing situation in ENV.1: (**a**) the preparatory state; (**b**) the meeting state; (**c**) the completion state. The dark blue triangle and red star represent the start point and target point of the USV (in blue color), respectively, and the purple circle represents the start point of the obstacle ship (in red color).

The starting coordinate of the red dynamic obstacle ship is (330,110), and it moves in a straight line from right to left with a moving speed of 4 m/s. The coordinate of the starting point of USV is (260,30), the target point of USV is (260,180), and it moves in a straight line from bottom to top with a moving speed of 4 m/s. In the starboard crossing situation, since the USV is a giving way vessel, it should stop to let the red dynamic obstacle ship pass when it encounters the red dynamic obstacle ship. When the red obstacle ship enters the evasive range, the USV adjusts its starboard side at approximately 47 degrees to avoid the red dynamic obstacle vessel and stops to wait for it to move away from the evasive range. Once the red obstacle vessel is out of the evasive range, the USV continues to move to the upper left to the target point, thus finishing the starboard crossing situation of the USV, and the dynamic collision avoidance behavior of USV conforms to the COLREGs. The x, y position and yaw angle of the USV for its dynamic collision avoidance behavior are depicted in Figure 18.

**Figure 18.** The motion states of the USV for starboard crossing situation in ENV.1.

Similarly, in ENV.2, four dynamic avoidance simulation experiments were conducted to validate the effectiveness of the proposed IWSO-DWA in line with the COLREGs. The overtaking situation between the USV and the red dynamic obstacle ship is shown in Figure 19.

**Figure 19.** Overtaking situation in ENV.2: (**a**) the preparatory state; (**b**) the meeting state; (**c**) the completion state. The dark blue triangle and red star represent the start point and target point of the USV (in blue color), respectively, and the purple circle represents the start point of the obstacle ship (in red color).

The starting point coordinate of the red dynamic target obstacle is (130,260), and it moves in a straight line from bottom to top with a moving speed of 2.5 m/s. The coordinate of the starting point of USV is (130,180), the target point of USV is (130,380), and it moves vertically upwards at a velocity of 4 m/s. In the overtaking situation, when the USV enters the evasive range, it avoids collision by steering approximately 68 degrees to the upper right and proactively sails across the upper section of the red dynamic obstacle ship from the USV's port side. Once it safely overtakes the red dynamic obstacle ship, the USV proceeds to advance toward the target point in the upper left direction, thus finishing the overtaking situation between the USV and the red dynamic obstacle ship, and the dynamic collision avoidance behavior of the USV conforms to the COLREGs. The x, y position and yaw angle of the USV for its dynamic collision avoidance behavior are depicted in Figure 20.

**Figure 20.** The motion states of the USV for overtaking situation in ENV.2.

After completing the overtaking situation of USV in ENV.2, the head-on situation experiment of USV is carried out, and the results are displayed in Figure 21.

**Figure 21.** The head-on situation in ENV.2: (**a**) the preparatory state; (**b**) the meeting state; (**c**) the completion state. The dark blue triangle and red star represent the start point and target point of the USV (in blue color), respectively, and the purple circle represents the start point of the obstacle ship (in red color).

The starting point coordinate of the red dynamic obstacle ship is (130,350), and it travels vertically downwards at a velocity of 2 m/s. The coordinate of the starting point of USV is (130,180), the target point of USV is (130,380), and it moves vertically upwards at a speed of 4 m/s. In the head-on situation, when the USV encounters the red dynamic obstacle ship, the USV avoids the collision by turning approximately 63 degrees to the starboard and proceeding to cross the upper section of the red dynamic obstacle ship. Once it is far away from the red dynamic obstacle ship, the USV moves to the target point in the direction of around 18 degrees to the upper left, thus finishing the head-on situation between the USV and the red dynamic obstacle ship, and the dynamic collision avoidance behavior of the USV conforms to the COLREGs. The x, y position and yaw angle of the USV for its dynamic collision avoidance behavior are depicted in Figure 22.

**Figure 22.** The motion states of the USV for head-on situation in ENV.2.

After completing the head-on situation of USV in ENV.2, the port side situation experiment of USV is carried out, and results are displayed in Figure 23.

**Figure 23.** Port side situation in ENV.2: (**a**) the preparatory state; (**b**) the meeting state; (**c**) the completion state. The dark blue triangle and red star represent the start point and target point of the USV (in blue color), respectively, and the purple circle represents the start point of the obstacle ship (in red color).

The starting point coordinate of the red dynamic obstacle ship is (75,260), it moves in a straight line from left to right with a moving speed of 3 m/s. The coordinate of the starting point of USV is (130,180), the target point of USV is (130,380), and it moves in a straight line from bottom to top with a moving speed of 4 m/s. In the port side situation, since the red obstacle ship is a giving way vessel when encountering the USV, it should stop to let the USV pass. However, if the red dynamic obstacle ship did not stop, the USV should take evasive action to prevent a collision. When the red obstacle ship enters the evasive range, the USV adjusts its starboard at roughly 80 degrees to avoid the red obstacle ship. Once the USV moves away from the red obstacle ship, it continues to move to the upper left towards the target point, thus finishing the port side situation between the USV and the red dynamic obstacle ship, and the dynamic collision avoidance behavior of the USV conforms to the COLREGs. The x, y position and yaw angle of the USV for its dynamic collision avoidance behavior are depicted in Figure 24.

**Figure 24.** The motion states of the USV for portside crossing situation in ENV.2.

After completing the port side situation of USV in ENV.2, the starboard situation experiment of USV is carried out, and the results are displayed in Figure 25.

**Figure 25.** Starboard situation in ENV.2: (**a**) the preparatory state; (**b**) the meeting state; (**c**) the completion state. The dark blue triangle and red star represent the start point and target point of the USV (in blue color), respectively, and the purple circle represents the start point of the obstacle ship (in red color).

The starting point coordinate of the red dynamic obstacle ship is (200,260), and it moves in a straight line from right to left with a moving speed of 3 m/s. The coordinate of the starting point of USV is (130,180), the target point of USV is (130,380), and it moves in a straight line from bottom to top at a velocity of 4 m/s. In the starboard situation, since the USV is a giving way vessel when encountering the red obstacle ship, it should stop to let the red dynamic obstacle ship pass. When the red obstacle ship enters the evasive range, the USV steers away from collision by adjusting its starboard and maintaining a safe distance from the red obstacle ship. Once the red obstacle ship is far away, the USV crosses the upper section of the red dynamic obstacle ship and moves to the target point in the upper left direction, thus finishing the starboard situation between the USV and the red dynamic obstacle ship, and the dynamic collision avoidance behavior of the USV conforms to the COLREGs. The x, y position and yaw angle of the USV for its dynamic collision avoidance behavior are depicted in Figure 26.

**Figure 26.** The motion states of the USV for starboard crossing situation in ENV.2.

#### **6. Conclusions and Future Work**

This research proposes a new IWSO-DWA algorithm to address the optimal path planning issue for USV. First of all, aiming at the disadvantages of uneven distribution and insufficient diversity of the white shark population, a circle chaotic mapping algorithm is employed to improve the initial solution's quality. Then, the adaptive weight factor technique is used to update the best white shark's position, ensuring a balance between global exploration and local exploitation. Furthermore, the simplex method is used to update the other white sharks' position near the best white shark, enhancing the algorithm's ability to escape the local optimum solution. Finally, a novel global dynamic optimal path planning method called the IWSO-DWA algorithm is developed by combining the improved WSO and the enhanced DWA. The performance of the IWSO-DWA algorithm is tested through two sets of static path planning simulation comparison experiments and two sets of dynamic avoidance simulation experiments. The study found that the IWSO-DWA algorithm outperformed traditional WSO algorithms and five other heuristic algorithms (BOA, GWO, MRFO, WOA and SSA) in the simulation experiments. Thus, the proposed IWSO-DWA algorithm not only addresses the issues encountered in the traditional WSO algorithm, but also guides USV to plan a global optimal path in challenging marine environments and possesses path smoothing capability and dynamic collision avoidance ability, and its collision avoidance behavior conforms to the COLREGs. However, the proposed IWSO-DWA has only been evaluated through simulations, and future research is required to focus on assessing its effectiveness in practical engineering optimization problems in real USV.

**Author Contributions:** Conceptualization, L.L.; methodology, J.L.; software, J.L.; validation, L.L. and J.L.; writing—original draft preparation, J.L.; writing—review and editing, L.L.; visualization, J.L.; project administration L.L. and J.L.; funding acquisition, L.L. All authors have read and agreed to the published version of the manuscript.

**Funding:** This research was funded by the Natural Science Foundation of Fujian Province, grant number 2022H6005.

**Institutional Review Board Statement:** Not applicable.

**Informed Consent Statement:** Not applicable.

**Data Availability Statement:** Not applicable.

**Acknowledgments:** The authors would like to thank the editors and anonymous reviewers for their constructive comments.

**Conflicts of Interest:** The authors declare no conflict of interest.
