Path planning method, electronic device, and computer-readable storage medium
Through the Manta Ray foraging optimization algorithm, the existing path planning algorithm has been solved, and the ability to quickly find the optimal path in an obstacle environment is realized, which is suitable for multi-dimensional environments.
Patent Information
- Application Number
- CN202110514511.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-05-11
- Publication Date
- 2025-01-07
- Estimated Expiration
- 2041-05-11
AI Technical Summary
The existing intelligent path planning algorithm has high computational complexity and slow iteration speed, making it difficult to quickly find the optimal path from the starting point to the target point in an environment with obstacles.
Using the path planning method based on manta ray foraging optimization algorithm, the optimal movement trajectory planning of intelligent mobile bodies from the start point to the end point is realized through the location update of manta ray individuals and the optimal position calculation of the group. It is suitable for low-dimensional and high-dimensional searches. , avoiding individuals falling into local optimal traps.
It reduces the computational complexity, improves iteration speed, and obtains the optimal movement trajectory of the intelligent mobile body, which is suitable for path planning in a multi-dimensional environment.
Smart Images

Figure CN113255871B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of computer technology, and in particular to a path planning method, an electronic device, and a computer-readable storage medium. Background Art
[0002] The path planning problem of mobile robots is a hot topic in the current research direction of robots and is also a basic problem. In the path planning problem, the mobile robot is required to find a collision-free optimal or near-optimal path from the starting point to the target point in a given environment with obstacles based on certain standards (such as the shortest time, the lowest power consumption, or the shortest distance, etc.). The current path planning intelligent algorithm has high computational complexity and slow iteration speed. Summary of the invention
[0003] Embodiments of the present application provide a path planning method, an electronic device, and a computer-readable storage medium.
[0004] In a first aspect, an embodiment of the present application provides a path planning method, including:
[0005] For each manta ray individual in the manta ray population, the t-th generation position of the manta ray individual is calculated using the manta ray foraging method according to the (t-1)-th generation position of the manta ray individual and the (t-1)-th generation optimal position of the population; wherein t is the current iteration number, and the position of the manta ray individual represents a set of second coordinate values of a sequence point on a moving trajectory of the intelligent mobile body from a starting point to an end point;
[0006] According to the t-th generation position of all the manta ray individuals in the manta ray population and the (t
[0007] -1) Optimal position of the generation group Calculate the optimal position of the tth generation group;
[0008] When t is equal to the total number of iterations, the optimal position of the t-th generation group is output as a set of second coordinate values of sequence points on the optimal moving trajectory of the intelligent mobile body from the starting point to the end point.
[0009] In some exemplary embodiments, when t is less than the total number of iterations, the method further comprises:
[0010] Add 1 to t, and continue to execute the step of calculating the t-th generation position of each manta ray individual in the manta ray population according to the (t-1)-th generation position of the manta ray individual and the (t-1)-th generation optimal position of the population using the manta ray foraging method.
[0011] In some exemplary embodiments, after calculating the optimal position of the t-th generation population according to the t-th generation positions of all the manta ray individuals in the manta ray population and the optimal position of the (t-1)-th generation population, the method further comprises:
[0012] For each of the manta ray individuals, a manta ray tumbling foraging method is used to calculate the mirror image position of the t-th generation position of the manta ray individual as the t-th generation position of the new manta ray individual;
[0013] Calculate the optimal position of a new group of the tth generation according to the tth generation positions of all the new manta ray individuals and the optimal position of the tth generation group;
[0014] The step of outputting the optimal position of the t-th generation group as a set of second coordinate values of a sequence point on the optimal moving trajectory of the intelligent moving body from the starting point to the end point comprises:
[0015] The t-th generation new optimal position of the group is output as a set of second coordinate values of sequence points on the optimal moving trajectory of the intelligent mobile body from the starting point to the end point.
[0016] In some exemplary embodiments, when t is less than the total number of iterations, the method further comprises:
[0017] Add 1 to t, add all the new manta ray individuals to the manta ray population, and continue to execute the step of calculating the t-th generation position of each manta ray individual in the manta ray population based on the (t-1)-th generation position of the manta ray individual and the optimal position of the (t-1)-th generation population using the manta ray foraging method.
[0018] In some exemplary embodiments, the step of calculating the mirror image position of the t-generation position of the manta ray individual using the manta ray rolling foraging method as the t-generation position of the new manta ray individual includes:
[0019] According to the formula x' j (t) = x j (t)+S(r1x best (t)-r2x j (t)) calculating the t-th generation position of the j-th new manta ray individual;
[0020] Among them, x' j (t) is the t-generation position of the j-th new manta ray individual, S is the rolling coefficient, r1 is a first random number between 0 and 1, r2 is a second random number between 0 and 1, x j (t) is the t-generation position of the j-th manta ray individual, x best (t) is the optimal position of the t-th generation population.
[0021] In some exemplary embodiments, the calculating the optimal position of the new t-generation group according to the t-generation positions of all the new manta ray individuals and the optimal position of the t-generation group includes:
[0022] For each of the new manta ray individuals, calculating the t-th generation fitness value of the new manta ray individual according to the t-th generation position of the new manta ray individual;
[0023] Calculate the fitness value of the optimal position of the t-th generation population according to the optimal position of the t-th generation population;
[0024] The optimal position of the new t-th generation population is determined as the position corresponding to the minimum fitness value among the t-th generation fitness values of all the new manta ray individuals and the fitness values of the optimal position of the t-th generation population.
[0025] In some exemplary embodiments, the calculating the t-th generation position of the manta ray individual using the manta ray foraging method according to the (t-1)-th generation position of the manta ray individual and the (t-1)-th generation population optimal position includes:
[0026] Generate a third random number r3;
[0027] When the third random number r3 is less than a preset threshold, the t-th generation position of the manta ray individual is calculated using the manta ray spiral foraging method according to the (t-1)-th generation position of the manta ray individual and the optimal position of the (t-1)-th generation population.
[0028] In some exemplary embodiments, the calculating the t-th generation position of the manta ray individual using the manta ray foraging method according to the (t-1)-th generation position of the manta ray individual and the (t-1)-th generation population optimal position includes:
[0029] Generate a third random number r3;
[0030] When the third random number r3 is greater than or equal to a preset threshold, the t-th generation position of the manta ray individual is calculated using the manta ray chain foraging method according to the (t-1)-th generation position of the manta ray individual and the optimal position of the (t-1)-th generation population.
[0031] In a second aspect, an embodiment of the present application provides an electronic device, including:
[0032] at least one processor;
[0033] A memory, wherein at least one program is stored in the memory, and when the at least one program is executed by the at least one processor, the at least one processor implements any one of the above-mentioned path planning methods.
[0034] In a third aspect, an embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, any one of the above-mentioned path planning methods is implemented.
[0035] The path planning method provided in the embodiment of the present application, in each iteration process, only updates the position of individual manta rays using the manta ray foraging method, without updating the speed of individual manta rays, so as to obtain the optimal position of the group, that is, obtain the set of second coordinate values of the sequence points on the optimal moving trajectory of the intelligent mobile body from the starting point to the end point. The calculation complexity is low and the convergence speed is faster. This method is not only applicable to low-dimensional individual search, but also to high-dimensional individual search.
[0036] In some exemplary embodiments, the manta ray rolling foraging method is used to calculate the position of new manta ray individuals, that is, to generate new manta ray individuals, which increases the individual diversity of the manta ray population, narrows the search space, further improves the convergence speed, and also avoids individuals from falling into the local optimal trap. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Figure 1 is a schematic diagram of a moving trajectory taking the first coordinate axis as the vertical axis as an example;
[0038] Figure 2 A flow chart of a path planning method provided by an embodiment of the present application;
[0039] Figure 3 A curve diagram showing the change in fitness value of the optimal position of a group as a function of the number of iterations provided in an embodiment of the present application;
[0040] Figure 4 Schematic diagram of the path planning provided in the embodiment of the present application Figure 1 ;
[0041] Figure 5 Schematic diagram of the path planning provided in the embodiment of the present application Figure 2 ;
[0042] Figure 6 A block diagram of the composition of a path planning device provided in another embodiment of the present application. DETAILED DESCRIPTION
[0043] In order to enable those skilled in the art to better understand the technical solution of the present application, the path planning method, electronic device, and computer-readable storage medium provided by the present application are described in detail below in conjunction with the accompanying drawings.
[0044] Example embodiments will be described more fully below with reference to the accompanying drawings, but the example embodiments may be embodied in different forms and should not be construed as limited to the embodiments set forth herein. On the contrary, the purpose of providing these embodiments is to make this application thorough and complete and to enable those skilled in the art to fully understand the scope of this application.
[0045] In the absence of conflict, the embodiments of the present application and the features therein may be combined with each other.
[0046] As used herein, the term "and / or" includes any and all combinations of at least one of the associated listed items.
[0047] The terms used herein are only used to describe specific embodiments and are not intended to limit the present application. As used herein, the singular forms "a", "an" and "the" are also intended to include the plural forms, unless the context clearly indicates otherwise. It will also be understood that when the terms "comprising" and / or "made of" are used in this specification, the presence of the features, wholes, steps, operations, elements and / or components is specified, but the presence or addition of at least one other feature, whole, step, operation, element, component and / or its group is not excluded.
[0048] Unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by those of ordinary skill in the art. It will also be understood that terms such as those defined in commonly used dictionaries should be interpreted as having a meaning consistent with their meaning in the context of the relevant art and this application, and will not be interpreted as having an idealized or overly formal meaning unless explicitly defined herein.
[0049] The basic idea of current path planning intelligent algorithms is to simulate the behavior of biological groups in nature to construct random optimization algorithms, such as particle swarm algorithm, ant colony algorithm, neural network algorithm, genetic algorithm, firefly algorithm, longhorn beard algorithm, bat algorithm, cuckoo search algorithm, and so on.
[0050] Among them, the particle swarm algorithm needs to update the two variables of individual position and velocity each time during the iteration process. The calculation is relatively complex, and it is only suitable for low-dimensional space search, and the convergence speed is also relatively slow.
[0051] The neural network algorithm is essentially a gradient descent method, and the complexity of the optimized objective function causes the algorithm to converge slowly.
[0052] The firefly algorithm must have excellent individuals within its sensing range to provide it with information, otherwise the individuals will stop searching. The algorithm is too dependent on excellent individuals, which reduces the convergence speed.
[0053] The beetle whisker algorithm is only suitable for searching for optimal solutions in low dimensions and has a slow convergence speed.
[0054] In short, the current path planning intelligent algorithm has high computational complexity and slow iteration speed.
[0055] The embodiment of the present application is based on the Manta Ray Foraging Optimization (MRFO) algorithm for path planning. The Manta Ray Foraging Optimization algorithm is a new intelligent bionic swarm algorithm proposed by Zhao Weiguo et al. in 2019. Manta rays are a large fish in the ocean, second only to whales in size, and often form large groups to forage together. The food of manta rays is usually algae floating in the ocean, which has the characteristics of strong optimization ability and fast convergence. The Manta Ray Foraging Optimization Algorithm imitates the foraging process of manta rays in the ocean, mathematically models different predation strategies, and mathematically describes the way in which individual manta rays update their positions, thereby realizing the search for the optimal solution in a complex space. Due to the uniqueness of the position update method, the solution accuracy and robustness of the Manta Ray Foraging Optimization Algorithm are also significantly improved compared with traditional swarm intelligent bionic algorithms. The Manta Ray Foraging Optimization Algorithm can be described as three foraging behaviors, including chain foraging, spiral foraging, and tumbling foraging.
[0056] Although the path planning method of the embodiment of the present application is proposed based on a mobile robot, the path planning method of the embodiment of the present application is also applicable to other intelligent mobile bodies that require path planning, such as autonomous driving cars, toy cars, etc.
[0057] In the path planning method of the embodiment of the present application, it is assumed that the moving trajectory of the intelligent mobile body is located in a two-dimensional plane, and the obstacles in the moving environment of the intelligent mobile body are stationary.
[0058] like Figure 1 As shown in FIG. 1 , a two-dimensional coordinate system is established for the two-dimensional plane where the moving trajectory of the intelligent mobile body is located. Any point on the plane can be represented by two-dimensional coordinates (x, y). For example, the coordinates of the starting point S0 of the intelligent mobile body are (x0, y0), and the end point S n The coordinates of (x n ,y n ).
[0059] In the path planning method of the embodiment of the present application, the absolute value of the difference between the first coordinate value of the starting point and the first coordinate value of the end point of the intelligent mobile body is divided into n equal parts, where n is an integer greater than or equal to 1, that is, n+1 equal-division lines {l0, l1, ..., l ...1, ..., l1, ..., l1, ..., l1, ..., l1, ..., l1, ..., l1, ..., l1 n}, then the path planning of the intelligent mobile body can be converted into finding a point S on each bisector i, connecting all the points on the bisector is the moving trajectory of the intelligent mobile body, which can be expressed as {S0, S1, ..., S n}, if n is large enough, the moving trajectory is a continuous curve. In other words, the process of path planning is to search for the set of coordinate values of the following sequence of points:
[0060] S={S0,S1,…,S n}={(x0,y0), (x1,y1), (x2,y2),…, (x n ,y n )} (1)
[0061] The coordinate values of the sequence points include a first coordinate value and a second coordinate value. Since each sequence point corresponds to a bisector, the first coordinate value of the sequence point is the first coordinate value of the corresponding bisector. The first coordinate value of the bisector can be calculated based on the first coordinate value of the starting point and the first coordinate value of the end point. The second coordinate value of the sequence point is the coordinate value to be searched. In other words, the path planning process is to search for the set of second coordinate values of the sequence points in formula (1).
[0062] The first coordinate value may be a coordinate value of the horizontal coordinate or a coordinate value of the vertical coordinate, and the first coordinate axis may be a horizontal axis (i.e., an X axis) or a vertical axis (i.e., a Y axis). When the first coordinate value is a coordinate value of the horizontal coordinate, the second coordinate value is a coordinate value of the vertical coordinate, and the first coordinate axis is the vertical axis; when the first coordinate value is a coordinate value of the vertical coordinate, the second coordinate value is a coordinate value of the horizontal coordinate, and the first coordinate axis is the horizontal axis.
[0063] Among them, the absolute value of the difference between the first coordinate values of two adjacent bisectors is equal to one nth of the absolute value of the difference between the first coordinate value of the starting point and the first coordinate value of the end point. Then the first coordinate value of the i-th bisector is: the first coordinate value of the starting point plus the absolute value of the difference between the first coordinate value of the starting point and the first coordinate value of the end point, i is an integer between 0 and n.
[0064] Figure 1 A schematic diagram of the moving trajectory is given in the example of taking the first coordinate axis as the vertical axis. Figure 1 As shown in the figure, the absolute value of the difference between the Y coordinate value of the starting point and the Y coordinate value of the end point of the intelligent mobile body is divided into n equal parts, that is, n+1 equal-division lines {l0, l1, ..., l ...1, ..., l0, l1, ..., l1, ..., l1, ..., l1, ..., l1, ..., l1, ..., l1, n}, then the path planning of the intelligent mobile body can be converted into a set of coordinate values of the X coordinates of the sequence points in the search formula (1).
[0065] Among them, the Y coordinate value of the i-th bisector is i for: Among them, Y n is the Y coordinate value of the end point, Y0 is the Y coordinate value of the starting point, and i is an integer between 0 and n.
[0066] Figure 2 A flowchart of a path planning method provided for one embodiment of the present application.
[0067] First, refer to Figure 2 An embodiment of the present application provides a path planning method, including:
[0068] Step 200: For each manta ray individual in the manta ray population, the t-th generation position of the manta ray individual is calculated using a manta ray foraging method according to the (t-1)-th generation position of the manta ray individual and the optimal position of the (t-1)-th generation population; wherein t is the current iteration number, and the position of the manta ray individual represents a set of second coordinate values of a sequence point on a moving trajectory of the intelligent mobile body from a starting point to an end point.
[0069] In the embodiment of the present application, the t-th generation position of the manta ray individual is a d-dimensional vector, which represents the set of second coordinate values of the sequence points on a moving track of the intelligent mobile body from the starting point to the end point. For example, when the second coordinate value is the coordinate value of the horizontal coordinate, the t-th generation position of the i-th manta ray individual can be expressed as x i (t) = (x i,0 (t),x i,1 (t),x i,2 (t)...x i,n (t)); when the second coordinate value is the coordinate value of the ordinate, the t-generation position of the i-th manta ray individual can be expressed as y i (t)=(y i,0 (t),y i,1 (t),y i,2 (t)...y i,n (t)).
[0070] Among them, d=n+1, n is the dividing parameter for dividing the absolute value of the difference between the first coordinate value of the starting point and the first coordinate value of the end point of the intelligent mobile body, that is, as mentioned above, the absolute value of the difference between the first coordinate value of the starting point and the first coordinate value of the end point of the intelligent mobile body is divided into n equal parts.
[0071] In the embodiment of the present application, t is initialized to 1 before the first iteration.
[0072] In the embodiment of the present application, when t is equal to 1, the (t-1)th generation position of the manta ray individual is the initial value of the position of the manta ray individual, and the (t-1)th generation optimal position of the group is the initial value of the optimal position of the group.
[0073] In some exemplary embodiments, when the second coordinate value is the coordinate value of the abscissa, the initial position value of the i-th manta ray individual is:
[0074] x i (0) = Lb + r4 (Ub - Lb) (2)
[0075] Among them, x i (0) is the initial value of the position of the i-th manta ray individual, Lb is the lower boundary value of the position of the manta ray individual, Ub is the upper boundary value of the position of the manta ray individual, and r4 is a fourth random number between 0 and 1.
[0076] In some exemplary embodiments, when the second coordinate value is the coordinate value of the ordinate, the initial position value of the i-th manta ray individual is:
[0077] y i (0) = Lb + r4 (Ub - Lb) (3)
[0078] Among them, y i (0) is the initial value of the position of the i-th manta ray individual, Lb is the lower boundary value of the position of the manta ray individual, Ub is the upper boundary value of the position of the manta ray individual, and r4 is a fourth random number between 0 and 1.
[0079] Among them, Lb and Ub are both d-dimensional vectors, each element in Lb is the minimum value of the second coordinate value, that is, the minimum value of the second coordinate value of the starting point and the second coordinate value of the end point, and each element in Ub is the maximum value of the second coordinate value, that is, the maximum value of the second coordinate value of the starting point and the second coordinate value of the end point.
[0080] In the embodiment of the present application, the purpose of path planning is to find an optimal moving trajectory that does not collide with obstacles, has the shortest path, and does not have sharp turns. Based on this purpose, a fitness function is constructed, such as the following formulas (4) and (5). The constructed fitness function should satisfy the requirement that the smaller the fitness function value, the better the moving trajectory.
[0081] In some exemplary embodiments, the optimal initial position value of the group is calculated based on the initial position values of all manta ray individuals. Specifically, the initial fitness value of each manta ray individual is calculated respectively, and the optimal initial position value of the group is determined to be the initial position value of the manta ray individual with the smallest initial fitness value.
[0082] In some exemplary embodiments, when the second coordinate value is the coordinate value of the horizontal coordinate, the initial value of the fitness of the i-th manta ray individual is calculated according to formula (4).
[0083] F(x i (0)) = k1 × L (x i (0))+k2×Ψ(xi (0))+P(x i (0)) (4)
[0084] Among them, F(x i (0)) is the initial fitness value of the i-th manta ray individual, L(x i (0)) is the distance of the moving trajectory represented by the initial position value of the i-th manta ray individual, Ψ(x i (0)) is the sum of all angles of the moving trajectory represented by the initial position value of the i-th manta ray individual, P(x i (0)) is the penalty function value of the moving trajectory represented by the initial position value of the i-th manta ray individual, k1+k2=1, k1, k2 are adjustment factors.
[0085] In some exemplary embodiments, when the second coordinate value is the coordinate value of the ordinate, the initial value of the fitness of the i-th manta ray individual is calculated according to formula (5).
[0086] F(y i (0)) = k1 × L (y i (0))+k2×Ψ(y i (0))+P(y i (0)) (5)
[0087] Among them, F(y i (0)) is the initial fitness value of the i-th manta ray individual, L(y i (0)) is the distance of the moving trajectory represented by the initial position value of the i-th manta ray individual, Ψ(y i (0)) is the sum of all angles of the moving trajectory represented by the initial position value of the i-th manta ray individual, P(y i (0)) is the penalty function value of the moving trajectory represented by the initial position value of the i-th manta ray individual, k1+k2=1, k1, k2 are adjustment factors.
[0088] The following uses the second coordinate value as the coordinate value of the horizontal coordinate as an example to illustrate L(x i (0)),Ψ(x i (0)), P(x i (0)) calculation method, when the second coordinate value is the coordinate value of the ordinate, L(y i (0)),Ψ(y i (0)), P(y i The calculation method of (0)) is similar to the case where the second coordinate value is the coordinate value of the horizontal coordinate, and will not be repeated here.
[0089] (1)L(x i (0)) Calculation method
[0090] According to formula (6), L(x i (0)).
[0091]
[0092] Among them, x i,k+1 (0) is the (k+1)th dimension value of the initial position of the i-th manta ray individual, x i,k (0) is the k-th dimension value of the initial position value of the i-th manta ray individual, D is the difference between the first coordinate values of two adjacent sequence points on the moving trajectory represented by the initial position value of the i-th manta ray individual, and the specific value is the ratio of the difference between the first coordinate value of the end point and the first coordinate value of the starting point of the intelligent mobile body and n.
[0093] (2)Ψ(x i (0)) Calculation method
[0094] Since there is no sharp turn in the moving trajectory, according to the principle of kinematics, the larger the angle between three adjacent points of the moving trajectory of the intelligent moving body, the smoother the moving trajectory composed of the three adjacent points. Therefore, the larger the sum of the angles between the three adjacent points, the better the moving trajectory. In order to satisfy the smaller the fitness function value, the better the moving trajectory, the constructed fitness function should take the sum of the supplementary angles of the angles between the three adjacent points, as shown in formula (7).
[0095] That is, Ψ(x i (0)).
[0096]
[0097] in, is the distance between the (k-1)th sequence point and the (k+1)th sequence point on the moving trajectory represented by the initial position value of the i-th manta ray individual, is the distance between the (k-1)th sequence point and the kth sequence point on the moving trajectory represented by the initial position value of the i-th manta ray individual, is the distance between the kth sequence point and the (k+1)th sequence point on the moving trajectory represented by the initial position value of the i-th manta ray individual.
[0098] (3)P(x i (0)) Calculation method
[0099] In order to satisfy the requirement that the smaller the fitness function value, the better the moving trajectory, the moving trajectory that collides with obstacles is penalized, thereby constructing a penalty function. Specifically, P(x i(0)), as shown in formula (8).
[0100] P(x i (0)) = G × M (0) (8)
[0101] Where G is the penalty factor, G>0, and M(0) is the number of times all sequence points on the moving trajectory represented by the initial position value of the i-th manta ray individual intersect with all obstacles.
[0102] Among them, M can be calculated in the following way:
[0103] Calculate the distance between the kth sequence point and the center of mass of the mth obstacle;
[0104] When the distance between the kth sequence point and the centroid of the mth obstacle is less than or equal to the contour radius of the mth obstacle, N is increased by 1;
[0105] When the distance between the kth sequence point and the center of mass of the mth obstacle is greater than the contour radius of the mth obstacle, m is increased by 1, and the step of calculating the distance between the kth sequence point and the center of mass of the mth obstacle is continued;
[0106] When all obstacles are calculated, m is replaced by 1, k is increased by 1, and the step of calculating the distance between the kth sequence point and the center of mass of the mth obstacle is continued until all sequence points are calculated.
[0107] The distance between the kth sequence point and the center of mass of the mth obstacle is calculated according to formula (9).
[0108]
[0109] Among them, d i,k,m (0) is the distance between the kth sequence point and the center of mass of the mth obstacle, x i,k (0) is the k-th dimension value of the initial position of the i-th manta ray individual, xobs m is the coordinate value of the horizontal coordinate of the center of mass of the mth obstacle, y i,k (0) is the coordinate value of the ordinate of the kth sequence point on the moving trajectory represented by the initial position value of the i-th manta ray individual, yobs m is the coordinate value of the ordinate of the center of mass of the mth obstacle.
[0110] The contour radius of the mth obstacle is the radius of the minimum circumscribed circle of the mth obstacle.
[0111] In some exemplary embodiments, the calculating the t-th generation position of the manta ray individual using the manta ray foraging method according to the (t-1)-th generation position of the manta ray individual and the (t-1)-th generation population optimal position includes:
[0112] Generate a third random number r3;
[0113] When the third random number r3 is less than a preset threshold, the t-th generation position of the manta ray individual is calculated using the manta ray spiral foraging method according to the (t-1)-th generation position of the manta ray individual and the optimal position of the (t-1)-th generation population.
[0114] In some exemplary embodiments, the third random number r3 is a random number between 0 and 1.
[0115] The embodiment of the present application does not limit the preset threshold value. For example, the preset threshold value may be 0.5.
[0116] The following takes the coordinate value of the second coordinate value as the horizontal coordinate as an example to illustrate the position update of the manta ray individual. The position update of the manta ray individual in the case where the second coordinate value is the coordinate value of the vertical coordinate is similar to the case where the second coordinate value is the coordinate value of the horizontal coordinate, which will not be repeated here.
[0117] In some exemplary embodiments, according to the (t-1)th generation position of the manta ray individual and the (t-1)th generation population optimal position, calculating the t-th generation position of the manta ray individual using the manta ray spiral foraging method includes:
[0118] When the ratio of (t-1) to the total number of iterations T is greater than the third random number r3, the t-th generation position of the i-th manta ray individual is calculated according to formula (10).
[0119]
[0120] Among them, x i (t) is the t-generation position of the i-th manta ray individual, x best (t-1) is the optimal position of the (t-1) generation population, r5 is the fifth random number between 0 and 1, x i (t-1) is the (t-1)th generation position of the ith manta ray individual, is the weight coefficient, r6 is the sixth random number between 0 and 1, T is the total number of iterations, x i-1 (t-1) is the (t-1)th generation position of the (i-1)th manta ray individual.
[0121] In some exemplary embodiments, according to the (t-1)th generation position of the manta ray individual and the (t-1)th generation population optimal position, calculating the t-th generation position of the manta ray individual using the manta ray spiral foraging method includes:
[0122] When the ratio of (t-1) to the total number of iterations T is less than or equal to the third random number r3, the t-th generation position of the i-th manta ray individual is calculated according to formula (11).
[0123]
[0124] Among them, x i (t) is the t-generation position of the i-th manta ray individual, x rand (t-1)=Lb+r7(Ub-Lb), r7 is the seventh random number between 0 and 1, r5 is the fifth random number between 0 and 1, x i (t-1) is the (t-1)th generation position of the ith manta ray individual, is the weight coefficient, r6 is the sixth random number between 0 and 1, T is the total number of iterations, x i-1 (t-1) is the (t-1)th generation position of the (i-1)th manta ray individual.
[0125] In some exemplary embodiments, the calculating the t-th generation position of the manta ray individual using the manta ray foraging method according to the (t-1)-th generation position of the manta ray individual and the (t-1)-th generation population optimal position includes:
[0126] Generate a third random number r3;
[0127] When the third random number r3 is greater than or equal to a preset threshold, the t-th generation position of the manta ray individual is calculated using the manta ray chain foraging method according to the (t-1)-th generation position of the manta ray individual and the optimal position of the (t-1)-th generation population.
[0128] In some exemplary embodiments, according to the (t-1)th generation position of the manta ray individual and the (t-1)th generation population optimal position, calculating the t-th generation position of the manta ray individual using the manta ray chain foraging method includes:
[0129] Calculate the t-th generation position of the i-th manta ray individual according to formula (12).
[0130]
[0131] Among them, x i (t) is the t-generation position of the i-th manta ray individual, x best (t-1) is the optimal position of the (t-1) generation population, r5 is the fifth random number between 0 and 1, x i (t-1) is the (t-1)th generation position of the ith manta ray individual, is the weight coefficient, r8 is the eighth random number between 0 and 1, T is the total number of iterations, x i-1 (t-1) is the (t-1)th generation position of the (i-1)th manta ray individual.
[0132] Step 201: Calculate the optimal position of the t-th generation population based on the t-th generation positions of all the manta ray individuals in the manta ray population and the optimal position of the (t-1)-th generation population.
[0133] In some exemplary embodiments, calculating the optimal position of the t-th generation population according to the t-th generation positions of all the manta ray individuals in the manta ray population and the optimal position of the (t-1)-th generation population includes:
[0134] Calculate the fitness value of each manta ray individual in the tth generation;
[0135] Calculate the fitness value of the optimal position of the (t-1)th generation population;
[0136] The optimal position of the t-th generation population is determined as the position corresponding to the minimum fitness value among the fitness values of the t-th generation of all manta ray individuals and the fitness values of the optimal position of the (t-1)-th generation population.
[0137] When the fitness value of a certain manta ray individual in the t-th generation is the smallest, the position corresponding to the minimum fitness value is the t-th generation position of the manta ray individual; when the fitness value of the optimal position of the (t-1)-th generation group is the smallest, the position corresponding to the minimum fitness value is the optimal position of the (t-1)-th generation group.
[0138] In some exemplary embodiments, when the second coordinate value is the coordinate value of the horizontal coordinate, the fitness value of the t-th generation of the i-th manta ray individual is calculated according to formula (13).
[0139] F(x i (t)) = k1 × L (x i (t))+k2×Ψ(x i (t))+P(x i (t)) (13)
[0140] Among them, F(x i (t)) is the fitness value of the tth generation of the i-th manta ray individual, L(x i (t)) is the distance of the moving trajectory represented by the t-generation position of the i-th manta ray individual, Ψ(x i (t)) is the sum of all angles of the moving trajectory represented by the t-generation position of the i-th manta ray individual, P(x i (t)) is the penalty function value of the movement trajectory represented by the t-th generation position of the ith manta ray individual, k1+k2=1, k1, k2 are adjustment factors.
[0141] In some exemplary embodiments, when the second coordinate value is the coordinate value of the ordinate, the fitness value of the tth generation of the i-th manta ray individual is calculated according to formula (14);
[0142] F(yi (t)) = k1 × L (y i (t))+k2×Ψ(y i (t))+P(y i (t)) (14)
[0143] Among them, F(y i (t)) is the fitness value of the tth generation of the i-th manta ray individual, L(y i (t)) is the distance of the moving trajectory represented by the position of the t-generation of the i-th manta ray individual, Ψ(y i (t)) is the sum of all angles of the moving trajectory represented by the t-generation position of the i-th manta ray individual, P(y i (t)) is the penalty function value of the movement trajectory represented by the t-th generation position of the ith manta ray individual, k1+k2=1, k1, k2 are adjustment factors.
[0144] The following example uses the second coordinate value as the coordinate value of the horizontal coordinate to explain L(x i (t)),Ψ(x i (t)), P(x i (t)) calculation method, when the second coordinate value is the coordinate value of the ordinate, L(y i (t)),Ψ(y i (t)), P(y i The calculation method of (t)) is similar to the case where the second coordinate value is the coordinate value of the horizontal coordinate, and will not be repeated here.
[0145] (1)L(x i Calculation method of (t)
[0146] According to formula (15), L(x i (t)).
[0147]
[0148] Among them, x i,k+1 (t) is the value of the (k+1)th dimension of the t-generation position of the i-th manta ray individual, x i,k (t) is the k-th dimension value of the t-th generation position of the i-th manta ray individual, D is the difference between the first coordinate values of two adjacent sequence points on the moving trajectory represented by the t-th generation position of the i-th manta ray individual, and the specific value is the ratio of the difference between the first coordinate value of the end point and the first coordinate value of the starting point of the intelligent mobile body and n.
[0149] (2)Ψ(x i Calculation method of (t)
[0150] Since there is no sharp turn in the moving trajectory, according to the principle of kinematics, the larger the angle between three adjacent points of the moving trajectory of the intelligent moving body, the smoother the moving trajectory composed of the three adjacent points. Therefore, the larger the sum of the angles between the three adjacent points, the better the moving trajectory. In order to satisfy the smaller the fitness function value, the better the moving trajectory, the constructed fitness function should take the sum of the supplementary angles of the angles between the three adjacent points, as shown in formula (16).
[0151] That is, Ψ(x i (t)).
[0152]
[0153] in, is the distance between the (k-1)th sequence point and the (k+1)th sequence point on the movement trajectory represented by the t-th generation position of the i-th manta ray individual, is the distance between the (k-1)th sequence point and the kth sequence point on the movement trajectory represented by the tth generation position of the i-th manta ray individual, is the distance between the kth sequence point and the (k+1)th sequence point on the movement trajectory represented by the tth generation position of the i-th manta ray individual.
[0154] (3)P(x i Calculation method of (t)
[0155] In order to satisfy the requirement that the smaller the fitness function value, the better the moving trajectory, the moving trajectory that collides with obstacles is penalized, thereby constructing a penalty function. Specifically, P(x i (t)), as shown in formula (17).
[0156] P(x i (t)) = G × M (t) (17)
[0157] Where G is the penalty factor, G>0, and M(t) is the number of times all sequence points on the moving trajectory represented by the t-generation position of the i-th manta ray individual intersect with all obstacles.
[0158] Among them, M can be calculated in the following way:
[0159] Calculate the distance between the kth sequence point and the center of mass of the mth obstacle;
[0160] When the distance between the kth sequence point and the centroid of the mth obstacle is less than or equal to the contour radius of the mth obstacle, N is increased by 1;
[0161] When the distance between the kth sequence point and the center of mass of the mth obstacle is greater than the contour radius of the mth obstacle, m is increased by 1, and the step of calculating the distance between the kth sequence point and the center of mass of the mth obstacle is continued;
[0162] When all obstacles are calculated, m is replaced by 1, k is increased by 1, and the step of calculating the distance between the kth sequence point and the center of mass of the mth obstacle is continued until all sequence points are calculated.
[0163] The distance between the kth sequence point and the center of mass of the mth obstacle is calculated according to formula (18).
[0164]
[0165] Among them, d i,k,m (t) is the distance between the kth sequence point and the center of mass of the mth obstacle, x i,k (t) is the k-th dimension value of the t-th generation position of the i-th manta ray individual, xobs m is the coordinate value of the horizontal coordinate of the center of mass of the mth obstacle, y i,k (t) is the coordinate value of the ordinate of the kth sequence point on the movement trajectory represented by the tth generation position of the i-th manta ray individual, yobs m is the coordinate value of the ordinate of the center of mass of the mth obstacle.
[0166] The contour radius of the mth obstacle is the radius of the minimum circumscribed circle of the mth obstacle.
[0167] In the embodiment of the present application, the calculation method of the fitness value of the optimal position of the (t-1)th generation group is similar to the calculation method of the fitness value of the tth generation of manta ray individuals. It is only necessary to replace x in formula (13) to formula (18) i (t) is replaced by x best (t-1), x best (t-1) is the optimal position of the (t-1)th generation population.
[0168] Step 202: When t is equal to the total number of iterations, the optimal position of the t-th generation group is output as a set of second coordinate values of sequence points on the optimal moving trajectory of the intelligent mobile body from the starting point to the end point.
[0169] In some exemplary embodiments, when t is less than the total number of iterations, t is increased by 1, and the step of calculating the t-th generation position of each manta ray individual in the manta ray population by using the manta ray foraging method according to the (t-1)-th generation position of the manta ray individual and the optimal position of the (t-1)-th generation population is continued.
[0170] The path planning method provided in the embodiment of the present application, in each iteration process, only updates the position of individual manta rays using the manta ray foraging method, without updating the speed of individual manta rays, so as to obtain the optimal position of the group, that is, obtain the set of second coordinate values of the sequence points on the optimal moving trajectory of the intelligent mobile body from the starting point to the end point. The calculation complexity is low and the convergence speed is faster. This method is not only applicable to low-dimensional individual search, but also to high-dimensional individual search.
[0171] In some exemplary embodiments, after calculating the optimal position of the t-th generation population according to the t-th generation positions of all the manta ray individuals in the manta ray population and the optimal position of the (t-1)-th generation population, the method further comprises:
[0172] For each of the manta ray individuals, a manta ray tumbling foraging method is used to calculate the mirror image position of the t-th generation position of the manta ray individual as the t-th generation position of the new manta ray individual;
[0173] Calculate the optimal position of a new group of the tth generation according to the tth generation positions of all the new manta ray individuals and the optimal position of the tth generation group;
[0174] The step of outputting the optimal position of the t-th generation group as a set of second coordinate values of a sequence point on the optimal moving trajectory of the intelligent moving body from the starting point to the end point comprises:
[0175] The t-th generation new optimal position of the group is output as a set of second coordinate values of sequence points on the optimal moving trajectory of the intelligent mobile body from the starting point to the end point.
[0176] In some exemplary embodiments, when t is less than the total number of iterations, t is increased by 1, all the new manta ray individuals are added to the manta ray population, and the step of calculating the t-th generation position of each manta ray individual in the manta ray population by using the manta ray foraging method based on the (t-1)-th generation position of the manta ray individual and the optimal position of the (t-1)-th generation population is continued.
[0177] In some exemplary embodiments, the step of calculating the mirror image position of the t-generation position of the manta ray individual as the t-generation position of the new manta ray individual using the manta ray tumbling foraging method comprises:
[0178] According to the formula x' j (t) = x j (t)+S(r1x best (t)-r2x j (t)) calculating the t-th generation position of the j-th new manta ray individual;
[0179] Among them, x' j(t) is the t-generation position of the j-th new manta ray individual, S is the rolling coefficient, r1 is a first random number between 0 and 1, r2 is a second random number between 0 and 1, x j (t) is the t-generation position of the j-th manta ray individual, x best (t) is the optimal position of the t-th generation population.
[0180] In some exemplary embodiments, the calculating the optimal position of the new t-generation group according to the t-generation positions of all the new manta ray individuals and the optimal position of the t-generation group includes:
[0181] For each of the new manta ray individuals, calculating the t-th generation fitness value of the new manta ray individual according to the t-th generation position of the new manta ray individual;
[0182] Calculate the fitness value of the optimal position of the t-th generation population according to the optimal position of the t-th generation population;
[0183] The optimal position of the new t-th generation population is determined as the position corresponding to the minimum fitness value among the t-th generation fitness values of all the new manta ray individuals and the fitness values of the optimal position of the t-th generation population.
[0184] When the fitness value of a new manta ray individual in the t-th generation is the smallest, the position corresponding to the minimum fitness value is the t-th generation position of the new manta ray individual; when the fitness value of the optimal position of the t-th generation group is the smallest, the position corresponding to the minimum fitness value is the optimal position of the t-th generation group.
[0185] In the embodiment of the present application, the calculation method of the fitness value of the t-th generation of the new manta ray individual is similar to the calculation method of the fitness value of the t-th generation of the manta ray individual, and only xi(t) in formula (13) to formula (18) needs to be replaced by x' j (t) is enough, x' j (t) is the t-th generation position of the j-th new manta ray individual.
[0186] In the embodiment of the present application, the calculation method of the fitness value of the optimal position of the t-th generation group is similar to the calculation method of the fitness value of the t-th generation manta ray individual, and only the x in formula (13) to formula (18) needs to be replaced by i (t) is replaced by x best (t) is enough, x best (t) is the optimal position of the t-th generation population.
[0187] In some exemplary embodiments, the manta ray rolling foraging method is used to calculate the position of new manta ray individuals, that is, to generate new manta ray individuals, which increases the individual diversity of the manta ray population, narrows the search space, further improves the convergence speed, and also avoids individuals from falling into the local optimal trap.
[0188] Figure 3 The following is a curve diagram showing the change of the fitness value of the optimal position of the group with the number of iterations provided in the embodiment of the present application. Figure 3 As shown in the figure, with the increase of the number of iterations, the fitness value of the optimal position of the group gradually decreases, and remains unchanged after decreasing to a certain value. When the fitness value of the optimal position of the group remains unchanged, the movement trajectory represented by the optimal position of the group of the number of iterations is the optimal movement trajectory.
[0189] Figure 4 and Figure 5 Two schematic diagrams of path planning are given. Figure 4 and Figure 5 As shown, the final moving trajectories do not intersect with obstacles. The calculation complexity is low and the convergence speed is faster. This method is not only applicable to low-dimensional individual searches, but also to high-dimensional individual searches. It also avoids individuals falling into the local optimal trap.
[0190] In a second aspect, an embodiment of the present application provides an electronic device, comprising:
[0191] at least one processor;
[0192] A memory, wherein at least one program is stored in the memory, and when the at least one program is executed by at least one processor, the at least one processor implements any one of the above-mentioned path planning methods.
[0193] Among them, the processor is a device with data processing capabilities, including but not limited to a central processing unit (CPU), etc.; the memory is a device with data storage capabilities, including but not limited to random access memory (RAM, more specifically SDRAM, DDR, etc.), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), and flash memory (FLASH).
[0194] In some embodiments, the processor and the memory are connected to each other through a bus, and further connected to other components of the computing device.
[0195] In a third aspect, an embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, any one of the above-mentioned path planning methods is implemented.
[0196] Figure 6 A block diagram of the composition of a path planning device provided in another embodiment of the present application.
[0197] Fourthly, refer to Figure 6 Another embodiment of the present application provides a path planning device, including:
[0198] The position updating module 601 is used to calculate the t-th generation position of each manta ray individual in the manta ray population according to the (t-1)-th generation position of the manta ray individual and the (t-1)-th generation optimal position of the population, using the manta ray foraging method; wherein t is the current iteration number, and the position of the manta ray individual represents a set of second coordinate values of a sequence point on a moving trajectory of the intelligent mobile body from a starting point to an end point;
[0199] The optimal position calculation module 602 is used to calculate the optimal position of the t-th generation group according to the t-th generation positions of all the manta ray individuals in the manta ray population and the optimal position of the (t-1)-th generation group;
[0200] The output module 603 is used to output the optimal position of the t-th generation group as a set of second coordinate values of the sequence points on the optimal moving trajectory of the intelligent moving body from the starting point to the end point when t is equal to the total number of iterations.
[0201] In some exemplary embodiments, the location updating module 601 is further configured to:
[0202] When t is less than the total number of iterations, t is increased by 1, and the step of calculating the t-th generation position of each manta ray individual in the manta ray population by using the manta ray foraging method according to the (t-1)-th generation position of the manta ray individual and the optimal position of the (t-1)-th generation population is continued.
[0203] In some exemplary embodiments, the invention further comprises:
[0204] A new individual generation module 604 is used for calculating, for each manta ray individual, a mirror image position of the t-th generation position of the manta ray individual using a manta ray rolling foraging method as a t-th generation position of a new manta ray individual;
[0205] The group optimal position calculation module 602 is further used to: calculate the t-th generation new group optimal position according to the t-th generation positions of all the new manta ray individuals and the t-th generation group optimal position;
[0206] The output module 603 is specifically used for:
[0207] When t is equal to the total number of iterations, the t-th generation new optimal position of the group is output as a set of second coordinate values of sequence points on the optimal moving trajectory of the intelligent mobile body from the starting point to the end point.
[0208] In some exemplary embodiments, the location updating module 601 is further configured to:
[0209] When t is less than the total number of iterations, t is increased by 1, all the new manta ray individuals are added to the manta ray population, and the step of calculating the t-th generation position of each manta ray individual in the manta ray population by using the manta ray foraging method according to the (t-1)-th generation position of the manta ray individual and the optimal position of the (t-1)-th generation population is continued.
[0210] In some exemplary embodiments, the new individual generation module 604 is specifically used to:
[0211] According to the formula x' j (t) = x j (t)+S(r1x best (t)-r2x j (t)) calculating the t-th generation position of the j-th new manta ray individual;
[0212] Among them, x' j (t) is the t-generation position of the j-th new manta ray individual, S is the rolling coefficient, r1 is a first random number between 0 and 1, r2 is a second random number between 0 and 1, x j (t) is the t-generation position of the j-th manta ray individual, x best (t) is the optimal position of the t-th generation population.
[0213] In some exemplary embodiments, the group optimal position calculation module 602 is specifically used to implement the calculation of the t-generation new group optimal position according to the t-generation positions of all the new manta ray individuals and the t-generation group optimal position in the following manner:
[0214] For each of the new manta ray individuals, calculating the t-th generation fitness value of the new manta ray individual according to the t-th generation position of the new manta ray individual;
[0215] Calculate the fitness value of the optimal position of the t-th generation population according to the optimal position of the t-th generation population;
[0216] The optimal position of the new t-th generation population is determined as the position corresponding to the minimum fitness value among the t-th generation fitness values of all the new manta ray individuals and the fitness values of the optimal position of the t-th generation population.
[0217] In some exemplary embodiments, the position updating module 601 is specifically used to implement the calculation of the t-th generation position of the manta ray individual using the manta ray foraging method according to the (t-1)-th generation position of the manta ray individual and the (t-1)-th generation population optimal position in the following manner:
[0218] Generate a third random number r3;
[0219] When the third random number r3 is less than a preset threshold, the t-th generation position of the manta ray individual is calculated using the manta ray spiral foraging method according to the (t-1)-th generation position of the manta ray individual and the optimal position of the (t-1)-th generation population.
[0220] In some exemplary embodiments, the position updating module 601 is specifically used to implement the calculation of the t-th generation position of the manta ray individual using the manta ray foraging method according to the (t-1)-th generation position of the manta ray individual and the (t-1)-th generation population optimal position in the following manner:
[0221] Generate a third random number r3;
[0222] When the third random number r3 is greater than or equal to a preset threshold, the t-th generation position of the manta ray individual is calculated using the manta ray chain foraging method according to the (t-1)-th generation position of the manta ray individual and the optimal position of the (t-1)-th generation population.
[0223] The specific implementation process of the path planning device in the embodiment of the present application is the same as the specific implementation process of the path planning method in the aforementioned embodiment, and will not be repeated here.
[0224] It will be appreciated by those skilled in the art that all or some of the steps, systems, and functional modules / units in the methods disclosed above may be implemented as software, firmware, hardware, and appropriate combinations thereof. In hardware implementations, the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed by several physical components in cooperation. Some or all physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor, or a microprocessor, or implemented as hardware, or implemented as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or non-transitory medium) and a communication medium (or temporary medium). As known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage, or any other medium that can be used to store the desired information and can be accessed by a computer. In addition, it is well known to those skilled in the art that communication media typically contain computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.
[0225] Example embodiments have been disclosed herein, and although specific terms are employed, they are used and should be interpreted only in a general illustrative sense and not for limiting purposes. In some instances, it will be apparent to those skilled in the art that, unless otherwise expressly noted, features, characteristics, and / or elements described in conjunction with a particular embodiment may be used alone or in combination with features, characteristics, and / or elements described in conjunction with other embodiments. Therefore, those skilled in the art will appreciate that various changes in form and detail may be made without departing from the scope of the present application as set forth in the appended claims.
Claims
1. A path planning method, comprising: S1. For each manta ray individual in the manta ray population, the manta ray foraging method is used to calculate the t-th generation position of the manta ray individual according to the (t-1)-th generation position of the manta ray individual and the optimal position of the (t-1)-th generation population; wherein t is the current iteration number, and the position of the manta ray individual represents a set of second coordinate values of a sequence point on a moving trajectory of an intelligent mobile body from a starting point to an end point; the second coordinate value of the sequence point is the coordinate value to be searched, and the second coordinate value includes the coordinate value of the abscissa or the coordinate value of the ordinate of the sequence point of the moving trajectory; When t is equal to 1, the (t-1)th generation position of the manta ray individual is the initial value of the position of the manta ray individual, and the (t-1)th generation group optimal position is the initial value of the group optimal position; Among them, the initial value of the position of the i-th manta ray individual is calculated by the formula x i (0) = Lb + r4 (Ub - Lb) is determined, where x i (0) is the initial position value of the i-th manta ray individual, Lb is the lower boundary value of the position of the manta ray individual, Ub is the upper boundary value of the position of the manta ray individual, and r4 is a fourth random number between 0 and 1; wherein the optimal initial position value of the group is the initial position value of the manta ray individual with the smallest initial fitness value; Among them, the initial fitness value of the i-th manta ray individual is calculated according to the formula F(x i (0)) = k1 × L (x i (0))+k2×Ψ(x i (0))+P(x i (0)) is calculated; F(x i (0)) is the initial fitness value of the i-th manta ray individual, L(x i (0)) is the distance of the moving trajectory represented by the initial position value of the i-th manta ray individual, Ψ(x i (0)) is the sum of all angles of the moving trajectory represented by the initial position value of the i-th manta ray individual, P(x i (0)) is the penalty function value of the movement trajectory represented by the initial position value of the i-th manta ray individual, P(x i (0)) = G × M (0), G is the penalty factor, G>0, M (0) is the number of times all sequence points on the moving trajectory represented by the initial position value of the i-th manta ray individual intersect with all obstacles, k1 + k2 = 1, k1, k2 are adjustment factors; Wherein, the calculating the t-th generation position of the manta ray individual by using the manta ray foraging method according to the (t-1)-th generation position of the manta ray individual and the (t-1)-th generation population optimal position includes: Generate a third random number r3; When the third random number r3 is less than a preset threshold, the t-th generation position of the manta ray individual is calculated using the manta ray spiral foraging method according to the (t-1)-th generation position of the manta ray individual and the (t-1)-th generation population optimal position; When the third random number r3 is greater than or equal to a preset threshold, the t-th generation position of the manta ray individual is calculated using the manta ray chain foraging method according to the (t-1)-th generation position of the manta ray individual and the (t-1)-th generation population optimal position; S2. Calculating the optimal position of the t-th generation population according to the t-th generation positions of all the manta ray individuals in the manta ray population and the optimal position of the (t-1)-th generation population, including: Calculating the t-generation fitness values of all the manta ray individuals according to the t-generation positions of all the manta ray individuals; Calculate the fitness value of the optimal position of the (t-1)th generation population according to the optimal position of the (t-1)th generation population; Determine the optimal position of the t-th generation population as the position corresponding to the minimum fitness value between the t-th generation fitness values of all the manta ray individuals and the fitness values of the optimal position of the (t-1)-th generation population; Among them, the fitness value of the tth generation of the i-th manta ray individual is calculated according to the formula F(x i (t)) = k1 × L (x i (t))+k2×Ψ(x i (t))+P(x i (t)) is calculated; F(x i (t)) is the fitness value of the tth generation of the i-th manta ray individual, L(x i (t)) is the distance of the moving trajectory represented by the t-generation position of the i-th manta ray individual, Ψ(x i (t)) is the sum of all angles of the moving trajectory represented by the t-generation position of the i-th manta ray individual, P(x i (t)) is the penalty function value of the movement trajectory represented by the t-generation position of the i-th manta ray individual, P(x i (t)) = G × M (t), G is the penalty factor, G>0, M (t) is the number of times all sequence points on the moving trajectory represented by the t-generation position of the i-th manta ray individual intersect with all obstacles, k1 + k2 = 1, k1 and k2 are adjustment factors; The fitness value of the optimal position of the (t-1)th generation population is calculated in a similar way to the fitness value of the tth generation manta ray individual mentioned above, except that x in the formula is i (t) is replaced by x best (t-1), x best (t-1) is the optimal position of the (t-1) generation population; S3. When t is equal to the total number of iterations, output the optimal position of the t-th generation group as a set of second coordinate values of the sequence points on the optimal moving trajectory of the intelligent mobile body from the starting point to the end point.
2. The path planning method according to claim 1, when t is less than the total number of iterations, the method further comprises: Add 1 to t, and continue to execute the step of calculating the t-th generation position of each manta ray individual in the manta ray population according to the (t-1)-th generation position of the manta ray individual and the (t-1)-th generation optimal position of the population using the manta ray foraging method.
3. The path planning method according to claim 1, after calculating the optimal position of the t-th generation group according to the t-th generation positions of all the manta ray individuals in the manta ray population and the optimal position of the (t-1)-th generation group, the method further comprises: For each manta ray individual, the mirror position of the t-generation position of the manta ray individual is calculated using the manta ray rolling foraging method as the t-generation position of the new manta ray individual, including: according to the formula x' j (t) = x j (t)+S(r1x best (t)-r2x j (t)) calculate the t-generation position of the j-th new manta ray individual; where x' j (t) is the t-generation position of the j-th new manta ray individual, S is the rolling coefficient, r1 is a first random number between 0 and 1, r2 is a second random number between 0 and 1, x j (t) is the t-generation position of the j-th manta ray individual, x best (t) is the optimal position of the t-th generation population; Calculating the optimal position of a new t-generation group according to the t-generation positions of all the new manta ray individuals and the optimal position of the t-generation group, comprising: for each of the new manta ray individuals, calculating the t-generation fitness value of the new manta ray individual according to the t-generation position of the new manta ray individual; calculating the fitness value of the optimal position of the t-generation group according to the optimal position of the t-generation group; determining the optimal position of the new t-generation group as the position corresponding to the minimum fitness value between the t-generation fitness values of all the new manta ray individuals and the fitness value of the optimal position of the t-generation group; Afterwards, outputting the optimal position of the t-th generation group as a set of second coordinate values of the sequence points on the optimal moving trajectory of the intelligent mobile body from the starting point to the end point includes: outputting the optimal position of the new t-th generation group as a set of second coordinate values of the sequence points on the optimal moving trajectory of the intelligent mobile body from the starting point to the end point.
4. The path planning method according to claim 3, when t is less than the total number of iterations, the method further comprises: Add 1 to t, add all the new manta ray individuals to the manta ray population, and continue to execute the step of calculating the t-th generation position of each manta ray individual in the manta ray population based on the (t-1)-th generation position of the manta ray individual and the optimal position of the (t-1)-th generation population using the manta ray foraging method.
5. The path planning method according to claim 1 or 2, wherein: The step of calculating the t-th generation position of the manta ray individual using the manta ray foraging method according to the (t-1)-th generation position of the manta ray individual and the (t-1)-th generation population optimal position comprises: Generate a third random number r3; When the third random number r3 is less than a preset threshold, the t-th generation position of the manta ray individual is calculated using the manta ray spiral foraging method according to the (t-1)-th generation position of the manta ray individual and the (t-1)-th generation population optimal position; The method of calculating the t-th generation position of the manta ray individual by using the manta ray spiral foraging method according to the (t-1)-th generation position of the manta ray individual and the (t-1)-th generation population optimal position includes: When the ratio of (t-1) to the total number of iterations T is less than or equal to the third random number r3, the t-th generation position of the i-th manta ray individual is calculated according to the following formula: When the ratio of (t-1) to the total number of iterations T is greater than the third random number r3, the t-th generation position of the i-th manta ray individual is calculated according to the following formula: Among them, x i (t) is the t-generation position of the i-th manta ray individual, x best (t-1) is the optimal position of the (t-1) generation population, x rand (t-1)=Lb+r7(Ub-Lb), r7 is the seventh random number between 0 and 1, r5 is the fifth random number between 0 and 1, x i (t-1) is the (t-1)th generation position of the ith manta ray individual, is the weight coefficient, r6 is the sixth random number between 0 and 1, T is the total number of iterations, x i-1 (t-1) is the (t-1)th generation position of the (i-1)th manta ray individual.
6. The path planning method according to claim 1 or 2, wherein the step of calculating the t-th generation position of the manta ray individual using a manta ray foraging method based on the (t-1)th generation position of the manta ray individual and the (t-1)th generation population optimal position comprises: Generate a third random number r3; When the third random number r3 is greater than or equal to a preset threshold, the t-th generation position of the manta ray individual is calculated using the manta ray chain foraging method according to the (t-1)-th generation position of the manta ray individual and the (t-1)-th generation population optimal position; The method of calculating the t-th generation position of the manta ray individual by using the manta ray chain foraging method according to the (t-1)-th generation position of the manta ray individual and the (t-1)-th generation population optimal position includes: The t-generation position of the i-th manta ray individual is calculated according to the following formula: Among them, x i (t) is the t-generation position of the i-th manta ray individual, x best (t-1) is the optimal position of the (t-1) generation population, r5 is the fifth random number between 0 and 1, x i (t-1) is the (t-1)th generation position of the ith manta ray individual, is the weight coefficient, r8 is the eighth random number between 0 and 1, T is the total number of iterations, x i-1 (t-1) is the (t-1)th generation position of the (i-1)th manta ray individual.
7. An electronic device comprising: at least one processor; A memory, wherein at least one program is stored in the memory, and when the at least one program is executed by the at least one processor, the at least one processor implements the path planning method according to any one of claims 1-6.
8. A computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the path planning method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Generator set economic load distribution optimization method
CN112016207A
Unmanned bicycle path planning method based on weight-improved particle swarm optimization algorithm
WO2018176596A1