CN110263475B - Method for realizing random movement of entity in fixed area and storage medium - Google Patents

Method for realizing random movement of entity in fixed area and storage medium Download PDF

Info

Publication number
CN110263475B
CN110263475B CN201910570565.6A CN201910570565A CN110263475B CN 110263475 B CN110263475 B CN 110263475B CN 201910570565 A CN201910570565 A CN 201910570565A CN 110263475 B CN110263475 B CN 110263475B
Authority
CN
China
Prior art keywords
point
random
area
tpi
movement
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.)
Active
Application number
CN201910570565.6A
Other languages
Chinese (zh)
Other versions
CN110263475A (en
Inventor
张柯
闫飞
黄燕
马文娟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
BEIJING HUARU TECHNOLOGY CO LTD
Original Assignee
BEIJING HUARU TECHNOLOGY CO LTD
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by BEIJING HUARU TECHNOLOGY CO LTD filed Critical BEIJING HUARU TECHNOLOGY CO LTD
Priority to CN201910570565.6A priority Critical patent/CN110263475B/en
Publication of CN110263475A publication Critical patent/CN110263475A/en
Application granted granted Critical
Publication of CN110263475B publication Critical patent/CN110263475B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F30/00Computer-aided design [CAD]
    • G06F30/20Design optimisation, verification or simulation

Abstract

A method for realizing random movement of entity in fixed area includes randomly selecting route start point in limited area, generating time period ti of each stage randomly in sequence, accumulating total sum of current random time periods until total patrol time is reached, carrying out random uniform movement from first time period, calculating whether end point of current time period is in area or not in advance, taking intersection point as middle point in time period if area is exceeded, starting up from intersection point, continuing new random movement until time period runs out. And sequentially and circularly executing the steps until all the random time periods are finished. Therefore, in a given area, the method can realize random movement of the combat entity in the area, reduces the generation times of random points and the judgment times of whether the random points are positioned in the area relative to the conventional random path generation algorithm, and improves the execution efficiency.

Description

Method for realizing random movement of entity in fixed area and storage medium
Technical Field
The invention relates to the field of simulation, in particular to a method for randomly moving an entity in a fixed area in combat simulation and a storage medium thereof.
Background
In real combat situations, an entity patrol route implementation algorithm is required in order to perform a dead-corner-free patrol task in an irregular area. When patrol is performed in an irregular area, the maneuvering process and the maneuvering route of the entity show certain irregularity.
In the prior art, a random motion of an entity in an irregular area is simulated, conventionally, a point is randomly taken, whether the point is in the area or not is judged, if so, the point is maneuvered at a random speed, and if not, the point in the area is selected. And after the point is reached, randomly taking a point, and executing a loop for judging whether the point is in the area or not, wherein the loop is executed until the time is over.
In the method in the prior art, the number of times of generating random points and the number of times of judging whether the random points fall in the area are more, so that the algorithm calculation efficiency is improved, in a given area, the random movement of a combat entity in the area is realized, the number of times of generating the random points and the number of times of judging whether the random points are in the area are reduced, the program execution efficiency is improved, and the method becomes a technical problem to be solved urgently in the prior art.
Disclosure of Invention
The invention aims to provide a method for generating a combat entity random path in a fixed area and a storage medium thereof, which can improve the operation speed of an algorithm and reduce the generation times of random points and the judgment times of whether the random points are positioned in the area.
To achieve the purpose, the invention adopts the following technical scheme:
a method for an entity to achieve random motion in a fixed area, comprising the steps of:
region giving step S110: giving a Zone, and requiring an entity to randomly move in the Zone;
starting point and motion time random generation step S120: randomly selecting a certain point in the area as a maneuvering starting point, randomly generating a first movement time period t1, randomly generating a second movement time period t2 after the movement of the time t1 is completed, and circularly generating t3 and … tn until the total patrol time of all the time periods is integrated, and executing a movement step S130 in each movement time period;
motion step S130: the first movement time period t1 takes a maneuvering starting point as a starting point, a point finally reached in the last movement time period as a movement starting point in the next time period, a random speed and a random offset direction are set, a new target point tpi is obtained, whether the new target point tpi is in a polygonal area is judged, if the new point tpi is in the polygonal area, the new point is taken as the next point of random movement, and a random route in the next time period is continuously and circularly obtained; if the new point tpi is not within the polygonal region, it is randomly reflected into the region at the intersection of the polygonal region to obtain an updated point tpi ' and the determination of whether tpi ' is within the polygonal region is continued until an updated point tpi ' within the region is found.
Optionally, in step S110, the area is an area with an arbitrary shape, which depends on the requirement of the simulation.
Optionally, in the moving step S130, if the new point tpi is not in the polygon area, a normal is found at the intersection point with the polygon, an angle in the pointing area is found, and an angle value randomly generated in the range of [ -90 °,90 ° ] is added to obtain a new direction angle theta, then, starting from the intersection point, an offset angle theta is selected, and an offset distance=a distance between the intersection point and tpi, so as to obtain an updated point tpi ', and further, whether the tpi ' is in the polygon area is determined until an updated point tpi ' in the area is found.
Alternatively, when the new point tpi is not within the polygonal region, then the random reflection into the region at the polygon region intersection is made, the time remaining for this period is unchanged, and the speed of the random movement can be changed.
The present invention further discloses a storage medium for storing computer executable instructions, characterized in that: the computer executable instructions, when executed by a processor, perform the method of random motion described above.
In a given area, the method can realize random movement of the combat entity in the area, reduces the generation times of random points and the judgment times of whether the random points are positioned in the area relative to a conventional random path generation algorithm, and improves the program execution efficiency.
Drawings
FIG. 1 is a flow chart of a method for an entity to achieve random motion within a fixed area in accordance with a specific embodiment of the present invention;
FIG. 2 is a flowchart of a specific decision of a method for implementing random motion of an entity in a fixed area according to a specific embodiment of the present invention;
FIG. 3 is an example of a method for an entity to achieve random motion within a fixed area in accordance with a specific embodiment of the present invention;
FIG. 4 is a method for realizing random motion of an entity in a fixed area according to an embodiment of the present invention, with a rectangular realization effect;
FIG. 5 is an implementation of a method for achieving random motion of an entity within a fixed region in a convex polygon according to an embodiment of the present invention;
fig. 6 is an implementation of a method for implementing random motion of an entity in a fixed area in a concave polygon according to an embodiment of the present invention.
Detailed Description
The invention is described in further detail below with reference to the drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting thereof. It should be further noted that, for convenience of description, only some, but not all of the structures related to the present invention are shown in the drawings.
Referring to fig. 1, a flowchart of a method for implementing random motion of an entity in a fixed area according to an embodiment of the present invention is shown, the method including the steps of:
region giving step S110: giving a Zone, and requiring an entity to randomly move in the Zone;
the area can be an area with any shape, and is determined according to the simulation requirement.
In the present invention, an entity is a computer mapping to a real object, such as: aircraft, vehicles, etc. In simulation implementation, the characteristics and behaviors of the real object are characterized by the entity.
Starting point and motion time random generation step S120: randomly selecting a certain point in the area as a maneuvering starting point, randomly generating a first movement time period t1, randomly generating a second movement time period t2 after the movement of the time t1 is completed, and circularly generating t3 and … tn until the total patrol time of all the time periods is integrated, and executing a movement step S130 in each movement time period;
motion step S130: the first movement time period t1 takes a maneuvering starting point as a starting point, a point finally reached in the last movement time period as a movement starting point in the next time period, a random speed and a random offset direction are set, a new target point tpi is obtained, whether the new target point tpi is in a polygonal area is judged, if the new point tpi is in the polygonal area, the new point is taken as the next point of random movement, and a random route in the next time period is continuously and circularly obtained; if the new point tpi is not within the polygonal region, it is randomly reflected into the region at the intersection of the polygonal region to obtain an updated point tpi ' and the determination of whether tpi ' is within the polygonal region is continued until an updated point tpi ' within the region is found.
For example, referring to fig. 3, V1-V5 enclose a movement area, take point 1 as a maneuvering start point, move to point 2 in time t1, then continue to set a new random speed and random offset direction again with point 2 as a start point for random movement in time t2, and obtain a new target point tp1, but tp1 already exceeds the area, so that point 3 is obtained at the intersection of the polygon with point 1 and point 2, point 3 is used as a start point for random reflection to continue to obtain a new movement point tp2, tp2 also exceeds the area, point 4 is obtained at the intersection of the polygon with point tp2 and point 3, and random reflection continues to move to the area with point 4 as a start point until movement point 5 is located in the area. Random movement is then performed during the period of t3, thereby training until the total patrol time is reached.
Further, if the new point tpi is not in the polygon area, a normal is found at the intersection point with the polygon, an angle in the pointing area is found, and a randomly generated angle value in the range of [ -90 degrees, 90 degrees ] is added to obtain a new direction angle theta, then, starting from the intersection point, an offset angle theta is selected, and an offset distance = the distance between the intersection point and tpi, so as to obtain an updated point tpi ', and further, whether the tpi ' is in the polygon area is judged until the updated point tpi ' in the area is found.
That is, with the new random velocity and the distance calculated in time in this time, the point of random motion is always located in the Zone by means of the intra-Zone offset at the boundary of the designated Zone.
Further, when the new point tpi is not within the polygonal region, then the time remaining for this period is unchanged when it is reflected randomly into the region at the polygon region intersection, the speed of the random motion can be changed so that the randomness of the motion is greater.
Of course, the movement speed may also be kept constant during a period of time.
Referring to fig. 2, a detailed decision flow chart of a method for an entity to achieve random motion within a fixed area is shown.
Further, referring to fig. 4-6, the method of implementing random motion of the entity in the fixed area is shown respectively, and experiments are performed in the rectangle, convex polygon and concave polygon respectively, so as to generate random path effects.
The invention has the following characteristics:
1. the path starting point is randomly selected within a defined area.
2. The time period ti of each stage is randomly generated in turn, and the sum of the current random time periods is accumulated until the total patrol time is reached.
3. And starting random uniform motion from the first time period, randomly calculating whether the ending point of the current time period is in the area in advance, if so, taking the intersection point as a middle point in the time period, starting up from the intersection point, and continuing new random motion until the time period is finished.
4. And sequentially and circularly executing the steps until all the random time periods are finished.
Therefore, in a given area, the method can realize random movement of a combat entity in the area, compared with a conventional random path generation algorithm, the random point generation times and the times of judging whether the random points are positioned in the area are reduced, and the execution efficiency of the method and a program for running the method is improved.
Further, the present invention discloses a storage medium storing computer executable instructions that when executed by a processor perform the method of random motion described above.
It will be apparent to those skilled in the art that the elements or steps of the invention described above may be implemented in a general purpose computing device, they may be concentrated on a single computing device, or they may alternatively be implemented in program code executable by a computer device, such that they may be stored in a storage device for execution by the computing device, or they may be separately fabricated into individual integrated circuit modules, or a plurality of modules or steps in them may be fabricated into a single integrated circuit module. Thus, the present invention is not limited to any specific combination of hardware and software.
While the invention has been described in detail in connection with specific preferred embodiments thereof, it is not to be construed as limited thereto, but rather as a result of a simple deduction or substitution by a person having ordinary skill in the art without departing from the spirit of the invention, which is to be construed as falling within the scope of the invention defined by the appended claims.

Claims (4)

1. A method for an entity to realize random movements in a fixed area, in particular for realizing an entity patrol route, wherein the entity is a mapping of a computer to a real object, and comprises an airplane or a vehicle, and the method comprises the following steps:
region giving step S110: giving a Zone, and requiring an entity to randomly move in the Zone;
starting point and motion time random generation step S120: randomly selecting a certain point in the area as a maneuvering starting point, randomly generating a first movement time period t1, randomly generating a second movement time period t2 after the movement of the time t1 is completed, and circularly generating t3 and … tn until the total patrol time of all the time periods is integrated, and executing a movement step S130 in each movement time period;
motion step S130: the first movement time period t1 takes a maneuvering starting point as a starting point, a point finally reached in the last movement time period as a movement starting point in the next time period, a random speed and a random offset direction are set, a new target point tpi is obtained, whether the new target point tpi is in a polygonal area is judged, if the new point tpi is in the polygonal area, the new point is taken as the next point of random movement, and a random route in the next time period is continuously and circularly obtained; if the new point tpi is not within the polygonal region, it is reflected randomly into the region at the polygon region intersection to acquire an updated point tpi ' and the determination of whether tpi ' is within the polygonal region is continued until an updated point tpi ' within the region is found, and when the new point tpi is not within the polygonal region, it is reflected randomly into the region at the polygon region intersection, the remaining time of the period of time is unchanged, and the speed of random motion can be changed.
2. A method of achieving random motion as claimed in claim 1, wherein:
in step S110, the region is an arbitrarily shaped region, and is determined according to the simulation requirement.
3. A method of achieving random motion as claimed in claim 1, wherein:
in the moving step S130, if the new point tpi is not in the polygon area, a normal is found at the intersection point with the polygon, an angle in the pointing area is found, and a randomly generated angle value in the range of [ -90 °,90 ° ] is added to obtain a new direction angle theta, then, starting from the intersection point, a deviation angle theta is selected, and a distance between the deviation distance=intersection point and tpi is selected to obtain an updated point tpi ', and the judgment of whether tpi ' is in the polygon area is continuously performed until an updated point tpi ' in the area is found.
4. A storage medium storing computer-executable instructions, characterized by:
the computer executable instructions, when executed by a processor, perform the method of random motion of any of claims 1-3.
CN201910570565.6A 2019-06-27 2019-06-27 Method for realizing random movement of entity in fixed area and storage medium Active CN110263475B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910570565.6A CN110263475B (en) 2019-06-27 2019-06-27 Method for realizing random movement of entity in fixed area and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910570565.6A CN110263475B (en) 2019-06-27 2019-06-27 Method for realizing random movement of entity in fixed area and storage medium

Publications (2)

Publication Number Publication Date
CN110263475A CN110263475A (en) 2019-09-20
CN110263475B true CN110263475B (en) 2023-04-25

Family

ID=67922636

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910570565.6A Active CN110263475B (en) 2019-06-27 2019-06-27 Method for realizing random movement of entity in fixed area and storage medium

Country Status (1)

Country Link
CN (1) CN110263475B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102360214A (en) * 2011-09-02 2012-02-22 哈尔滨工程大学 Naval vessel path planning method based on firefly algorithm
CN105404781A (en) * 2015-11-26 2016-03-16 南京南瑞集团公司 Buffer region generation algorithm method based on line segment buffer region fusion
CN106125764A (en) * 2016-08-03 2016-11-16 西北工业大学 Based on A*the unmanned plane path dynamic programming method of search
CN108710719A (en) * 2018-04-02 2018-10-26 中山大学 Intersection intramural conflict based on battleground degree of occupying clears up simulation method
CN109131351A (en) * 2018-09-04 2019-01-04 吉林大学 Intact stability evaluation method based on stochastic Time-Delay

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130124089A1 (en) * 2011-11-11 2013-05-16 Lockheed Martin Corporation Spatiotemporal survivability data compression using objective oriented constraints

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102360214A (en) * 2011-09-02 2012-02-22 哈尔滨工程大学 Naval vessel path planning method based on firefly algorithm
CN105404781A (en) * 2015-11-26 2016-03-16 南京南瑞集团公司 Buffer region generation algorithm method based on line segment buffer region fusion
CN106125764A (en) * 2016-08-03 2016-11-16 西北工业大学 Based on A*the unmanned plane path dynamic programming method of search
CN108710719A (en) * 2018-04-02 2018-10-26 中山大学 Intersection intramural conflict based on battleground degree of occupying clears up simulation method
CN109131351A (en) * 2018-09-04 2019-01-04 吉林大学 Intact stability evaluation method based on stochastic Time-Delay

Also Published As

Publication number Publication date
CN110263475A (en) 2019-09-20

Similar Documents

Publication Publication Date Title
Sasaki et al. A study on vision-based mobile robot learning by deep Q-network
US20190272465A1 (en) Reward estimation via state prediction using expert demonstrations
EP1733287B1 (en) System and method for adaptive path planning
CN112344943A (en) Intelligent vehicle path planning method for improving artificial potential field algorithm
CN108490432B (en) Global target tracking method in navigation radar system
Jang et al. A time-window-based task scheduling approach for multi-function phased array radars
Stevens et al. All-electric warship load demand model for power and energy system analysis using exogenously initiated threats
CN103902385B (en) Phased-array radar self-adapting task scheduling method based on priori
CN109581342A (en) A kind of rotating phased array radar complete period time resource distribution method
CN110263475B (en) Method for realizing random movement of entity in fixed area and storage medium
CN111399534B (en) Method and system for capturing aerial medium-high speed moving targets by multiple unmanned aerial vehicles
Jeauneau et al. Radar tasks scheduling for a multifunction phased array radar with hard time constraint and priority
Yuan et al. Extended object tracking using IMM approach for a real-world vehicle sensor fusion system
Turra et al. Fast unmanned vehicles task allocation with moving targets
Leuenberger et al. Actor-critic reinforcement learning with neural networks in continuous games
US20230236088A1 (en) Computer-aided method and device for predicting speeds for vehicles on the basis of probability
CN112651486A (en) Method for improving convergence rate of MADDPG algorithm and application thereof
Brooks et al. Game and information theory analysis of electronic countermeasures in pursuit-evasion games
CN102819667A (en) Method for optimizing launching time sequence of coordinated attack of aircraft based on time constraint library
CN108280043A (en) A kind of method and system of fast prediction flight path
Khosravi et al. A New Hybrid of Evolutionary and Conventional Optimization Algorithms
Burns et al. Experimental real-time heuristic search results in a video game
CN110490957B (en) 3D special effect display method, device and equipment of deformation animation of object
Garcia et al. UAV cooperative task allocation with communication delays and conflict resolution
CN116911202B (en) Agent training method and device based on multi-granularity simulation training environment

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
GR01 Patent grant
GR01 Patent grant