Discrete event simulation-oriented hexagonal lattice way-finding method
By improving the pruning process and multithreading technology of the A* algorithm, the problem of low computational efficiency in hexagonal grid pathfinding of the traditional A* algorithm is solved, realizing an efficient pathfinding process, which is suitable for discrete event simulation fields such as aviation, navigation, and ground.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- INST OF SOFTWARE - CHINESE ACAD OF SCI
- Filing Date
- 2024-10-22
- Publication Date
- 2026-04-24
AI Technical Summary
In the field of discrete event simulation, especially in aviation, maritime and ground-based fields, the traditional A* pathfinding algorithm has low computational efficiency and large storage space consumption when facing obstacles, and has failed to effectively solve the problem of efficient pathfinding based on hexagonal grids.
An improved A* algorithm is adopted, which performs pruning when iterating through the adjacent nodes of the current node, calculates the slope between the node and the target node, selects the node with the slope closest to the target node for the next round of pathfinding, and uses multi-threaded parallel processing technology to reduce the search for useless nodes.
It improves computational efficiency and reduces storage space, optimizes computation time and storage requirements in the pathfinding process, and is suitable for efficient pathfinding of hexagonal grids.
Smart Images

Figure CN121920164A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of discrete event simulation and spatial information technology, and in particular to a hexagonal grid pathfinding method for discrete event simulation. Background Technology
[0002] The Discrete Global Grid System (DGGS) uniformly discretizes the Earth's surface according to certain rules, forming a seamless, non-overlapping, multi-resolution grid hierarchy. It uses cell address encoding instead of traditional geographic coordinates, exhibiting discreteness, hierarchy, and global continuity. This overcomes the problems of data fragmentation, geometric deformation, and topological inconsistencies inherent in traditional projection-based planar grid models for global spatial data management and multi-scale operations. Hexagonal grids, characterized by consistent adjacency and topological relationships, are closer to a circle than other geometric shapes and offer the highest sampling efficiency and angular resolution. Consequently, hexagonal grids are widely used in spatial data organization and management, map creation, addressing, and route calculation. In simulations of discrete events such as aviation, maritime, and ground-based activities, simulation models utilize spherical hexagonal grids for spatial calculations such as pathfinding, saving data storage space and simplifying computation.
[0003] Currently, the most widely used pathfinding method in the field of discrete event simulation is the A* (A*) pathfinding algorithm, which uses a certain heuristic function to find the best path to the target node with the least cost. However, the traditional A* pathfinding algorithm performs a large number of node searches and judgments when facing obstacles or other restricted areas, resulting in low computational efficiency. The literature (Gao Qingji, Yu Yongsheng, Hu Dandan. Feasibility path search and optimization based on improved A* algorithm [J]. Journal of Civil Aviation University of China, 2005, (04): 42-45.) proposed an improved A* algorithm, which weights the evaluation function (heuristic function) and introduces "manual search flags" to avoid repeated searches of invalid areas, thus playing a role in pre-judging or quickly escaping obstacles. However, it requires pre-search processing of useless nodes around the obstacles, which requires additional computation and storage space. Considering the computation and storage space overhead, the overall performance improvement is limited. The paper (Harabor D, Grastien A. Online Graph Pruning for Pathfinding on Grid Maps[C]. / / Proceedings of the Twenty-Fifth AAAI Conference on Artificial Intelligence. San Francisco, California, USA: AAAIPress, 2011: 1114-1119.) proposes a pathfinding algorithm based on the A* optimization algorithm, called the Jump Point Search (JPS) algorithm. This algorithm optimizes the operation of the A* algorithm in finding successor nodes. It expands the successor nodes according to the direction of the current node and the "jump point strategy" to achieve pruning optimization (i.e., pruning unnecessary intermediate nodes). Although JPS and its improved successor algorithms are recognized as the fastest grid-based pathfinding algorithms, they are only suitable for spatial computation of quadrilateral grids and are insufficient to support hexagonal grid addressing and route calculation in the field of discrete event simulation. The patent application filed by Liu Ranran et al. (publication number CN111289005A) proposes a pathfinding algorithm based on the A* algorithm. It constructs a straight-line function based on the coordinates of the starting and target points, finds the key points where the line intersects the grid, and then identifies the relevant adjacent nodes. It then determines whether any of these nodes coincide with an obstacle point. If a node does not coincide with an obstacle node, the optimal path is a straight line between the starting and target points. If an obstacle is encountered, the A* algorithm is invoked, and the above steps are repeated until the target point is found. However, this algorithm still follows the traditional A* algorithm approach when encountering obstacles, resulting in no significant improvement in computational efficiency.The patent (CN115979295A) filed by Tong Yanan et al. also proposes a pathfinding algorithm based on the A* optimization algorithm. This algorithm simplifies the path through corner calculation and smooths the path points through cubic B-spline interpolation. However, this algorithm is still geared towards traditional path planning methods rather than discretized hexagonal grid maps, and the corner calculation and cubic B-spline interpolation calculations are inefficient, making it unsuitable for discrete event simulations. The patent (CN118683515A) filed by T. Sugiarto et al. proposes another improved A* pathfinding algorithm for parking path planning in vehicle-assisted driving. This algorithm uses a priority queue (considering weights) to store each location node, then calculates the Euclidean distance from each node in the queue to the target node, and selects the node with the smallest distance as the candidate path. This algorithm calculates the Euclidean distance from all location nodes in the priority queue to the target node each time, resulting in a large computational load, no effective pruning scheme, and a large storage space requirement.
[0004] In summary, although many scholars at home and abroad have conducted extensive research on the A-Star pathfinding algorithm, no improved A-Star pathfinding algorithm has been proposed for fields such as aviation, maritime, and ground simulation based on discrete events. This algorithm is efficient and uses a discretized hexagonal grid based on a sphere for pathfinding calculation. Summary of the Invention
[0005] To address the problem of low computational efficiency in pathfinding calculations during simulation in discrete event simulation fields such as aviation, navigation, and ground simulation, this invention provides a hexagonal grid pathfinding method for discrete event simulation.
[0006] This invention provides a hexagonal grid pathfinding method for discrete event simulation systems, comprising:
[0007] Given a hexagonal grid map discretized at any level (resolution), where the grid map level (resolution) ranges from 1 to 16, and each hexagon's six sides incorporate terrain, building, and hydrological information related to traffic obstacles; determine the starting node and target node for the pathfinding task, where a "node" refers to a hexagonal geometric region in the grid map;
[0008] Furthermore, an evaluation function, i.e. a heuristic function, is constructed based on the traditional A* algorithm:
[0009] f(C)=g(C)+h(C))(1
[0010] Where C represents the current node; f(C) represents the evaluation function (abbreviated as f), which is the estimated value of reaching the target node from the starting node through the current node C; g(C) is the cumulative cost value from the starting node to the current node (abbreviated as g); h(C) is the expected cost value from the current node to the target node (abbreviated as h), which is the heuristic value. Although this invention adopts the evaluation (cost) function of the traditional A* algorithm, i.e. f = g + h, the calculation of g or h is different from the traditional method based on Euclidean distance. In this invention, g or h refers to the number of hexagonal units between two points. The calculation of g and h is based on formula (4).
[0011] Furthermore, based on the A* algorithm, openset and closeset lists are created, both initially empty. The openset list contains the set of branch nodes to be searched in the A* algorithm, i.e., the set of all branch nodes to be considered in the next round. The closeset list contains the set of branch nodes currently listed in the A* algorithm that are no longer considered for the next round. Because this invention requires pruning adjacent nodes, additional tempset and neighborset lists are created, but they are only used during algorithm execution and are cleared immediately after each iteration. The tempset list stores the set of branch nodes that survive pruning; the neighborset list stores the set of branch nodes that are eliminated after pruning, allowing a fallback to the traditional A* algorithm if the current pruning fails.
[0012] Furthermore, set the g, h, and f values of the starting node to 0, and add the starting node to the openset list.
[0013] Furthermore, the node with the smallest f value is taken from the openset list (the openset list only contains the starting node during the first execution), set as the current node for pathfinding, and added to the closeset list. At the same time, the current node is removed from the openset list, meaning it is no longer considered as a candidate branch node for the next round.
[0014] Furthermore, determine whether the current node is the target node. If it is, the pathfinding is successful and the algorithm ends; otherwise, continue to the next step.
[0015] Furthermore, by iterating through the six nodes adjacent to the current node, this invention proposes an operation to judge and prune (i.e., pruning) the six hexagonal nodes adjacent to the current node, in order to reduce the length of the openset list, optimize branch judgment, improve the computational efficiency in the pathfinding process, and reduce storage space. The pruning process includes:
[0016] First, label the coordinates of the current node as C(X, Y), the coordinates of the nodes adjacent to the current node as N(X, Y), and the coordinates of the target node as T(X, Y). Calculate the slope S0 between the current node C and the target node T according to formula (2):
[0017] S0=abs(NY-TY) / abs(NX-TX)(2)
[0018] Here, abs represents the absolute value operation.
[0019] The second step is to calculate the dot product V between vector CN and vector CT according to formula (3) based on the coordinates of the three points mentioned above. The coordinates of vector CN are (NX-CX, NY-CY), and the coordinates of vector CT are (TX-CX, TY-CY).
[0020] V=(NX-CX)×(TX-CX)+(NY-CY)×(TY-CY)(3)
[0021] If V is greater than or equal to 0 and the edges adjacent to nodes N and C are passable, then node N is added to the tempset list, and the g, h, and f values of node N are calculated according to formula (4), denoted as Ng, Nh, and Nf; if V is less than 0 but the edges adjacent to nodes N and C are passable, then node N is added to the neighborset list, and the g, h, and f values of node N are calculated according to formula (4). In other cases, node N is discarded, and the next loop begins, that is, the other nodes adjacent to the current node C are traversed, and the first and second steps are repeated.
[0022]
[0023] Where Cg represents the g value of node C; Ng represents the g value of node N; Nh represents the h value of node N; Nf represents the f value of node N; dist(N,T) represents the ground distance between node N and node T; L represents the side length of the hexagon; and Nh represents the number of hexagonal nodes between nodes N and T. This method replaces the traditional A* algorithm which uses Manhattan distance for calculation, and is a unique metric method of this invention.
[0024] The third step is to determine whether the tempset list is empty. If the tempset list is empty, firstly, update the g, h, and f values of each node in the neighborset list according to formula (4). If there is a node i (number 1 to 6) in the neighborset list whose g value is less than or equal to the g value of the current node C, then set the parent node (link) of node i to the current node C. Then, add all the nodes in the neighborset list to the openset list and clear the neighborset list. Finally, repeat the entire algorithm process from the beginning. If the tempset list is not empty, proceed to the fourth step.
[0025] Fourth step, iterate through the tempset list and calculate the slope S between each node j in the tempset list and the target node T according to formula (2). j The slope difference D is calculated according to formula (5). j :
[0026] D j =abs(S j -S0)(5)
[0027] Where the subscript j represents the order number of the node in the tempset list, j = 1, 2...n, and n represents the number of nodes in the tempset list.
[0028] Fifth step, select the node P with the smallest slope difference, update the g, h and f values of node P according to formula (4), set the parent node (link) of node P to the current node C, add node P to the openset list, and finally clear the tempset list.
[0029] Furthermore, it checks if the openset list is empty. If it is empty, it means that all possible path points have been found before reaching the target point, the pathfinding has failed, and the algorithm ends. Otherwise, it repeats the entire algorithm process from the beginning until the current node C is the target point. Then, it backtracks along the parent node of the current node C (which should now be the target node) until the parent node no longer exists (which should now be the starting node), thus obtaining an optimal path. The principle is that during the pathfinding process, each node determined to be on the optimal path, that is, the node with the smallest f value selected in each iteration, stores its parent node, which is the node with the smallest f value in the previous pathfinding round. Therefore, this invention only needs to backtrack from node C to obtain the optimal path.
[0030] The present invention also provides a server, characterized in that it includes a memory and a processor, the memory storing a computer program configured to be executed by the processor, the computer program including instructions for performing the above-described methods.
[0031] The present invention also provides a computer-readable storage medium having a computer program stored thereon, characterized in that the computer program implements the above-described method when executed by a processor.
[0032] Beneficial technical effects of the present invention:
[0033] This invention discloses a pathfinding method based on an optimized version of the traditional A* algorithm, a hexagonal grid pathfinding method for discrete event simulation. Building upon the traditional A* algorithm, this invention first proposes a pruning operation (i.e., branching) when iterating through the six adjacent nodes of the current node. Then, it calculates the slope between the remaining nodes and the target node, and finally selects the node whose slope is closest to the slope between the starting and target nodes to proceed to the next round of pathfinding. This invention solves the problem that traditional heuristic A* search algorithms search for many useless nodes when facing obstacles. In spatial computations such as pathfinding in discrete event simulation fields such as aviation, maritime, and ground-based applications, this invention reduces the computation time and storage space required for search, significantly improving the computational efficiency of the A* algorithm. Attached Figure Description
[0034] Figure 1 The flowchart illustrates a hexagonal grid pathfinding method for discrete event simulation provided in this embodiment of the invention.
[0035] Figure 2 A flowchart illustrating the pruning process provided in an embodiment of the present invention.
[0036] Figure 3 This is a schematic diagram illustrating the pathfinding results of a ship navigating in a certain area at sea using the algorithm of this invention, provided as an embodiment of the invention. Detailed Implementation
[0037] To make the technical solutions and advantages of the present invention clearer, the embodiments of the present invention will be described in detail below. Obviously, the described embodiments are exemplary and not all embodiments, and are only used to explain the present invention.
[0038] The specific embodiments of the present invention will be further described below with reference to the accompanying drawings and technical solutions.
[0039] In the specific implementation of this invention, taking a ship sailing at sea as an example, in addition to considering hydrological environmental factors such as weather and ocean currents, a ship also needs to avoid obstacles such as islands and reefs when sailing at sea. The hexagonal grid pathfinding method and device for discrete event simulation provided by this invention are used to plan a path that avoids obstacles. This mainly considers the geometric relationship between the hexagonal grid and the obstacles. The algorithm execution flow is as follows: Figure 1 As shown, in addition, multi-threaded parallel processing technology is used to accelerate the calculation process, and Geographic Information System (GIS) graphics processing software is used to visualize the grid map, route calculation results, etc.
[0040] As an embodiment of the present invention, specifically, a dedicated map generation tool is used to discretize the Earth's surface into a hexagonal grid. The grid map level (resolution) is set to level 6, corresponding to a side length L≈3.2km for the hexagonal grid. The selected test area is the sea area near a certain archipelago, and information such as islands and reefs is added to the hexagonal grid attribute information as obstacle information during the pathfinding process.
[0041] As an embodiment of the present invention, specifically, the starting point (starting node) and destination (target node) of the ship's navigation are determined, the g, h, and f values of the starting node are set to 0, and the starting node is added to the openset list. The pathfinding algorithm execution steps are as follows:
[0042] (1) Define the evaluation function, i.e., the heuristic function, based on the traditional A* algorithm:
[0043] f(C)=g(C)+h(C))(1
[0044] Where C represents the current node; f(C) represents the evaluation function (abbreviated as f), which is the estimated value of reaching the target node from the starting node through the current node C; g(C) is the cumulative cost value from the starting node to the current node (abbreviated as g); and h(C) is the expected cost value from the current node to the target node (abbreviated as h), which is the heuristic value.
[0045] (2) Take the node with the smallest f value from the openset list, set it as the current node for pathfinding, i.e. the Current node, and put it into the closeset list. At the same time, remove the Current node from the openset list, i.e., the Current node is no longer listed as a candidate branch node for the next round.
[0046] (3) Determine if the Current node is the target node. If it is, the pathfinding is successful and the algorithm ends; otherwise, continue to the next step. The present invention determines whether nodes are the same by comparing the 64-bit long integer address codes of two hexagons in the grid map. The address codes are determined when the grid is generated and are globally unique.
[0047] (4) Obtain the six nodes adjacent to the Current node. The node numbers are identified by the subscript i, i = 1, 2, 3, 4, 5, 6. This invention proposes an operation to judge and prune adjacent nodes (i.e., pruning). The process is as follows: Figure 2 As shown, the specific steps of the pruning process include:
[0048] The first step is to label the XY coordinates of the Current node as C(X, Y), and label the coordinates of the nodes adjacent to the Current node as N. i Let the coordinates of the target node be T(X,Y), and calculate the slope S0 between the current node and the target node T according to formula (2):
[0049] S0 = abs(N) i .YT.Y) / abs(N i .XT.X)(2)
[0050] Where abs represents the absolute value operation, N i This represents the i-th node adjacent to the Current node. The range of values for i is described in (4).
[0051] The second step is to calculate the vector CN according to the coordinates of the three points mentioned above, using formula (3). i The dot product value V between vector CN and vector CT, where vector CN is the vector CT. i The coordinates are: (N) i .XC.X,N i The coordinates of vector CT are (TX-CX, TY-CY).
[0052] V=(N i .XC.X)×(TX-CX)+(N i .YC.Y)×(TY-CY)(3)
[0053] If V is greater than or equal to 0 and node N i、 If the edges adjacent to node C are passable (i.e., there is no information about obstacles such as islands or reefs), then node N is... i Add it to the tempset list and calculate node N according to formula (4). i The values of g, h, and f are denoted as N. i.g、N i .h and N i .f; If V is less than 0 but node N i、 If the adjacent edge of node C is passable, then add the node to the neighborset list and calculate the node N according to formula (4). i The values of g, h, and f. Otherwise, the node N is discarded. i Then, proceed to the next iteration, that is, continue to traverse other nodes adjacent to the current node C, and repeat the first and second steps.
[0054]
[0055] Where Cg represents the g value of node C; N i .g represents node N i The value of g, +1 represents increasing the distance by 1 node, because N i N is separated from C by one hexagon; i .h represents node N i The h value, N i .f represents node N i The f-value; dist(N) i (T) represents node N i The distance from node T to the ground surface, where L represents the side length of the hexagon, and N... i The .h value is node N i The number of hexagonal nodes between T and T replaces the traditional A* algorithm's Manhattan distance calculation method, which is a unique metric method of this invention.
[0056] The third step is to determine whether the tempset list is empty. If the tempset list is empty, first update the g, h, and f values of each node in the neighborset list according to formula (4). If there is a node i (number 1 to 6) in the neighborset list whose g value is less than or equal to the g value of the current node C, then set the parent node (link) of node i to the current node C, then clear the neighborset list, and finally repeat the entire algorithm process from step (2). If the tempset list is not empty, proceed to the fourth step.
[0057] Fourth step, iterate through the tempset list and calculate the slope S between the nodes in the tempset list and the target node T according to formula (2). j The slope difference D is calculated according to formula (5). j :
[0058] D j =abs(S j -S0)(5)
[0059] Where the subscript j represents the order number of the node in the tempset list, j = 1, 2...n, and n represents the number of nodes in the tempset list.
[0060] Fifth step, select node P with the smallest slope difference, update the g, h and f values according to formula (4), set the parent node (link) of node P to the Current node, add node P to the openset list, and finally clear the tempset list.
[0061] (5) Determine if the openset list is empty. If it is empty, it means that all possible path points have been found before reaching the target point, the pathfinding has failed, and the algorithm ends. If the openset list is not empty, repeat the entire algorithm process from step (2) until the current node C is the target point. Then, we backtrack along the parent node of the current node C (which should be the target node at this time) until the parent node no longer exists (which should be the starting node at this time), and then we obtain an optimal path.
[0062] As an embodiment of the present invention, specifically, a hexagonal grid pathfinding method and device for discrete event simulation provided by the present invention is used to plan a path that can avoid obstacles. This mainly considers the geometric relationship between the hexagonal grid and islands / reefs, and uses GIS graphics processing software to visualize and render the grid map and route calculation results, such as... Figure 3 As shown, where Figure 3 The grid map and route calculation results are displayed in a comprehensive manner using GIS graphic processing software. The starting point and the target point are connected by line segments, and the small circle marks the center point of each hexagonal node. The curves with numbers around them represent islands or reefs. Figure 3 The latitude and longitude point information in the pathfinding results is shown in Table 1 below.
[0063] Table 1 shows the latitude and longitude points of the routing results.
[0064] Serial Number Longitude (unit: degrees) Latitude (unit: degrees) Remark 1. 111.30680372 15.63358283 Starting point 2. 111.28379276 15.69495104 3. 111.32137428 15.74179404 4. 111.35909974 15.79079628 5. 111.39616520 15.83982097 6. 111.43174535 15.88629299 7. 111.46863716 15.93593336 8. 111.50581014 15.98431992 9. 111.54120570 16.02904017 10. 111.58060105 16.07653785 11. 111.61908570 16.12591438 12. 111.65539197 16.17166028 13. 111.71711263 16.16294677 14. 111.77807177 16.15516800 15. 111.81376686 16.20045930 16. 111.85157092 16.25052414 17. 111.82602763 16.30569763 18. 111.80252781 16.36393632 19. 111.84033187 16.41297942 20. 111.87762507 16.45793560 21. 111.91440740 16.50595698 22. 111.95221146 16.55602182 23. 111.98899379 16.60302146 24. 112.02373265 16.65002110 25. 112.06051498 16.69599901 26. 112.09831904 16.74299866 27. 112.13714484 16.78999830 28. 112.17188370 16.83393275 29. 112.20494250 16.87994000 Target point
[0065] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit it. Their purpose is to help understand the content of the present invention and implement it accordingly. Those skilled in the art will understand that various substitutions, changes, and modifications are possible without departing from the spirit and scope of the present invention and the appended claims. Therefore, the present invention should not be limited to the content disclosed in the preferred embodiments, and the scope of protection of the present invention is defined by the scope of the claims.
Claims
1. A hexagonal grid pathfinding method for discrete event simulation, comprising the following steps: 1) Select one layer of hexagonal grid map from the multi-layer discretized hexagonal grid map of the discrete event simulation system as the target hexagonal grid map for pathfinding search; 2) Construct the evaluation function f(C) = g(C) + h(C) for the A* algorithm, and create openset, closeset, tempset, and neighborset lists, all of which are initially empty. Here, C represents the current node, f(C) is the estimated cost of reaching the target node from the starting node through the current node C, g(C) is the cumulative cost from the starting node to the current node C, and h(C) is the expected cost from the current node C to the target node. The openset list is used to store the branch nodes that are candidates for the next round in the A* algorithm, the closeset list is used to store the branch nodes that are currently listed as no longer candidates for the next round in the A* algorithm, the tempset list is used to store the branch nodes that are retained after pruning, and the neighborset list is used to store the branch nodes that are eliminated after pruning, so that the algorithm can fall back to the traditional A* algorithm when pruning fails. 3) Select two nodes from the target hexagonal grid map as the starting node and target node of the path, respectively. Initialize the cumulative cost value g, expected cost value h, and estimated value f of the starting node to 0, and add the starting node to the openset list. 4) Take the node with the smallest estimated value f from the openset list as the current node C for pathfinding, and add it to the closeset list. At the same time, remove the current node C from the openset list. 5) Determine if the current node C is the target node. If it is, the pathfinding is successful and the pathfinding ends; otherwise, proceed to step 6). 6) Iterate through the nodes adjacent to the current node C in the target hexagonal grid map, and prune each node N adjacent to the current node C; the pruning method is as follows: 61) Calculate the slope S0 between the current node C and the target node T, and the dot product V = (NX - CX) × (TX - CX) + (NY - CY) × (TY - CY); where NX is the x-coordinate of node N in the target hexagonal grid map, NY is the y-coordinate of node N in the target hexagonal grid map, TX is the x-coordinate of target node T in the target hexagonal grid map, TY is the y-coordinate of target node T in the target hexagonal grid map, CX is the x-coordinate of the current node C in the target hexagonal grid map, and CY is the y-coordinate of the current node C in the target hexagonal grid map; 62) If the dot product value V≥0 and the edges adjacent to nodes N and C are passable, then add node N to the tempset list and calculate the cumulative cost Ng, expected cost Nh, and estimated cost Nf of node N; if V<0 but the edges adjacent to nodes N and C are passable, then add node N to the neighborset list and calculate the cumulative cost Ng, expected cost Nh, and estimated cost Nf of node N; otherwise, discard node N. 63) Check if the tempset list is empty. If the tempset list is empty, update the cumulative cost g, expected cost h, and estimated cost f of each node in the neighborset list. If there is a node i in the neighborset list whose cumulative cost ig ≤ Cg, then set the parent node of node i as the current node C. Then, add all nodes in the neighborset list to the openset list and clear the neighborset list. Then return to step 61). If the tempset list is not empty, proceed to step 64). 64) Loop through the tempset list and calculate the slope S between each node j in the tempset list and the target node T. j And calculate the slope S j The slope difference D between the slope S0 and the slope j ; 65) Select the node P with the smallest slope difference, update the cumulative cost value Pg, expected cost value Ph and estimated value Pf of node P, set the parent node of node P to the current node C, add node P to the openset list, and clear the tempset list. 7) Check if the openset list is empty. If it is empty, the pathfinding has failed and the pathfinding process ends; otherwise, return to step 4). Continue until the current node C is the target node, then backtrack along the parent node of the current node C until the parent node no longer exists to obtain an optimal path.
2. The method according to claim 1, characterized in that, According to the formula Calculate the cumulative cost Ng, expected cost Nh, and estimated cost Nf of node N; where Cg represents the cumulative cost of node C. dist(N,T) represents the ground distance between node N and node T, and L represents the side length of the hexagon.
3. The method according to claim 1 or 2, characterized in that, Slope difference D j =abs(S j -S0), abs represents the absolute value operation.
4. The method according to claim 1 or 2, characterized in that, Slope S0 = abs(NY-TY) / abs(NX-TX), abs stands for absolute value operation.
5. A server, characterized in that, It includes a memory and a processor, the memory storing a computer program configured to be executed by the processor, the computer program including instructions for performing the method of any one of claims 1 to 4.
6. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method of any one of claims 1 to 4.
Citation Information
Patent Citations
Path finding method based on A star optimization algorithm
CN111289005A
Forklift path planning method, system and equipment based on geometric A star and medium
CN115979295A
Parking path search using modified parking path algorithm
CN118683515A