CN107506513A - A kind of war game hexagonal grid map path planing method based on A* algorithms - Google Patents
A kind of war game hexagonal grid map path planing method based on A* algorithms Download PDFInfo
- Publication number
- CN107506513A CN107506513A CN201710516711.8A CN201710516711A CN107506513A CN 107506513 A CN107506513 A CN 107506513A CN 201710516711 A CN201710516711 A CN 201710516711A CN 107506513 A CN107506513 A CN 107506513A
- Authority
- CN
- China
- Prior art keywords
- cell
- point
- target point
- mrow
- hexagonal grid
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F30/00—Computer-aided design [CAD]
- G06F30/20—Design optimisation, verification or simulation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/29—Geographical information databases
Abstract
The invention discloses a kind of war game hexagonal grid map path planing method based on A* algorithms, the characteristics of first against hexagonal grid map, compared with the lattice map of corner, it is proposed that hexagonal grid localization method;And the effective ways of calculating distance between two cells are thus proposed, it can accurately calculate the lattice number of two cells apart;Because war game map mesorelief is complicated, thus it is different by the consumption of each cell.Consumption problem is considered in the path actual cost in calculating A* algorithms, actual cost function is modified.Method proposed by the present invention more can accurately calculate the distance between hexagonal grid, and find optimal path in the war game map of complexity, and providing path planning to war game simulation supports.
Description
Technical field
The present invention relates to a kind of war game hexagonal grid map path planing method based on A* algorithms.
Background technology
War game simulation is the emulation technology that one kind applies to the scene such as military training, fire-fighting simulation, can effectively be simulated
Reality, reference frame is provided for commanding and decision-making person.War game by constantly development, map from initial imagination topographic map,
Finally progressively use the actual landform figure of different proportion;Represent development and weapon of the operator of army and its equipment with military affairs
Type is stepped up, and the modern weapons such as sea, sky, day occurs;Rule is developed by initial simple infantry and artilleryman's rule of engagement
Rule is fought in more arm of the services to today, and emphasizes the influence of many battlefield other factors such as politics, economy and common people's change;War game pushes away
Purpose is drilled also from initial rehearsal troop operation, to emphasizing to examine the strategies such as plan of maneuver, logistics support, all arm of the services combined operation
Property deduce.War game is during this development and change, from initial Tactics-level, progressively develops into the soldier of campaign level and strategic level
Chess, effect and the continuous expansion in field indicate the change of war game function and emphasis, are no longer only military education originally
And training method, additionally it is possible to as the investigation instrument to large-scale military operation and national politics policy behavior potential problems.
With the development of information technology, using with it is quick calculate, accurately computer system is deduced for data statistics
As the main direction of development of war game simulation.Because war game map is complicated, cell quantity is more, path planning pushes away as war game
Drill a key issue in electronization.The achievement in research of war game simulation path planning at home and abroad is less.
Therefore, it is necessary to which a kind of war game hexagonal grid map path planing method based on A* algorithms is to solve the above problems.
The content of the invention
The present invention is for defect present in prior art, there is provided it is a kind of can be in the war game hexagonal grid map of complicated landform
In the correct war game hexagonal grid map path planing method based on A* algorithms for finding optimal path.
In order to solve the above technical problems, the war game hexagonal grid map path planing method based on A* algorithms of the present invention is adopted
Technical scheme is:
A kind of war game hexagonal grid map path planing method based on A* algorithms, comprises the following steps:
1), cartographic information models:Hexagonal grid map is established, according to locomotivity numerical value of the chess piece in different units lattice,
Terrain information is converted into mobile points consumption information, the mobile consumption points by each cell is drawn, completes map and build
Mould;
2) coordinate of each cell, is calculated, obtains the coordinate of cell initial point and target point;And record each single
The coordinate information of 6 adjacent cells of first lattice;
3), path is generated using A* algorithms:
According to cost function f (x)=g (x)+h (x), the neighborhood of search unit lattice, until target point is reached, then from mesh
Punctuate traces back to initial point, outgoing route, wherein, f (x) is the evaluation function via node x to target point, g (x) from initial point
It is the actual cost from initial point to node x, h (x) is estimate costs of the node x to target point optimal path.
Further, g (x) is calculated by following formula in step 3):
In formula, x be pass through cell number, NiFor the mobile consumption points of i-th of cell.
Further, h (x) computational methods comprise the following steps in step 3):
First, straight line l is utilized1,l2And l3Hexagonal grid map is divided into six parts, wherein, straight line l1,l2And l3By working as
Front unit lattice x central point and vertical with current cell x side;
2nd, judge part that target point T is located at and the straight line for splitting this part, cross target point T and be straight line l4And l5, and make
Straight line l4And l5The straight line for splitting this part is respectively parallel to, and obtains straight line l4And l5With the intersection point P for the straight line for splitting this part1
And P2;
3rd, current cell x to target point T distance is equal to P1Point to target point T distance add P2Point arrives target point T
Distance, that is, meet equation:
In formula, d(x,T)Distance for current cell x to target point T,For P1Point arrives target point T distance,
For P2Distance of the point to target point T;
4th, the distance d according to the current cell x that step 3 obtains to target point T(x,T), h (x) is calculated:
H (x)=Dd(x,T)
In formula, D is minimum cell movement consumption points.
Further, the mobile consumption points of cell are calculated by following formula in step 1):
Mobile consumption points NiFor:
In formula, NiFor the mobile consumption points of i-th of cell, CiThe locomotivity for being chess piece in i-th of cell,
The scope of mobile consumption points is [1, n], and the number of cell is m.
Further, wherein, CiThe locomotivity for being chess piece in i-th of cell is chess piece in i-th of cell
In translational speed.
Further, the coordinate P of each cell is calculated in step 2) according to following formula(k,l):
In formula, k is horizontal cell quantity, and l is the cell quantity of longitudinal direction, and a is the length of side of regular hexagon cell.
Inventive principle:A* algorithms are a kind of typical heuristic search algorithms, are widely applied in path planning.For
A* algorithms are acted on into war game simulation, it is necessary to be improved to A* algorithms, including it is following some:(1) traditional A* algorithms are based on
Corner lattice map, and war game map is hexagonal grid map, each cell location algorithm is different.(2) war game map is with a varied topography,
The mobile consumption of each cell is different.(3) compare corner lattice map, the distance between two cells in hexagonal grid map
It is difficult to calculate.
Beneficial effect:The war game hexagonal grid map path planing method based on A* algorithms of the present invention can be more accurate
The distance between hexagonal grid is calculated, and optimal path is found in the war game map of complexity, path rule are provided war game simulation
Draw and support.
Brief description of the drawings
Fig. 1 is actual war game map.
Fig. 2 is the mobile consumption points hum pattern generated in embodiment.
Fig. 3 is corner lattice grid location figure.
Fig. 4 is hexagonal grid grid location figure.
Fig. 5 is the war game map partitioning in embodiment.
Fig. 6 is that the distance in embodiment calculates signal map.
Fig. 7 is according to the mobile path for consuming hum pattern of counting and generating in embodiment.
Fig. 8 is the path of actual map generation in embodiment.
Embodiment
Below in conjunction with the accompanying drawings and specific embodiment, the present invention is furture elucidated, it should be understood that these embodiments are merely to illustrate
The present invention rather than limitation the scope of the present invention, after the present invention has been read, those skilled in the art are each to the present invention's
The modification of the kind equivalent form of value falls within the application appended claims limited range.
As depicted in figs. 1 and 2, the war game hexagonal grid map path planing method of the invention based on A* algorithms, including with
Lower step:
Step 1, cartographic information models.
Step 1.1, the actual map of war game such as Fig. 1, carried out according to certain locomotivity of equipment in different terrain at quantization
Reason.If the locomotivity equipped in i-th kind of landform (common m kinds landform) is CiThousand ms/h, mobile points consume scope and are
[1, n].Then mobile consumption points NiFor:
Step 1.2, actual war game map is converted into mobile consumption points hum pattern (Fig. 2), and information is stored in one
In two-dimensional array.
Step 2, path planning primary condition, gridding information are set.
Step 2.1, each hexagonal unit cells coordinate is calculated, obtains the initial point and coordinate of ground point of cell.Six
Grid location in the lattice of angle be present, below contrasted corner lattice and hexagonal grid map.As shown in figure 3, with the upper left corner
Square is that origin is (0,0).If present node is P(3,1), then P(3,1)Point coordinate for (3a, a).For any section
Point P(n1,m1)(n1 is horizontal number of grid, and m1 is the number of grid of longitudinal direction), coordinate is (n1a, m1a).In regular hexagon
In grid (such as Fig. 4), if the regular hexagon length of side is a, then figure interior joint coordinate is not integer.The characteristics of due to regular hexagon,
Need to ordinate point odd even discussion.When ordinate is even number, below figure point P(3,2), coordinate isWork as ordinate
For odd number when, below figure point P(3,3), coordinate isFor arbitrary node P(k,l), coordinate should meet as inferior
Formula:
Step 2.2, each unit lattice coordinate drawn according to step 2.1, the coordinate of each hexagonal grid adjacent cells lattice is recorded
Information.Intransitable landform on map between some cells be present, then think when recording adjacent cells lattice coordinate information
In the presence of can not be by non-conterminous between two cells of landform.
Step 3, path is generated using amended A* algorithms.
Step 3.1 not only considers cell distance when calculating g (x), and considers the shifting consumed by each cell
Dynamic point number.Actual cost g (x) meets equation below:
In formula, x be pass through cell number, NiFor the mobile consumption points of i-th of cell.
Step 3.2 calculates h (x) as shown in figure 5, the point above setting is present node, and the point of lower section is target point.From current
Node x sets out toward perpendicular to the direction on its side being straight line l1,l2,l3, map can be divided into 6 parts.Judge target point T places
Part, target point is in the 5th part in this example, by straight line l2,l3Surrounded.As shown in fig. 6, crossing target point makees straight line l4,l5Respectively
Parallel to straight line l2,l3, obtain intersection point P1,P2.Then present node x to target point T distance is equal to P1Distance of the point to target point T
Plus P2Point meets equation to target point T distance:
In formula, d(x,T)Distance for present node x to target point T,For P1Point arrives target point T distance,For
P2Distance of the point to target point T.
H (x)=Dd(x,T) (5)
D is minimum cell movement consumption points in formula.
Step 3.3 searches for hexagonal grid neighborhood according to cost function f (x)=g (x)+h (x);Search for up to reaching target point,
Or there is no element in OPEN tables;Then initial point, outgoing route are traced back to from target point.
Embodiment:
First according to the actual map of Fig. 1 war games, mobile consumption points table (table 1) is generated by formula (1).According to table 1 by ground
Shape information is converted into mobile points consumption information figure (Fig. 2), by cartographic information electronization.Wherein path planning initial point is S, mesh
Punctuate is T.Each hexagonal unit cells coordinate is obtained according to formula (2), and preserves the neighborhood information of each cell.According to public affairs
Formula (3) obtains initial point S to node n distance g (x), is gained enlightenment formula function h (x) according to formula (4) and formula (5).Then
Utilize cost function f (x)=g (x)+h (x) search hexagonal grid neighborhoods;Search is not until reach has in target point or OPEN tables
Element, then it represents that search is completed;Then initial point is traced back to from target point, obtained in the path (Fig. 7) of consumption points hum pattern,
And it is mapped to actual war game map (Fig. 8).It can be seen that this algorithm can find optimal road in the war game map of complicated landform
Footpath, provide path planning for commanding and decision-making person and support.
The movement consumption points table of table 1
。
Claims (6)
- A kind of 1. war game hexagonal grid map path planing method based on A* algorithms, it is characterised in that:Comprise the following steps:1), cartographic information models:Hexagonal grid map is established, according to locomotivity numerical value of the chess piece in different units lattice, by ground Shape information is converted into mobile points consumption information, draws the mobile consumption points by each cell, completes Map building;2) coordinate of each cell, is calculated, obtains the coordinate of cell initial point and target point;And record each cell The coordinate information of 6 adjacent cells;3), path is generated using A* algorithms:According to cost function f (x)=g (x)+h (x), the neighborhood of search unit lattice, until target point is reached, then from target point Trace back to initial point, outgoing route, wherein, f (x) is the evaluation function via node x to target point from initial point, g (x) be from For initial point to node x actual cost, h (x) is estimate costs of the node x to target point optimal path.
- 2. the war game hexagonal grid map path planing method according to claim 1 based on A* algorithms, it is characterised in that:Step It is rapid 3) in g (x) be calculated by following formula:<mrow> <mi>g</mi> <mrow> <mo>(</mo> <mi>x</mi> <mo>)</mo> </mrow> <mo>=</mo> <munderover> <mo>&Sigma;</mo> <mrow> <mi>i</mi> <mo>=</mo> <mn>0</mn> </mrow> <mi>x</mi> </munderover> <msub> <mi>N</mi> <mi>i</mi> </msub> </mrow>In formula, x be pass through cell number, NiFor the mobile consumption points of i-th of cell.
- 3. the war game hexagonal grid map path planing method according to claim 1 based on A* algorithms, it is characterised in that:Step It is rapid 3) in h (x) computational methods comprise the following steps:First, straight line l is utilized1,l2And l3Hexagonal grid map is divided into six parts, wherein, straight line l1,l2And l3By current single First lattice x central point and vertical with current cell x side;2nd, judge part that target point T is located at and the straight line for splitting this part, cross target point T and be straight line l4And l5, and make straight line l4And l5The straight line for splitting this part is respectively parallel to, and obtains straight line l4And l5With the intersection point P for the straight line for splitting this part1With P2;3rd, current cell x to target point T distance is equal to P1Point to target point T distance add P2Point to target point T away from From meeting equation:<mrow> <msub> <mi>d</mi> <mrow> <mo>(</mo> <mi>x</mi> <mo>,</mo> <mi>T</mi> <mo>)</mo> </mrow> </msub> <mo>=</mo> <msub> <mi>d</mi> <mrow> <mo>(</mo> <msub> <mi>P</mi> <mn>1</mn> </msub> <mo>,</mo> <mi>T</mi> <mo>)</mo> </mrow> </msub> <mo>+</mo> <msub> <mi>d</mi> <mrow> <mo>(</mo> <msub> <mi>P</mi> <mn>2</mn> </msub> <mo>,</mo> <mi>T</mi> <mo>)</mo> </mrow> </msub> </mrow>In formula, d(x,T)Distance for current cell x to target point T,For P1Point arrives target point T distance,For P2 Distance of the point to target point T;4th, the distance d according to the current cell x that step 3 obtains to target point T(x,T), h (x) is calculated:H (x)=Dd(x,T)In formula, D is minimum cell movement points consumption.
- 4. the war game hexagonal grid map path planing method according to claim 1 based on A* algorithms, it is characterised in that:Step It is rapid 1) in cell mobile consumption points be calculated by following formula:Mobile consumption points NiFor:In formula, NiFor the mobile consumption points of i-th of cell, CiThe locomotivity for being chess piece in i-th of cell, it is mobile The scope of consumption points is [1, n], and the number of cell is m.
- 5. the war game hexagonal grid map path planing method according to claim 4 based on A* algorithms, it is characterised in that:Its In, CiThe locomotivity for being chess piece in i-th of cell is translational speed of the chess piece in i-th of cell.
- 6. the war game hexagonal grid map path planing method according to claim 1 based on A* algorithms, it is characterised in that:Step It is rapid 2) in the coordinate of each cell is calculated according to following formula:In formula, k is horizontal cell quantity, and l is the cell quantity of longitudinal direction, and a is the length of side of regular hexagon cell.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710516711.8A CN107506513A (en) | 2017-06-29 | 2017-06-29 | A kind of war game hexagonal grid map path planing method based on A* algorithms |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710516711.8A CN107506513A (en) | 2017-06-29 | 2017-06-29 | A kind of war game hexagonal grid map path planing method based on A* algorithms |
Publications (1)
Publication Number | Publication Date |
---|---|
CN107506513A true CN107506513A (en) | 2017-12-22 |
Family
ID=60678635
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710516711.8A Pending CN107506513A (en) | 2017-06-29 | 2017-06-29 | A kind of war game hexagonal grid map path planing method based on A* algorithms |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107506513A (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108647374A (en) * | 2018-03-22 | 2018-10-12 | 中国科学院自动化研究所 | Tank tactics Behavior modeling method and system and equipment in ground force's tactics war game game |
CN109343847A (en) * | 2018-09-14 | 2019-02-15 | 北京华如科技股份有限公司 | The expansible war game simulation platform of multi-domain Oriented |
CN110631601A (en) * | 2019-11-13 | 2019-12-31 | 中国电子科技集团公司第二十八研究所 | Path planning method based on non-display topological vector map |
CN112509114A (en) * | 2020-11-24 | 2021-03-16 | 中国船舶工业系统工程研究院 | Path planning method, system and medium |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105045976A (en) * | 2015-07-01 | 2015-11-11 | 中国人民解放军信息工程大学 | Method for modeling terrain property of Wargame map by grid matrix |
CN106441303A (en) * | 2016-09-30 | 2017-02-22 | 哈尔滨工程大学 | Path programming method based on A* algorithm capable of searching continuous neighborhoods |
-
2017
- 2017-06-29 CN CN201710516711.8A patent/CN107506513A/en active Pending
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105045976A (en) * | 2015-07-01 | 2015-11-11 | 中国人民解放军信息工程大学 | Method for modeling terrain property of Wargame map by grid matrix |
CN106441303A (en) * | 2016-09-30 | 2017-02-22 | 哈尔滨工程大学 | Path programming method based on A* algorithm capable of searching continuous neighborhoods |
Non-Patent Citations (4)
Title |
---|
伯乐在线-JANZOU编译: "游戏中常用的寻路算法的分享(2):Heuristics 函数", pages 1 - 2 * |
张俊恒: "计算机兵棋中兵力机动路径规划研究", vol. 2012, no. 02, pages 1 - 3 * |
李天成等: "基于扇形栅格地图的移动机器人全局路径规划", vol. 32, no. 04, pages 547 - 552 * |
陈宗海: "系统仿真技术及其应用 第11卷", 中国科技大学出版社, pages: 368 * |
Cited By (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108647374A (en) * | 2018-03-22 | 2018-10-12 | 中国科学院自动化研究所 | Tank tactics Behavior modeling method and system and equipment in ground force's tactics war game game |
CN108647374B (en) * | 2018-03-22 | 2020-11-17 | 中国科学院自动化研究所 | Tank tactical behavior simulation method, system and equipment in army tactical chess game |
CN109343847A (en) * | 2018-09-14 | 2019-02-15 | 北京华如科技股份有限公司 | The expansible war game simulation platform of multi-domain Oriented |
CN109343847B (en) * | 2018-09-14 | 2021-09-14 | 北京华如科技股份有限公司 | Multi-field-oriented extensible war game deduction platform |
CN110631601A (en) * | 2019-11-13 | 2019-12-31 | 中国电子科技集团公司第二十八研究所 | Path planning method based on non-display topological vector map |
CN110631601B (en) * | 2019-11-13 | 2021-04-27 | 中国电子科技集团公司第二十八研究所 | Path planning method based on non-display topological vector map |
CN112509114A (en) * | 2020-11-24 | 2021-03-16 | 中国船舶工业系统工程研究院 | Path planning method, system and medium |
CN112509114B (en) * | 2020-11-24 | 2023-06-02 | 中国船舶工业系统工程研究院 | Path planning method, system and medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107506513A (en) | A kind of war game hexagonal grid map path planing method based on A* algorithms | |
Xu et al. | Integrating the system dynamic and cellular automata models to predict land use and land cover change | |
CN106441303A (en) | Path programming method based on A* algorithm capable of searching continuous neighborhoods | |
CN103065361B (en) | Three-dimensional island sand table implementation method | |
CN105204005B (en) | A kind of VTS system radar return image display method based on geographic coordinate system | |
CN101916397B (en) | Three-dimensional visualization device and method for describing wetland vegetation eco-hydrology response | |
Li et al. | AUV 3D path planning based on A* algorithm | |
CN103196368A (en) | Automatic estimation method for single tree three-dimensional green quantity based on vehicle-mounted laser scanning data | |
CN102289581A (en) | Method for simulating city expansion based on space function division | |
CN103295080A (en) | Three-dimensional path programming method based on elevation diagram and ant colony foraging | |
CN103970837B (en) | Discontinuous DEM classified manufacturing method based on urban land and vertical planning | |
CN103065305B (en) | Based on tetrahedral organize models cutting method in virtual operation training system | |
CN105067004A (en) | Terrain-based path search method | |
CN105335478B (en) | The method and apparatus for building urban land space multistory survey data semantic association | |
Gao et al. | Assessing the impacts of ecological-living-productive land changes on eco-environmental quality in Xining City on Qinghai-Tibet Plateau, China | |
CN105528423B (en) | Take the adaptive same bit pattern acquisition methods and device of space instances distance weighting into account | |
CN102880753B (en) | Based on the land utilization space characteristic dimension conversion method of fractal dimension | |
CN112116709A (en) | Terrain feature line processing method for improving terrain expression precision | |
CN105974471A (en) | Seismic data multi-GPU fast forward computation method based on asynchronous flow | |
Danehkar et al. | Degradation assessment of Jajrood protected area using landscape degradation model | |
CN113012286B (en) | Method for constructing road DEM based on dense point cloud data | |
Ghisu et al. | A level-set algorithm for simulating wildfire spread | |
Tan et al. | A GIS-Based Modeling Approach for Determining the Efficiency of the Traffic System between Ancient Military Castles | |
Lauro | Simulation models and GIS technology in environmental planning and landscape management | |
Kujala et al. | Developing a higher education e-learning GIS course for 3D analyses in geography |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |