An Improved Bald Eagle Search Algorithm for Global Path Planning of Unmanned Vessel in Complicated Waterways

: The path planning of unmanned ships in complex waters using heuristics usually suffers from problems such as being prone to fall into the local optimum, slow convergence, and instability in global path planning. Given this, this paper proposes a Self-Adaptive Hybrid Bald Eagle Search (SAHBES) Algorithm by incorporating adaptive factors into the traditional BES in order to enhance the early global searching ability of the BES algorithm. Moreover, Pigeon-Inspired Optimization (PIO) is introduced to overcome the disadvantage of traditional BES algorithms: that it is easy for them to fall into local optimization. This study improves the ﬁtness function by adding a distance between the ships’ path corners. The obstacle is based on the calculation of the path length. The curve optimization module is applied to smooth the obtained path to generate more rational path planning results, which means the path is the shortest and avoids collision successfully. A simulation test of the SAHBES algorithm on the path planning under different obstacle scenarios is conducted by using the MATLAB platform. The results show that SAHBES can generate the shortest safe, smooth path in different complex water environments, considering the limitations of fundamental ship maneuvering operations compared to other algorithms, thus verifying the feasibility and efﬁciency of the proposed SAHBES algorithm.


Introduction
In recent years, with the development of water transportation, the number of ships has increased dramatically, and the size of the vessels has mainly expanded.Suppose ship collision accidents occur in the navigation area.In that case, the navigation of ships near the accident area will be affected, and the leakage accident caused by the collision will cause large-scale pollution in the water area.Therefore, effectively reducing the risk of ship collision is a significant challenge facing the current shipping safety field [1].
The research on ship collision avoidance systems is significant to ship navigation safety.The path planning of ships is more complex than that of mobile robots due to the influence of factors such as the navigation environment and ship maneuverability.Therefore, autonomous collision avoidance, path planning, and other issues of unmanned ships have always been the research focus of the shipping industry.Ship path planning methods can be broadly grouped into two categories.One is deterministic ship path planning based on mathematical, physical, and other theoretical backgrounds; the other is based on intelligent optimization techniques, such as a heuristic algorithm.

Complicated Waters
At present, there is no clear definition of complex waters, which usually refers to waters with poor natural conditions, complex ship traffic flow, and great difficulty for

Ship Collision Avoidance Path Planning Based on Heuristic Algorithms
With the rapid development of artificial intelligence, heuristic algorithms such as the A star algorithm, deep reinforcement learning [11,12], the particle swarm optimization algorithm, the genetic algorithm [13], and Markov decision making have also been extensively applied in collision avoidance decision-making and path planning.
Singh [14] proposed the use of the A star method for the current and dynamic and static obstacles in the marine environment, as it is used to plan the optimal path of unmanned ships in a restricted marine environment.The simulation of different environmental conditions proves that this method can generate a safer route path without reducing navigation efficiency based on the traditional A star.He et al. [15] proposed a dynamic path planning method based on the A star algorithm and ship navigation rules for complex multi-ship encounter situations, namely, the Dynamic Anti-collision A-Star (DAA star) algorithm.This algorithm considers the maneuverability constraints of a single ship and the differences between ships, and can solve the path planning problem of dynamic obstacles in multi-ship encounter situations.Xie et al. [16] proposed a global and multidirectional A-star algorithm, which first displayed the artificial potential field (APF) in a scalar mode.
Furthermore, a punishment mode was established for submarine pipelines, which, combined with the A star optimization algorithm, reasonably planned out the path of working ships in the offshore wind farm to ensure the safety and efficiency of navigation.Tharwat et al. [17] used the model of the Bezier curve to plan the path, used a new chaotic particle swarm optimization algorithm to optimize the control points of the Bezier curve, and proposed two variants of particle swarm optimization algorithm: CPSO-I and CPSO-II.The experiment proved that both variants could find the optimal path.Based on the premise that there is no external interference in the open sea area, Li et al. [18] used the improved multi-objective optimization algorithm NSGA-II, combined with the ship domain model, to conduct collision avoidance simulation experiments.The experimental results show that this method can optimize the ship's collision avoidance strategy and provide a reasonable scheme for the ship's navigation path.Joohyun and Nakwan [19] proposed an autonomous collision avoidance method based on deep reinforcement learning for the collision avoidance process of unmanned surface ships.This method uses the visual recognition ability of the deep neural network to analyze the encounter situation of ships and determine the stand-on and giveaway vessels.The deep learning, combined with the Markov decisionmaking model, is used to establish a collision avoidance simulation experiment, and the optimal collision avoidance strategy is obtained through continuous iterative training.Xue [20] designed a sine-cosine particle swarm optimization (SC-PSO) algorithm based on quasi-reflection.The new algorithm has a fast convergence speed and ideal results, and the effectiveness and rationality of the algorithm have been proven through simulation experiments.Han et al. [21] proposed a dynamic hybrid path planning scheme.In this method, a non-uniform cost map with a risk function for global path planning and an implemented reverse search from the target node through a non-uniform Theta-A star are used to solve the problem of a path falling into the local optimum.Experimental results show the effectiveness of the proposed algorithm.
In conclusion, the ship collision avoidance model based on the deterministic mathematical method has high computational complexity and accurate results.However, such methods generally only consider the navigation status between collision avoidance ships for calculation and often need to consider the changeable and complex navigation environment at sea, with a poor degree of freedom and generalization ability.In order to solve this problem, artificial intelligence algorithms are widely used in ship collision avoidance and path planning.With the help of computers, vessels' collision avoidance simulation experiments can consider the impact of ship parameters, the external environment, and other complex factors on collision avoidance between ships, making the collision avoidance process more realistic and the results more accurate.However, most heuristic algorithms require extensive training and many iterations to get accurate results, which sometimes affects computational efficiency.In order to solve this problem, this paper refers to the idea of the Bald Eagle Search Algorithm.It proposes an adaptive hybrid eagle Search Algorithm to study ship collision avoidance and path planning.
In order to solve the problems of global path planning for unmanned ships in complex waters, which ca easily fall into the local optimum with slow and unstable convergence, this paper is inspired by the Bald Eagle Search Algorithm (BES).It makes various improvements based on the traditional BES: firstly, the adaptive control factor is introduced in the structure of the algorithm, and some ideas of the pigeon flock algorithm are incorporated; secondly, the structure of the fitness function is combined with the structure of the adaptive degree function which is combined with the actual navigation and curve optimization module to make corresponding improvements.The proposed model converges faster and iterates more efficiently, which means it has robustness and does not easily fall into the local optimum.
The rest of the paper is constructed as follows: the Section 2 introduces the improvement of the traditional BES algorithm and the calculation process of the proposed collision avoidance algorithm in detail and selects four groups of test functions to verify the feasibility of the adaptive hybrid BES algorithm.In Section 3, four groups of obstacle avoidance experiments are designed and compared with the adaptive particle swarm optimization algorithm and the traditional BES algorithm.Section 4 concludes this research.

Methodology
The BES algorithm was first proposed by Malaysian scholar Alsattar [22] in 2020.It is a meta-heuristic algorithm based on the predation process of the bald eagle.It simulates the bald eagle's hunting strategy or intelligent social behavior when searching for prey.In this paper, it is equivalent to the behavior of finding the optimal path.BES hunting is divided into three stages: the first stage is to select the space with the most prey, the second stage is to search for prey in the selected space, and the third stage is to conduct diving hunting.The whole algorithm will repeat these three stages in each iteration.The mathematical expression of the three stages of the traditional BES is shown as follows.
(1) Selection stage: The individual determines the search space through the optimal fitness to the initial population and the average position of the current population and randomly selects the direction to update the individual post to a new area near the previous search area to continue to choose.The particular location update method is shown in Equation (1): where α = [1.5, 2] refers to factors controlling position changes, ε is a uniform random number in [0, 1], P best is the current optimal individual position, P i is the position at this moment, and P mean is the average position of the population.
(2) Prey searching stage: In the prey-searching stage, the eagles will update their positions with the trajectory of Archimedes's spiral around the current status.The formulas are shown as follows: where x i , y i ; xr i , yr i ; θ i , r i can be respectively expressed by Equations (3)-( 5): In Equation ( 5), α ∈ [5, 10], R ∈ [0.5, 2], which is the parameter that controls the spiral path, θ i and r i are the polar angle and polar diameter of the spiral equation, and x i and y i are the positions of corresponding individuals in Cartesian coordinates.The value is [−1, 1] to change the spiral shape.
It can be seen that an individual flies around himself, and the flying distance is determined by the distance between himself and the center of the group and the distance between himself and the following individual (if the current individual is the last in the group, its following individual is the first individual in the group).
(3) Swooping stage: In the swooping stage, the population dives from the best position in the search space to the target.The specific formula is shown as follows: x i = xr i max(|xr|) where c 1 and c 2 refer to a constant number and the general value range is [1,2].In this stage, individuals will update their positions around the optimal individuals in a spiral path.In the position update process in the swoop stage, the optimal individual position is a random coefficient.The parameters c 1 and c 2 will increase the movement intensity of the individual toward the best point and the center point.The algorithm will accelerate the convergence speed at the beginning if there is no random coefficient.However, when it is near the best point, it will produce oscillation, resulting in no convergence.The other three stages have a common step: if the new position obtained by searching is better than the original one, the individual will update to the new one.Otherwise, it will stay in its original position.Because of the special structure of the traditional BES algorithm, it calculates the fitness three times in each population update process.Combined with the search path of Archimedes spiral, the algorithm converges very quickly in the early iteration, making it easy for it to fall into the local optimum.The process of the traditional BES algorithm is shown in Figure 1.
In addition, the location update method in the traditional BES at each stage also has some improvement: in the region selection stage, from Equation (1), it can be seen that the search performance in this stage mainly depends on the value of control factor.Control factor α is a fixed value, and the optimization potential of the algorithm cannot be fully exerted.In the swoop phase, from Equation ( 6), it can be seen that, because there is a random coefficient of [0, 1] before the optimal position, its position will gradually converge to 0; when the optimal solution is not at 0, the result is relatively poor.Aiming at the above shortcomings and considering the unique requirements of path planning in the unmanned ship, this paper proposes two improvement strategies for the traditional BES.In addition, the location update method in the traditional BES at each stage also has some improvement: in the region selection stage, from Equation (1), it can be seen that the search performance in this stage mainly depends on the value of control factor.Control factor α is a fixed value, and the optimization potential of the algorithm cannot be fully exerted.In the swoop phase, from Equation ( 6), it can be seen that, because there is a random coefficient of [0, 1] before the optimal position, its position will gradually converge to 0; when the optimal solution is not at 0, the result is relatively poor.Aiming at the above shortcomings and considering the unique requirements of path planning in the unmanned ship, this paper proposes two improvement strategies for the traditional BES.

Algorithm Structure Improvement
In order to maximize the optimization potential of the algorithm, this paper introduces an adaptive control factor to determine the value of the control factor in the selection region stage.The adaptive control factor can adjust its value with the increasing number of iterations so that the individuals in the early iteration of the algorithm fly away from the population to increase population diversity, expand the search range, and maintain good global search performance.In contrast, in the late iteration, they gather in the

Algorithm Structure Improvement
In order to maximize the optimization potential of the algorithm, this paper introduces an adaptive control factor to determine the value of the control factor in the selection region stage.The adaptive control factor can adjust its value with the increasing number of iterations so that the individuals in the early iteration of the algorithm fly away from the population to increase population diversity, expand the search range, and maintain good global search performance.In contrast, in the late iteration, they gather in the optimal global direction, making the algorithm cluster, thus enhancing the local optimization ability of the algorithm and accelerating the convergence speed.This paper designs an adaptive control factor whose value decreases with the number of iterations α .The improved mathematical expression of α is shown as follows: where α max and α min respectively represent the maximum and minimum values of α in traditional BES, t refers to the number of iterations of the current algorithm, and T represents the maximum number of iterations of the algorithm.
On the other hand, to improve the algorithm's zero tendencies, this paper adds part of the idea of the pigeon swarm algorithm in the dive phase of the traditional BES.First, it needs to sort the individuals of the population according to the corresponding fitness function value and divide the population into two groups.The better group keeps its position unchanged while providing its average position as a parameter.At the same time, α is used to adaptively adjust the new position determined by the group with poor fitness to enrich the diversity of the population while preserving the population advantage.If the fitness value of the individual position after the grouping update is better than that of the original individual, the new individual is retained.Otherwise, the original is maintained.The specific formulas are shown as follows: where N refers to the total number of individuals in the eagle population, and Equation (11) gives the average position of the better part of individuals.At the same time, Equation (12) shows that the worse part of individuals randomly flies a distance toward the center of gravity of the better part of individuals.
In order to verify whether the algorithm improvement is reasonable, this paper selects four groups of functions for the maximum value search test.Because the global path planning of ships has the characteristics of high demand population dimension and a large number of locally optimal solutions, the optimal solution is not fixed.This paper selects 4 multimodal surface functions from 23 standard test functions and makes minor changes to them before the test; the optimal value deviates from the (0,0) point.At the same time, it is complicated to a certain extent, increasing the difficulty of optimization.The four test function names, the dimensions of the test population, and the search range are shown in Table 1.Compared with the function prototype, the minimum value of the function and the position coordinates corresponding to the minimum value are the main differences.The modified function image is shown in Figure 2.
As shown in Figure 2, the characteristic of the Ackley function is that it has a large number of local minima but only one global minimum, which brings the risk that optimization algorithms, especially mountain climbing algorithms, are trapped in one of their many local minima.The distribution of Schwefel 2.26 function values is exceptionally irregular.Similarly to Ackley, there are a large number of local minima and only one global minimum.In addition, the Penalized function is similar to the Rastigin function, although the function image is quite different, and there are also many local minima.They are highly multimodal, but the minimum values are regularly distributed.
Assume that the number of the eagle is 50, the number of iterations is 100, and the population dimension is uniformly set to 30.The size of the current optimal value reached by the population after the iteration or the number of iterations reaching the optimal global value is taken as the basis for evaluating the optimization effect of the algorithm.At the same time, in order to test the robustness of the algorithm, this paper runs each test function 50 times with the traditional BES and SAHBES algorithms and averages the fitness curve to get the final result, as shown in Figure 2.  Assume that the number of the eagle is 50, the number of iterations is 100, and the population dimension is uniformly set to 30.The size of the current optimal value reached by the population after the iteration or the number of iterations reaching the optimal global value is taken as the basis for evaluating the optimization effect of the algorithm.At the same time, in order to test the robustness of the algorithm, this paper runs each test function 50 times with the traditional BES and SAHBES algorithms and averages the fitness curve to get the final result, as shown in Figure 2.
It can be seen from Figure 3 that the improved BES algorithm performs well in the test results of the four functions, and its convergence speed is more robust than that of the traditional BES algorithm.In the four groups of tests, SAHBES can reach the optimal value It can be seen from Figure 3 that the improved BES algorithm performs well in the test results of the four functions, and its convergence speed is more robust than that of the traditional BES algorithm.In the four groups of tests, SAHBES can reach the optimal value of the function after an average of 15 iterations, while the traditional BES requires an average of 65 iterations.In terms of convergence efficiency, SAHBES is 77% higher than the traditional BES.In the test results of F1 and F2 functions, the optimization effect of SAHBES not only makes it fast in convergence but also more potent than that of traditional BES when it falls into local optimization.From the above, the overall performance of SAHBES is better than that of traditional BES. of the function after an average of 15 iterations, while the traditional BES requires an average of 65 iterations.In terms of convergence efficiency, SAHBES is 77% higher than the traditional BES.In the test results of F1 and F2 functions, the optimization effect of SAHBES not only makes it fast in convergence but also more potent than that of traditional BES when it falls into local optimization.From the above, the overall performance of SAHBES is better than that of traditional BES.

Improvement of Fitness Function
The general global path planning method only aims at finding the shortest path, but many factors must be considered in the actual waters.Considering the limitations of the self-maneuverability of the unmanned ship when traveling and the requirements for navigation safety, this paper adds the turning angle function and the safety distance function to the path length function when calculating the fitness function.The overall fitness function of the path is obtained by weighted average processing of the three functions, to obtain the safest path that meets the maneuverability of the ship.To facilitate the calculation, the obstacles in this paper are simplified as circles.The fitness function calculation model is shown in Figure 4.

Improvement of Fitness Function
The general global path planning method only aims at finding the shortest path, but many factors must be considered in the actual waters.Considering the limitations of the selfmaneuverability of the unmanned ship when traveling and the requirements for navigation safety, this paper adds the turning angle function and the safety distance function to the path length function when calculating the fitness function.The overall fitness function of the path is obtained by weighted average processing of the three functions, to obtain the safest path that meets the maneuverability of the ship.To facilitate the calculation, the obstacles in this paper are simplified as circles.The fitness function calculation model is shown in Figure 4.In Figure 4, (i) The path length fitness function is used to calculate the total length of the path generated by the model.The function is shown in Equation ( 13): ) ( D n n n P P P f (13) where D represents the individual dimension, i.e., the number of path points generated.
(ii) Steering angle fitness function is used to calculate the path angle corresponding to each path point.In combination with the actual navigation at sea and the requirements of collision avoidance rules, small angles shall be selected for steering as far as possible, and the inverse of the included path angle shall be considered for fitness calculation in function design.The function is shown in the following formula: where   In Figure 4, P (n) refers to the n-th path point, O (m) refers to the center point of the m-th obstacle.The range is represented by a circle with a radius of S (O) , ϑ n refers to the included angle of the path corresponding to the n-th path point, S m n refers to the nearest distance from the first route n to the second obstacle m.
(i) The path length fitness function is used to calculate the total length of the path generated by the model.The function is shown in Equation ( 13): where D represents the individual dimension, i.e., the number of path points generated.
(ii) Steering angle fitness function is used to calculate the path angle corresponding to each path point.In combination with the actual navigation at sea and the requirements of collision avoidance rules, small angles shall be selected for steering as far as possible, and the inverse of the included path angle shall be considered for fitness calculation in function design.The function is shown in the following formula: n=2 arccos( where ρ (n−1) and ρ (n+1) are the difference between the (n − 1) and (n + 1) path points and the n-th path point.
(iii) The safety distance function calculates the distance S between the generated path and the center of each obstacle.The greater the distance, the smaller the function value.The function is shown as follows: where N (O) represents the total number of obstacles.In addition, to prevent invalid paths from being generated, when calculating S m n , there will be a judicial process.If the generated path intersects the obstacle range circle, the algorithm will jump out of the loop and update the current individual.The formulas are shown as follows: In order to more conveniently compare the effect of path planning with other algorithms through the fitness function value, this paper adjusts the optimized fitness function value: the fitness value obtained from the path length function in the above three functions is taken as the main body, and the steering angle function and the safety distance function are normalized and weighted at the same time to obtain the overall fitness, where the weighted coefficient of the path length function is 0.4.The weighting coefficient of steering angle function and safety distance function is set as 0.3, and the function is as follows: where ρ represents the maximum expected distance between the generated path and the obstacle center.

Curve Optimization Module
The route derived by SAHBES is a sequential linking of the coordinates of the optimal individuals into a fold line, which still has a discrepancy with the actual path.For the folding path generated by SAHBES, this paper introduces a curve optimization module to optimize the resulting path using Bézier curves.Finally, it obtains a smooth curve that matches the actual motion trajectory of the unmanned ship.
Bézier curves are commonly applied as vector curves, and the generalized nth order Bézier curve is shown in Equation ( 18): where B(t) denotes the Bézier curve connecting the key point P 0 , P 1 , . . ., P n .The current common path optimization method uses high-order Bézier curves by extracting the floating points in the algorithm-generated folding path and then using its number as the basis for selecting the order of the Bézier curve to obtain a smooth continuous path.However, this method does not optimize the path in the case of curved path points because the optimized path will not be able to bypass the obstacles due to the characteristics of the higher-order Bézier curve.The optimized path does not work, so to deal with this problem, the obtained folding path is segmented, and the order of the Bézier curve is limited to 3. The optimization is performed only at the turning point of the folding path, and the straight-line part is retained in the original form so that the adaptation of the folding path generated by the algorithm can be maintained at the maximum and the purpose of smooth optimization can be achieved.The Bézier curve path optimization is shown in Figure 5.

SAHBES Iteration Steps
The final structure block diagram of the complete SAHBES and the specific iteration steps are shown in Figure 6.

SAHBES Iteration Steps
The final structure block diagram of the complete SAHBES and the specific iteration steps are shown in Figure 6.

SAHBES Iteration Steps
The final structure block diagram of the complete SAHBES and the specific iteration steps are shown in Figure 6.Step 1: The parameters relating to the algorithms and map information are set: values are assigned to the population size N, the search range [lbx, ubx, lby, uby], the spatial D, the maximum number of iterations T, and the coordinates O and the obstacle radius S of the obstacles.
Step 2: The location of each individual in the population is initialized and a random N × D dimensional matrix is generated as the initial population within the search range, storing the location information of the individuals.
Step 3: The population's initial fitness value is calculated.Each individual's fitness value is calculated according to the fitness function F(P).These are then sorted to select the smallest fitness in the population, denoted as Pbest, and its corresponding individual is denoted as PbestX.
Step 4: In the selection stage, individual positions are updated according to Equations ( 1) and ( 10), the self-adaptive control factor α' is calculated using the decreasing function, and the population fitness is calculated after the update is completed.The individuals with better fitness than before are updated in their normal positions, and vice versa, and the replacement record operation is also performed for Pbest and PbestX.
Step 5: In the prey searching stage, the population position updated by Equation ( 1) is updated again according to Equation (2), and the population fitness is calculated after the update is completed.The individuals with better fitness than before are updated in their normal positions, and vice versa, and the replacement record operation is also performed for Pbest and PbestX.
Step 6: In the swooping stage, the population is sorted according to the fitness value according to Equation (11), and the individuals with poor fitness are updated once individually, and then the population position is updated as an entire group according to Equation (6), and the population fitness is calculated after the update is completed.The individuals with better fitness than before are updated in their normal positions, and vice versa, and the replacement record operation is also performed for Pbest and PbestX.
Step 7: The iterative process from step 4 to step 6 is repeated, the search is stopped when the termination condition is satisfied, and the global optimal solution PbestX is output.
Step 8: The generated paths' key points (n) are extracted in floating points.Then, the generated fold paths are optimized by segmentation using third-order Bézier curves to derive the final paths.

Simulation Tests
In order to test the path planning performance of SAHBES more comprehensively, a variety of complex maps, including random distribution obstacles as well as trap obstacles, are set in this paper.In terms of the algorithm parameters, the total number of individuals in the population is set to 20, and the total number of iterations is 1000.The individual dimension can also be understood as the number of path points of the algorithm-generated paths, and the larger the value is, the smoother the paths generated by the algorithm will be.However, this will also increase the computing time significantly, so in order to improve the efficiency of the calculation, this individual dimension is set to 5 and combined with the curve optimization module to make the generated paths smoother.The fitness function also needs to be set to the value of ρ.Since the radius of obstacles varies in random charts, this paper sets ρ to 0.5 times the radius of obstacles.
In this paper, Self-Adaptive Particle Swarm Optimization (SAPSO), as well as conventional BES, are applied to global path planning as a control group to highlight the advantages of the proposed SAHBES in global path planning and optimized with Bézier curves, respectively, with the specific parameters shown in Table 2.
In the BES and SAHBES algorithms, α, R controls the shape of the spiral search trajectory of the individual algorithm in the search stage, and c 1 , c 2 reflects the late convergence strength of the algorithm in the swoop stage, which are taken as the default values in this paper: c 1 , c 2 denotes the two learning factors, which take the default value of two.It acts similarly to α and is related to the upper limit of the number of iterations T, whose value varies with the number of iterations t.Vmax denotes the dynamic range of each variable in the particle swarm, which is set to 1 by default.The value of w is mathematically expressed as the following Equation ( 19):

Path Planning Simulation with Obstacles
The distribution of the random obstacles chart is shown in Figure 7. Due to the obstacles' dispersion, the population is easily affected by its low initial fitness during the initialization of the algorithm in the early search phase by falling into the local optimum.SAPSO and BES fall into the local optimum to varying degrees due to their low iteration efficiency.Although the generated paths meet the safety requirements, the curvature of the paths generated by BES is larger.At the same time, the SAHBES algorithm has a greater global search ability, and the fitness value is lower.Moreover, its fitness function and control factor are improved to generate smooth, safe, and better paths in the early iteration.The fitness values curves of the three algorithms are shown in Figure 8.
value varies with the number of iterations t.Vmax denotes the dynamic range of each variable in the particle swarm, which is set to 1 by default.The value of w is mathematically expressed as the following Equation ( 19):

Path Planning Simulation with Obstacles
The distribution of the random obstacles chart is shown in Figure 7. Due to the obstacles' dispersion, the population is easily affected by its low initial fitness during the initialization of the algorithm in the early search phase by falling into the local optimum.SAPSO and BES fall into the local optimum to varying degrees due to their low iteration efficiency.Although the generated paths meet the safety requirements, the curvature of the paths generated by BES is larger.At the same time, the SAHBES algorithm has a greater global search ability, and the fitness value is lower.Moreover, its fitness function and control factor are improved to generate smooth, safe, and better paths in the early iteration.The fitness values curves of the three algorithms are shown in Figure 8.

Trap Obstacles Simulation I (1) Simulation Results
In order to compare the path planning effects of the three algorithms more obviously, three more complex trap obstacles charts are set up in this paper.The distribution of the Trap Obstacles Simulation I is shown in Figure 9.In this simulation, the search and generation of the optimal path are more difficult, and the global search ability and iteration efficiency of the algorithms are tested more.The values of the fitness functions of the three algorithms are shown in Figure 10.

Trap Obstacles Simulation I (1) Simulation Results
In order to compare the path planning effects of the three algorithms more obviously, three more complex trap obstacles charts are set up in this paper.The distribution of the Trap Obstacles Simulation I is shown in Figure 9.In this simulation, the search and generation of the optimal path are more difficult, and the global search ability and iteration efficiency of the algorithms are tested more.The values of the fitness functions of the three algorithms are shown in Figure 10.

Trap Obstacles Simulation I (1) Simulation Results
In order to compare the path planning effects of the three algorithms more obviously, three more complex trap obstacles charts are set up in this paper.The distribution of the Trap Obstacles Simulation I is shown in Figure 9.In this simulation, the search and generation of the optimal path are more difficult, and the global search ability and iteration efficiency of the algorithms are tested more.The values of the fitness functions of the three algorithms are shown in Figure 10.  (

2) Conclusion of simulation results
From Figure 9, it can be seen that all three algorithms can find safe paths to avoid obstacles, but the path of SAPSO has an obvious turning point, which is caused by the two path points being too close to each other before the curve optimization.The path generated by SAHBES reduces the unnecessary and redundant parts of the path more than BES, which can be more economical in practical applications.However, by analyzing the fitness values, the global search ability of SAPSO and BES does not dominate when there are few optimal solutions.The optimal solution of BES is updated frequently but hardly reaches the optimum.SAHBES has more vital local search ability and greater convergence due to integrating part of the PIO into the swooping stage.However, it can be reflected only after decreasing in the later iterations.(2) Conclusion of simulation results From Figure 9, it can be seen that all three algorithms can find safe paths to avoid obstacles, but the path of SAPSO has an obvious turning point, which is caused by the two path points being too close to each other before the curve optimization.The path generated by SAHBES reduces the unnecessary and redundant parts of the path more than BES, which can be more economical in practical applications.However, by analyzing the fitness values, the global search ability of SAPSO and BES does not dominate when there are few optimal solutions.The optimal solution of BES is updated frequently but hardly reaches the optimum.SAHBES has more vital local search ability and greater convergence due to integrating part of the PIO into the swooping stage.However, it can be reflected only after decreasing in the later iterations.

Trap Obstacles Simulation II (1) Simulation Results
The Trap Obstacles Simulation II distribution is shown in Figure 11, and there is only one optimal path.The values of the fitness functions of the three algorithms are shown in Figure 12.
optimal solutions.The optimal solution of BES is updated frequently but hardly re the optimum.SAHBES has more vital local search ability and greater convergence d integrating part of the PIO into the swooping stage.However, it can be reflected only decreasing in the later iterations.

Trap Obstacles Simulation II (1) Simulation Results
The Trap Obstacles Simulation II distribution is shown in Figure 11, and there is one optimal path.The values of the fitness functions of the three algorithms are sho Figure 12.  (2) Simulation Conclusions Similarly to the Trap Obstacles Simulation I, Figure 11 shows that only one optimal path exists, but with a higher degree of folding complexity.SAHBES generates a path that can remain highly efficient and safe under the improved fitness function.While SAPSO does not find the optimal path and has the problem of falling into a local optimum, the path generated by BES fails to satisfy the safety condition and finds the optimal path after curve optimization and intersection with the obstacles.The advantage of SAHBES global path planning can be observed.

Trap Obstacles Simulation III (1) Simulation Results
The distribution of the Trap Obstacles Simulation III is shown in Figure 13, and there (2) Simulation Conclusions Similarly to the Trap Obstacles Simulation I, Figure 11 shows that only one optimal path exists, but with a higher degree of folding complexity.SAHBES generates a path that can remain highly efficient and safe under the improved fitness function.While SAPSO does not find the optimal path and has the problem of falling into a local optimum, the path generated by BES fails to satisfy the safety condition and finds the optimal path after curve optimization and intersection with the obstacles.The advantage of SAHBES in global path planning can be observed.

Trap Obstacles Simulation III (1) Simulation Results
The distribution of the Trap Obstacles Simulation III is shown in Figure 13, and there are two optimal paths.The values of the fitness functions of the three algorithms are shown in Figure 14.
path exists, but with a higher degree of folding complexity.SAHBES generates a path that can remain highly efficient and safe under the improved fitness function.While SAPSO does not find the optimal path and has the problem of falling into a local optimum, the path generated by BES fails to satisfy the safety condition and finds the optimal path after curve optimization and intersection with the obstacles.The advantage of SAHBES in global path planning can be observed.

Trap Obstacles Simulation III (1) Simulation Results
The distribution of the Trap Obstacles Simulation III is shown in Figure 13, and there are two optimal paths.The values of the fitness functions of the three algorithms are shown in Figure 14.(2) Simulation Conclusions Figure 13 shows the symmetric structure obstacles; there exist two optimal paths.The path generated by SAPSO has intersection points with the obstacles.The global optimization ability needs to be better and converge to the optimum.In contrast, BES generates paths that can maintain a safe distance from the obstacles, but the paths generated by this algorithm may have local optimum problems.SAHBES still performs the best, and, combined with the analysis of the fitness values curve (Figure 14), the algorithm has converged to an optimal solution similarly to BES in the middle of the iteration.At the end of the iteration, it can optimize further due to the effect of the self-adaptation factor.

Conclusions
This paper improves the algorithm structure of the basic BES.It proposes SAHBES by introducing self-adaptive control factors and incorporating a part of the ideas of PIO, which has good robustness, a higher convergence rate, and high iteration efficiency (77% higher than traditional BES) (The code of SAHBES can be found in Appendix A).In order to make the generated paths realistic, this paper also introduces a curve optimization module to optimize the generated fold paths using third-order Bézier curves.Compared with SAPSO and traditional BES, SAHBES also shows excellent performance in global (2) Simulation Conclusions Figure 13 shows the symmetric structure obstacles; there exist two optimal paths.The path generated by SAPSO has intersection points with the obstacles.The global optimization ability needs to be better and converge to the optimum.In contrast, BES generates paths that can maintain a distance from the obstacles, but the paths generated by this algorithm may have local optimum problems.SAHBES still performs the best, and, combined with the analysis of the fitness values curve (Figure 14), the algorithm has converged to an optimal solution similarly to BES in the middle of the iteration.At the end of the iteration, it can optimize further due to the effect of the self-adaptation factor.

Conclusions
This paper improves the algorithm structure of the basic BES.It proposes SAHBES by introducing self-adaptive control factors and incorporating a part of the ideas of PIO, which has good robustness, a higher convergence rate, and high iteration efficiency (77% higher than traditional BES) (The code of SAHBES can be found in Appendix A).In order to make the generated paths realistic, this paper also introduces a curve optimization module to optimize the generated fold paths using third-order Bézier curves.Compared with SAPSO and traditional BES, SAHBES also shows excellent performance in global path planning simulation tests and generates a continuous smooth path that meets the actual navigation situation.Moreover, the path is safe enough in terms of its distance and reliability, laying the foundation for unmanned ships' path planning.
However, the multiple calculations of the fitness values in the algorithm structure lead to its high iteration efficiency but weak overall operation speed, which can be reconsidered to improve the algorithm structure further to decrease its operation time.In addition, this paper only verifies the superiority of SAHBES compared with traditional BES and its feasibility in global path planning.The simulation experiments are completed with the MATLAB platform, which can be considered for the application to real ships for further testing in future studies.
Compared with the function prototype, the minimum value of the function and the position coordinates corresponding to the minimum value are the main differences.The modified function image is shown in Figure2.

Figure 2 .
Figure 2. Schematic diagram of test function.As shown in Figure 2, the characteristic of the Ackley function is that it has a large number of local minima but only one global minimum, which brings the risk that optimization algorithms, especially mountain climbing algorithms, are trapped in one of their many local minima.The distribution of Schwefel 2.26 function values is exceptionally irregular.Similarly to Ackley, there are a large number of local minima and only one global minimum.In addition, the Penalized function is similar to the Rastigin function, although the function image is quite different, and there are also many local minima.They are highly multimodal, but the minimum values are regularly distributed.Assume that the number of the eagle is 50, the number of iterations is 100, and the population dimension is uniformly set to 30.The size of the current optimal value reached by the population after the iteration or the number of iterations reaching the optimal global value is taken as the basis for evaluating the optimization effect of the algorithm.At the same time, in order to test the robustness of the algorithm, this paper runs each test function 50 times with the traditional BES and SAHBES algorithms and averages the fitness curve to get the final result, as shown in Figure2.It can be seen from Figure3that the improved BES algorithm performs well in the test results of the four functions, and its convergence speed is more robust than that of the traditional BES algorithm.In the four groups of tests, SAHBES can reach the optimal value

Figure 2 .
Figure 2. Schematic diagram of test function.

Figure 3 .
Figure 3.Comparison of the test functions' fitness value curve.

Figure 3 .
Figure 3.Comparison of the test functions' fitness value curve.

P
refers to the n-th path point, ) (m O refers to the center point of the m-th obstacle.The range is represented by a circle with a radius of ) (O S , n  refers to the included angle of the path corresponding to the n-th path point, m n S refers to the nearest distance from the first route n to the second obstacle m.


are the difference between the ( 1 − n ) and (1+ n ) path points and the n -th path point.(iii)The safety distance function calculates the distance S between the generated path and the center of each obstacle.The greater the distance, the smaller the function value.The function is shown as follows: number of obstacles.In addition, to prevent invalid paths from being generated, when calculating m n S , there will be a judicial process.If the gener- ated path intersects the obstacle range circle, the algorithm will jump out of the loop and update the current individual.The formulas are shown as follows:

Figure 4 .
Figure 4. Principle diagram of fitness functions design.

Figure 7 .
Figure 7. Global path planning chart of random obstacles simulation.

Figure 8 .
Figure 8.Comparison of the curves of the three algorithms' fitness values.

Figure 9 .
Figure 9. Global path planning chart of trap obstacles simulation I.

Figure 10 .
Figure 10.Comparison of three algorithms' fitness values of simulation I.

Figure 11 .
Figure 11.Global path planning chart of trap obstacles simulation II.

Figure 11 . 23 Figure 12 .
Figure 11.Global path planning chart of trap obstacles simulation II.

Figure 12 .
Figure 12.Comparison of the three algorithms' fitness values of simulation II.

Figure 13 .
Figure 13.Global path planning chart of trap obstacles simulation III.

Figure 14 .
Figure 14.Comparison of the three algorithms' fitness values of simulation III.

Table 1 .
Function Maximum Optimization Test.