Strategy iteration algorithm and device

Through the strategy iteration algorithm and dynamic edge weight update, the problem of insufficient team collaboration and cohesion in the multi-agent pursuit and escape game is solved, and the intelligent collaboration between agents and the improvement of team cohesion are achieved.

CN118657170APending Publication Date: 2024-09-17NORTHWESTERN POLYTECHNICAL UNIV +1
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202411089847.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-09
Publication Date
2024-09-17

AI Technical Summary

Technical Problem

In the multi-agent pursuit and escape game scenario, since the topological relationship cannot be modified, team collaboration and cohesion are insufficient, the division of labor and collaboration goal allocation between agents are complicated, the calculation workload is large, and the relationship becomes complicated.

Method used

Propose a strategy iteration algorithm that dynamically updates edge weights and adjacency matrices through the state error of the tracker and evader, system value function, control strategy and exchange formula to achieve distance calculation and strategy adjustment between agents to ensure team collaboration and cohesion.

Benefits of technology

It improves team cohesion in the multi-agent pursuit and escape game. By dynamically adjusting strategies and edge rights, it solves the problem of insufficient team collaboration and cohesion, and achieves intelligent collaboration between agents.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118657170A
    Figure CN118657170A
Patent Text Reader

Abstract

The invention discloses a strategy iteration algorithm and device, relates to the technical field of multiple agents, and is used for solving the problem that team cooperation cannot be embodied due to the fact that a topological relation cannot be modified during cooperation and switching among multiple agents in the prior art. The algorithm comprises the following steps: according to a first state of a tracker in a # imgabs0 step, a first state of an evasion device in a # imgabs1 step and a state change amount of the evasion device in a # imgabs2 step, obtaining an update state of the tracker in a # imgabs3 step and an update state of the evasion device in a # imgabs4 step; determining a first distance between the tracker and the escape device according to an update state of the tracker in a # imgabs5 step and an update state of the escape device in a # imgabs6 step, if the first distance meets an exchange formula, exchanging an edge weight corresponding to the first distance according to the exchange formula, and updating an adjacent matrix; and if the absolute value of the difference value of the updated system value function and the first system value function is smaller than an error threshold value, determining the updated control strategy of the # imgabs7 step as a final control strategy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of multi-agent technology, and more specifically to a strategy iteration algorithm and device. Background Art

[0002] PE (Pursuers- Escapees) With the development of artificial intelligence technology, products such as drones and unmanned vehicles have emerged, and the demand for autonomous tracking, following and other control aspects has emerged. Therefore, PE games have become a prominent and interesting research topic and have attracted great attention. PE games involve one or more agents called pursuers, aiming to capture one or more agents called escapers. In the game, the escapers try to avoid being captured by the pursuers.

[0003] PE games first appeared in natural animal hunting scenarios. Later, as the concept of game theory was further developed, PE games have been widely used in the fields of drones, autonomous driving, mobile robot systems, perimeter security, and sports game strategies. In the case of multi-vehicle formation control and multi-drone formation control, there are complex topological relationships between multiple unmanned vehicles or drones. Each unmanned vehicle or each drone needs to track a specific target that matches itself, but the complex topological relationship is often determined and cannot be modified. Therefore, when multiple agents collaborate and switch with each other, teamwork and cohesion cannot be reflected. That is, in scenarios involving multiple agents, since multiple agents involve division of labor and allocation of collaborative goals, and the planning and calculation workload in multi-agent scenarios will be higher, the relationship between agents becomes more complicated. Summary of the invention

[0004] The embodiment of the present invention provides a strategy iteration algorithm and device to solve the problem that when multiple intelligent agents collaborate and switch, the team collaboration cannot be reflected because the topological relationship cannot be modified.

[0005] The embodiment of the present invention provides a policy iteration algorithm, including:

[0006] According to the tracker in The first state of step and the escaper in step The first state in the step determines the tracker and the evader in the The first state error of the step and the system in the The first system value function of the step; according to the system in the The first system value function, input function, and control quantity saturation threshold are obtained in turn in the first step. The first state value information in step The first state output information in step 1 and the The first control strategy of the step;

[0007] According to the The first control strategy and system state function are obtained in the first step. step; according to the tracker in the The first state of the step, the escaper in the The first state of the step and the The state change of the tracker in the first step is obtained The updated state of the step and the escaper in step The update status of the step;

[0008] According to the tracker in The updated state of the step and the escaper in step The update state of the step determines the first distance between the tracker and the evader. If the first distance satisfies the exchange formula, the edge weights corresponding to the first distance are exchanged according to the exchange formula, and the adjacency matrix is ​​updated;

[0009] If the system is in The updated system value function in step 1 is consistent with the system in step 2. The absolute value of the difference of the first system value function in the step is less than the error threshold. The updated system value function in step 1 is determined in The updated control strategy of the step will be The updated control strategy of the next step is determined as the final control strategy.

[0010] Preferably, the exchange formula is as follows:

[0011]

[0012] in, Indicates Tracker and The first distance between the escapers, , Indicates The tracker is in The update status of the step, Indicates The escaper is in The update status of the step, express Tracker Remove After the tracker, any tracker and the The second distance between the escapers, Indicates Trackers and The escaper removes the The third distance between any escapers after the escaper, Represents the total number of trackers, represents the total number of evaders, Indicates the swap threshold.

[0013] Preferably, the tracker and the evader are The first state error of the step is as follows:

[0014]

[0015] The system is in The first system cost function of the step is as follows:

[0016]

[0017] in, Indicates that the tracker is The escaper is in The first state error of the step, Indicates The escaper and The edge weights of the adjacency matrix of the trackers, Indicates The tracker is in The first state of the step, Indicates The escaper is in The first state of the step, Indicates the total number of trackers; Indicates that the system The first system value function of step , Indicates that the tracker is The escaper is in The distance difference between steps, Indicates The tracker is in The control quantity input of the step, Indicates The escaper is in The control quantity input of the step, represents the saturation threshold of the control amount of the tracker, represents the saturation threshold of the control amount of the evader, Indicates The tracker is in The first control strategy of the step, Indicates The escaper is in The first control strategy of the step, Indicates The in-degree of the tracker, , is a positive definite matrix of appropriate dimension, represents the total number of evaders, represents the integral variable, represents the current time, that is, the integration starts from the current moment, is the transpose symbol of the matrix.

[0018] Preferably, the The first state value information of the step is as follows:

[0019]

[0020] As stated in The first state output information of the step is as follows:

[0021]

[0022] in, Indicates The escaper is in The first state value information of the step, Indicates The escaper is in The first state output information of the step, Indicates The input function of the tracker is Indicates The input function of the escaper, represents the operation of finding the gradient, Indicates that the system The first system value function of step , represents the saturation threshold of the control amount of the tracker, represents the saturation threshold of the control amount of the evader, is a positive definite matrix of appropriate dimension.

[0023] Preferably, the The first control strategy in the first step includes the avoider The first control strategy and the tracker in the first step The first control strategy of the step, the escaper The first control strategy and the tracker in the first step The first control strategy of the step is as follows:

[0024]

[0025]

[0026] in, Indicates The tracker is in The first control strategy of the step, Indicates The escaper is in The first control strategy of the step, represents the saturation threshold of the control amount of the tracker, represents the saturation threshold of the control amount of the evader, Indicates The input function of the tracker is Indicates The input function of the escaper, Indicates that the system The first system value function of step , Represents the operation of finding the gradient.

[0027] Preferably, the The state change of the tracker in step The state change amount and escaper in step The state change of the tracker in step The state change amount of the step and the escaper in the The state change of a step is as follows:

[0028]

[0029]

[0030] in, Indicates The escaper is in The state change of the step, Indicates The tracker is in The state change of the step, Indicates The system state function of an evader, Indicates The system state function of a tracker, Indicates The input function of the escaper, Indicates The input function of the tracker is Indicates The escaper is in The first control strategy of the step; Indicates The tracker is in The first control strategy of the step.

[0031] Preferably, the tracker The updated state of the step and the escaper in step The update status of the step is as follows:

[0032]

[0033]

[0034] in, Indicates The tracker is in The update status of the step, Indicates The escaper is in The update status of the step, Indicates The tracker is in The first state of the step, Indicates The escaper is in The first state of the step, Indicates The escaper is in The state change of the step, Indicates The tracker is in The state change of the step.

[0035] An embodiment of the invention provides a policy iteration device, including:

[0036] The first obtaining unit is used to obtain the The first state of step and the escaper in step The first state in the step determines the tracker and the evader in the The first state error of the step and the system in the The first system value function of the step; according to the system in the The first system value function, input function, and control quantity saturation threshold are obtained in turn in the first step. The first state value information in step The first state output information of the step, The first control strategy of the step;

[0037] The second obtaining unit is used to obtain the The first control strategy and system state function are obtained in the first step. step; according to the tracker in the The first state of the step, the escaper in the The first state of the step, The state change of the tracker in the first step is obtained The updated state of the step and the escaper in step The update status of the step;

[0038] An updating unit is configured to update the tracker according to the The updated state of the step and the escaper in step The update state of the step determines the first distance between the tracker and the evader. If the first distance satisfies the exchange formula, the edge weights corresponding to the first distance are exchanged according to the exchange formula, and the adjacency matrix is ​​updated;

[0039] Determine the unit, used if the system is in the The updated system value function in step 1 is consistent with the system in step 2. The absolute value of the difference of the first system value function in the step is less than the error threshold. The updated system value function in step 1 is determined in The update control strategy of the step The updated control strategy of the next step is determined as the final control strategy.

[0040] An embodiment of the invention provides a computer device, the computer device comprising a memory and a processor, the memory storing a computer program, and when the computer program is executed by the processor, the processor executes the above-mentioned policy iteration algorithm.

[0041] An embodiment of the present invention provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, the processor executes the above-mentioned policy iteration algorithm.

[0042] The embodiment of the present invention provides a policy iteration algorithm and device, the algorithm comprising: according to the tracker in the first The first state of step and the escaper in step The first state in the step determines the tracker and the evader in the The first state error of the step and the system in the The first system value function of the step; according to the system in the The first system value function, input function, and control quantity saturation threshold are obtained in turn in the first step. The first state value information in step The first state output information of the step, The first control strategy in the first step; The first control strategy and system state function are obtained in the first step. step; according to the tracker in the The first state of the step, the escaper in the The first state of the step, The state change of the tracker in the first step is obtained The updated state of the step and the escaper in step step; according to the tracker in the The updated state of the step and the escaper in step The update state of the step determines the first distance between the tracker and the evader. If the first distance satisfies the exchange formula, the edge weights corresponding to the first distance are exchanged according to the exchange formula, and the adjacency matrix is ​​updated; if the system is in the first The updated system value function in step 1 is consistent with the system in step 2. The absolute value of the difference of the first system value function in the step is less than the error threshold. The updated system value function in step 1 is determined in The update control strategy of the step The updated control strategy of the step is determined as the final control strategy. The algorithm can determine the first control strategy and the updated control strategy of each evader and each tracker in the continuous iteration process, and determine whether to obtain the final control strategy or repeat the iteration based on the relationship between the first system value function and the updated system value function in the continuous iteration; at the same time, based on the relationship between the first distance between each tracker and each evader determined in the iteration process and the exchange formula, the edge weights can be dynamically exchanged, solving the technical defects of the existing multi-agent scenario team collaboration and cohesion; the algorithm combines the strategy iteration algorithm to realize the intelligent collaboration of multiple agents in the multi-agent pursuit and escape game process, thereby improving the team cohesion. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0044] Figure 1 A schematic diagram of a strategy iteration algorithm flow provided by an embodiment of the present invention;

[0045] Figure 2 A schematic diagram of the trajectory capture results of three trackers and three evaders provided in an embodiment of the present invention;

[0046] Figure 3 A schematic diagram of a tracking process curve diagram of a tracker provided in an embodiment of the present invention;

[0047] Figure 4 A schematic diagram of the structure of a strategy iteration algorithm device provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0048] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0049] Figure 1 A schematic diagram of a strategy iteration algorithm flow chart provided by an embodiment of the present invention, such as Figure 1 As shown, the algorithm includes the following steps:

[0050] Step 101, according to the tracker The first state of step and the escaper in step The first state in the step determines the tracker and the evader in the The first state error of the step and the system in the The first system value function of the step; according to the system in the The first system value function, input function, and control quantity saturation threshold are obtained in turn in the first step. The first state value information in step The first state output information of the step, The first control strategy of the step;

[0051] Step 102, according to The first control strategy and state function of the first step are obtained in step; according to the tracker in the The first state of the step, the escaper in the The first state of the step, The state change of the tracker in the first step is obtained The updated state of the step and the escaper in step The update status of the step;

[0052] Step 103, according to the tracker The updated state of the step and the escaper in step The update state of the step determines the first distance between the tracker and the evader, and if the first distance satisfies the exchange formula, the edge weights corresponding to the first distance are exchanged according to the exchange formula, and the adjacency matrix is ​​updated;

[0053] Step 104, if the system The updated system value function in step 1 is consistent with the system in step 2. The absolute value of the difference of the first system value function in the step is less than the error threshold. The updated system value function in step 1 is determined in The update control strategy of the step The updated control strategy of the next step is determined as the final control strategy.

[0054] In practical applications, in multi-agent pursuit-escape game problems, the dynamic independent individuals in motion are called agents, and agents are divided into two types: pursuers and evaders. In multi-agent pursuit-escape game problems, the goal of the pursuer is to get as close to the evader as possible, while the goal of the evader is to get as far away from the pursuer as possible.

[0055] The strategy iteration algorithm of the multi-agent pursuit-escape game in the embodiment of the present invention is used to update and iterate the strategy of each agent in real time according to the situation of the pursuit-escape game. The agent receives the strategy and converts it into corresponding actions. In order to measure the quality of the action results of the agent, use Indicates that the system The first system value function of the step, the larger the value of the system value function, the better the action result of the tracker is, and the worse the action result of the evader is; and the smaller the value of the system value function, the worse the action result of the tracker is, and the better the action result of the evader is. The modeling process of the multi-agent pursuit and escape game contains many parameters. Before the strategy iteration algorithm runs, the parameters of the modeling process need to be initialized.

[0056] Before step 101, the parameters in the modeling process are initialized, including:

[0057] 1) represents the error threshold, which can be set according to the specific accuracy requirements. In the embodiment of the present invention, The value range of is [0,1].

[0058] 2) Indicates the step length of the simulation process. In the embodiment of the present invention, the number of iteration steps , that is, The initial value of the step is set to 0.

[0059] 3) Represents the total number of trackers, represents the total number of escapers. In the embodiment of the present invention, and It can be set according to needs. The theoretical value is [0,10].

[0060] 4) represents the exchange threshold, which can be set according to the specific accuracy requirements. In the embodiment of the present invention, The value range of is [0,50].

[0061] 5) Indicates The escaper and The edge weights of the adjacency matrix of the trackers, Represents the adjacency matrix. is a matrix If the internal element The tracking target of the tracker is escapers, then the corresponding edge weight of the adjacency matrix ,on the contrary The edge weights are stored in the adjacency matrix middle, yes OK The matrix of columns, for the corresponding and Value, adjacency matrix No. Line The column elements are .

[0062] In step 101, the tracker The first state of step and the escaper in step The first state in the step can also be called the tracker in the first The initial state of the step and the escaper in the In the embodiment of the present invention, since the algorithm involves iterations and some terms involved in two adjacent steps will be compared during the iteration, in order to avoid confusion caused by multiple references to the same term during the iteration, in the embodiment of the present invention, the same term will be used at the same time in the first step. Step and in Add "first" and "update" to the terms that appear in the first step, e.g., the tracker The initial state of the tracker at step The first state of the tracker in step The state of the tracker at step The update status of the step.

[0063] According to the tracker in The first state of step and the escaper in step The first state in the step can be used to determine the in-degree of the tracker according to formula (1):

[0064] (1)

[0065] in, Indicates The in-degree of the tracker, Indicates The escaper and The edge weights of the adjacency matrix of the trackers, Indicates the total number of evaders.

[0066] In practical applications, the number of trackers and evaders may include multiple, further, according to the tracker in the first The first state of step and the escaper in step The first state in the step determines the number of evaders corresponding to each tracker, that is, the number of target evaders for each tracker; further, the number of evaders corresponding to each tracker can be determined according to the tracker in the first state. The first state of the step, the escaper in the The first state in step 1 determines the relationship between the tracker and the evader in step 2. The first state error of the tracker and the evader in the The first state error of the step is as follows:

[0067] (2)

[0068] in, Indicates that the tracker is The escaper is in The first state error of the step, Indicates The escaper and The edge weights of the adjacency matrix of the trackers, Indicates The tracker is in The first state of the step, Indicates The escaper is in The first state of the step, Indicates the total number of trackers.

[0069] Further, when the tracker and the evader are determined in the After the first state error of the step, the tracker and the evader can be The first state error, the saturation threshold of the control quantity and the in-degree of the tracker determine the system in the first step. The first system value function of the step, the system in the The first system cost function of the step is as follows:

[0070] (3)

[0071] in, Indicates that the tracker is The escaper is in The first state error of the step, Indicates The escaper and The edge weights of the adjacency matrix of the trackers, Indicates The tracker is in The first state of the step, Indicates The escaper is in The first state of the step, Indicates the total number of trackers; Indicates that the system The first system value function of step , Indicates that the tracker is The escaper is in The distance difference between steps, Indicates The tracker is in The control quantity input of the step, Indicates The escaper is in The control quantity input of the step, represents the saturation threshold of the control amount of the tracker, represents the saturation threshold of the control amount of the evader, Indicates The tracker is in The first control strategy of the step, Indicates The escaper is in The first control strategy of the step, Indicates The in-degree of the tracker, , is a positive definite matrix of appropriate dimension, is a predefined term, represents the total number of evaders, represents the integral variable, represents the current time, that is, the integration starts from the current moment, is the transpose symbol of the matrix.

[0072] Further, when determining the system in the After the first system value function of step , according to the system in step The first system value function, input function, and saturation threshold of the control amount are obtained in the first step. The first state value information in step 1 and the The first state output information of the step is as follows:

[0073] (4-1)

[0074] (4-2)

[0075] in, Indicates The escaper is in The first state value information of the step, Indicates The escaper is in The first state output information of the step, Indicates The input function of the tracker is Indicates The input function of the escaper, represents the operation of finding the gradient, Indicates that the system The first system value function of step , represents the saturation threshold of the control amount of the tracker, represents the saturation threshold of the control amount of the evader, is a positive definite matrix of appropriate dimension.

[0076] It should be noted that, in the embodiment of the present invention, the input function includes the input function of the tracker and the input function of the evader; the saturation threshold of the control amount includes the saturation threshold of the tracker control amount and the saturation threshold of the evader control amount.

[0077] In the embodiment of the present invention, The first control strategy in the first step includes the avoider The first control strategy and the tracker in the first step The first control strategy of the step, in which the evader is The first control strategy and the tracker in the first step The first control strategy of the step is determined by the following formula:

[0078] (5-1)

[0079] (5-2)

[0080] in, Indicates The tracker is in The first control strategy of the step, Indicates The escaper is in The first control strategy of the step, represents the saturation threshold of the control amount of the tracker, represents the saturation threshold of the control amount of the evader, Indicates The input function of the tracker is Indicates The input function of the escaper, Indicates that the system The first system value function of step , is a positive definite matrix of appropriate dimension, Represents the operation of finding the gradient.

[0081] In step 102, the system state function includes the first The system state function of the evader and the The system state function of the tracker is obtained according to step 101. The tracker is in The first control strategy of the first step, The escaper is in The first control strategy of the first step, The system state function of the evader and the The system state function of each tracker is determined by the following formula: The state change amount of the step and the escaper in the The state change of the step:

[0082] (6-1)

[0083] (6-2)

[0084] in, Indicates The escaper is in The state change of the step, Indicates The tracker is in The state change of the step, Indicates The system state function of an evader, Indicates The system state function of a tracker, Indicates The input function of the escaper, Indicates The input function of the tracker is Indicates The escaper is in The first control strategy of the step, Indicates The tracker is in The first control strategy of the step.

[0085] In the embodiment of the present invention, the state update method for the next iteration step is based on the following rules: The state change amount of the step, the escaper in the The state change of the tracker in step The first state of step and the escaper in step The first state in the step is obtained by the following formula. The updated state of the step and the escaper in step The updated state of the tracker in step The updated state of the step and the escaper in step The update status of the step is as follows:

[0086] (7-1)

[0087] (7-2)

[0088] in, Indicates The tracker is in The update status of the step, Indicates The escaper is in The update status of the step, Indicates The tracker is in The first state of the step, Indicates The escaper is in The first state of the step, Indicates The escaper is in The state change of the step, Indicates The tracker is in The state change of the step.

[0089] In step 103, according to the tracker The updated state and escaper of step The update state of the step determines the first distance between the tracker and the evader, and determines whether the first distance satisfies the exchange formula. Specifically, the first distance between the tracker and the evader is determined by the following formula:

[0090] (8)

[0091] in, Indicates Tracker and The first distance between the escapers, Indicates The tracker is in The update status of the step, Indicates The escaper is in The update status of the step.

[0092] Further, the exchange formula is as follows:

[0093] (9)

[0094] in, Indicates Tracker and The first distance between the escapers, express Any one of the tracking express Tracker Remove After the tracker, any tracker and the The second distance between the escapers, Indicates Trackers and The escaper removes the The third distance between any escapers after the escaper, Represents the total number of trackers, represents the total number of evaders, Indicates the swap threshold.

[0095] For example, if the number of trackers and evaders is 3, the 3 trackers are in the The update states of the steps are , and ; 3 escapers in the first The update states of the steps are , and Furthermore, the first distance between each tracker and each evader can be determined according to formula (8), and the first distances are , , , , , , , and .

[0096] In the embodiment of the present invention, if it is necessary to determine the first distance When the exchange formula is satisfied, the exchange formula can have the following variations:

[0097] (9-1)

[0098] (9-2)

[0099] (9-3)

[0100] (9-4)

[0101] It should be noted that in the above several exchange formulas, because the first distance is , so what needs to be determined is the first distance between the first tracker and the first evader, and the above embodiment includes 3 trackers and 3 evaders, so middle Can be 2 or 3, represents the second distance between the second pursuer and the first evader, represents the second distance between the third pursuer and the first evader; correspondingly, In It can only be 2 or 3. represents the third distance between the first pursuer and the second evader, represents the third distance between the first tracker and the third evader. In this embodiment, if any one of the above formulas (9-1), (9-2), (9-3) and (9-4) is true, the first distance can be determined If the exchange formula is satisfied, the edge weights can be exchanged; if the above formulas (9-1), (9-2), (9-3) and (9-4) are not true, then the first distance is determined The exchange formula is not satisfied and edge weight exchange is not performed.

[0102] Furthermore, according to the definition of the adjacency matrix, when the number of trackers and evaders is 3, the adjacency matrix can be expressed by the following formula:

[0103] (10)

[0104] Among them, edge weight Represents the tracking relationship between the tracker and the evader. When the tracker Evader To track the target, The value of is 1, otherwise it is 0. In this embodiment, if the tracker and the evader exchange the tracking targets, their corresponding edge weights will also be exchanged.

[0105] In step 104, when it is determined that the tracker is at The updated state and escaper of step After the updated state of the step, the tracker and the evader can be determined according to formula (2) in the first Then, the updated state error of the system in the first step is obtained by formula (3). The updated system value function.

[0106] Furthermore, if the system The updated system value function in step 1 is consistent with the system in step 2. The absolute value of the difference of the first system value function in the step is less than the error threshold, that is, it satisfies formula (10). The updated system value function, input function, and control quantity saturation threshold are obtained in turn through formulas (4-1) and (4-2) in the first step. The updated state value information in step The updated state output information of step 1 and the escaper in step 2 The updated control strategy and tracker in step Step-by-step update control strategy.

[0107] Specifically, formula (11) is as follows:

[0108] (11)

[0109] in, Indicates that the system The first system value function of step , Indicates that the system The updated system value function of step Indicates the error threshold.

[0110] In the embodiment of the present invention, when it is determined that the escaper is in the The updated control strategy and tracker in step After updating the control strategy in the first step, the evader The updated control strategy and tracker in step The updated control strategy of the first step is determined as the final control strategy, and the final control strategy is output. The final control strategy here includes the evader in the first The updated control strategy and tracker in step The updated control strategy of the step is , therefore, the final control strategy can also be called the final control strategy pair.

[0111] Furthermore, if the system The updated system value function in step 1 is consistent with the system in step 2. If the absolute value of the difference between the first system value function of the step is not less than the error threshold, it is necessary to return to step 101 and re-execute steps 101-104 until the absolute value of the difference between the first system value function determined in the previous step and the updated system value function determined in the current step is less than the error threshold in two consecutive adjacent iterations.

[0112] In the embodiment of the present invention, when the final control strategy is output, it also indicates that the simulation is over and the task of the multi-agent pursuit and escape game is completed.

[0113] Figure 2 The following is a schematic diagram of the trajectory capture results of three trackers and three evaders provided in an embodiment of the present invention. Figure 2 Taking this as an example, the policy iteration algorithm provided by the embodiment of the present invention is described in detail.

[0114] like Figure 2 As shown, there are 3 trackers and 3 evaders, which are the 1st tracker, the 2nd tracker, the 3rd tracker, the 1st evader, the 2nd evader and the 3rd evader.

[0115] In order to unify the terminology with the above embodiments, the initial state of the first tracker is referred to as the state of the first tracker in the The first state of the step, according to Figure 2 It can be seen that the first tracker is The first state of the step is [260,-2800], the second tracker is The first state of the step is [-380, 3100], the third tracker is The first state of the step is [2500, -3280]. Accordingly, the first escaper is The first state of the step is [1037, 360], the second escaper is in The first state of the step is [520, 1030], the third escaper is in The first state of the step is [1820, -1890].

[0116] In this embodiment, at the beginning of the simulation, since the target of the first tracker is the first evader, the target of the second tracker is the second evader, and the target of the third tracker is the third evader, it can be determined that the edge weight of the adjacency matrix between the first tracker and the first evader is 1, that is, ; The edge weight of the adjacency matrix of the second tracker and the second evader is 1, that is, ; The edge weight of the adjacency matrix of the third tracker and the third evader is 1, that is, . The other edge weights are all 0. For example, the edge weight of the adjacency matrix of the second tracker and the first evader is 0, that is, .

[0117] Furthermore, the in-degree of the three trackers can be determined by formula (1). Specifically, the in-degree of the first tracker is 1, that is, , the in-degree of the second tracker is 1, that is, , the in-degree of the third tracker is 1, that is, .

[0118] In this embodiment, the saturation threshold of the control amount of the evader and the saturation threshold of the control amount of the tracker are respectively , ; Iteration steps , error threshold .

[0119] Further, according to formula (2), the relationship between each tracker and the The escaper is in The first state error of the step, where are equal to 1, 2 and 3 respectively, that is, the tracker and the first evader are obtained in the The first state error of the step, the tracker and the second evader in the The first state error of the step and the tracker and the third escaper are The first state error of the step: , and .

[0120] When you get the tracker and The escaper is in After the first state error of the step, the tracker and the evader can be The first state error of the step, the saturation threshold of the control amount of the evader, the saturation threshold of the control amount of the tracker and the in-degree of the tracker determine the system in the first The first system value function of the step, where are equal to 1, 2 and 3 respectively, that is, according to formula (3), the system is determined in the The first system value function of step: and .

[0121] Furthermore, combined with The input function of the tracker , No. The input function of the escaper , the saturation threshold of the control quantity of the tracker and the saturation threshold of the control amount of the evader The first The escaper is in The first state value information of the step and The escaper is in The first state output information of the step ,here and are equal to 1, 2 and 3 respectively, that is, we get: , , , , and .

[0122] According to formula (5-1) and formula (5-2), the evader is determined in the The first control strategy and the tracker in the first step The first control strategy of the step, since the number of evaders and trackers in this embodiment is 3 respectively, therefore, it is necessary to determine the first control strategies of the three evaders and the first control strategies of the three trackers in turn, which are respectively: , , and .

[0123] Further, according to each tracker determined above, The first control strategy of the step, each escaper in the The first control strategy of the step, the system state function of each evader and the system state function of each tracker can be determined by formula (6-1) and formula (6-2) at the first step. The state change of step and each escaper in step The state change of the step is: , , , , and .

[0124] After getting each escaper in The state change of each tracker at step After the state change in step , each escaper can be combined in step The first state of the step ( , and ), each tracker The first state in the step ( , and ) get each escaper in turn in the The updated state of each tracker at step The updated state of the step is obtained according to formula (7-1) and formula (7-2) in turn. The update status of the step ( , and ) and each tracker in The update status of the step ( , and ).

[0125] In the embodiment of the present invention, when determining each escaper in the first The updated state of each tracker at step After the updated state of the step, the first distance between each evader and each tracker can be determined by formula (8), that is, , , , , , , , and .

[0126] Then, according to the exchange formula shown in formula (9), it is determined whether the first distance between each evader and each tracker satisfies the exchange formula. If so, the edge weights are exchanged, otherwise they are not exchanged. Specifically, according to formula (10) of the adjacency matrix, in this embodiment, , and The value of is 1, and the values ​​of other items are 0. Therefore, the specific values ​​of the adjacency matrix in this embodiment are:

[0127] (10-1)

[0128] In this embodiment, since the exchange condition is triggered at the time s=29, that is, , and the corresponding edge weights are exchanged. Further, is set to 0, is set to 0, is set to 1, is set to 1, at which point the target of the third tracker is changed to the first evader, and the target of the first tracker is changed to the third evader. After the adjacency matrix exchanges edge weights, the values ​​of the adjacency matrix are iterated, and the adjacency matrix of the iterated values ​​is shown below:

[0129] (10-2)

[0130] Next, since each evader has been determined in The updated state of each tracker at step The updated state of the step, so according to formula (2), the tracker and the evader in the first The updated state error of the system in the first step is obtained according to formula (3). The updated system value function.

[0131] Furthermore, when the system is determined according to formula (11) The updated system value function in step 1 is consistent with the system in step 2. If the absolute value of the difference of the first system value function in the step is less than the error threshold, the system can The updated system value function, input function, and control quantity saturation threshold are obtained in turn through formulas (4-1), (4-2), (5-1), and (5-2) in the first step. The updated state value information in step The updated state output information of step 1 and the escaper in step 2 The updated control strategy and tracker in step The update control strategy of the step; finally, the escaper is The updated control strategy and tracker in step The updated control strategy of the step is determined as the final control strategy, and the final control strategy is output.

[0132] When the system is The updated system value function in step 1 is consistent with the system in step 2. When the absolute value of the difference between the first system value function of the step is not less than the error threshold, the above process can be repeated until the absolute value of the difference between the first system value function determined in the previous step and the updated system value function determined in the current step in two consecutive adjacent iterations is less than the error threshold.

[0133] Figure 3 A schematic diagram of a tracking process curve diagram of a tracker provided in an embodiment of the present invention, such as Figure 3 As shown in Figure 2, at the end of the simulation, each tracker successfully tracks its new target. trackers and their corresponding The state error between the escapers The sum is defined as the team state error, where the state error In The team state error is used to reflect the team cohesion of the tracker. The smaller the team state error, the stronger the team cohesion. By comparing the curves, it can be seen that the tracker using the dynamic target graph algorithm can reduce the team state error faster and show better team cohesion.

[0134] In summary, an embodiment of the present invention provides a policy iteration algorithm and device, which can determine the first control strategy and updated control strategy of each evader and each tracker in a continuous iteration process, and determine whether to obtain the final control strategy or repeat the iteration based on the relationship between the first system value function and the updated system value function in the continuous iteration; at the same time, based on the relationship between the first distance between each tracker and each evader determined in the iteration process and the exchange formula, the algorithm can dynamically exchange edge weights, thereby solving the technical defects of insufficient team collaboration and cohesion in existing multi-agent scenarios; the algorithm is combined with a strategy iteration algorithm, and in the process of multi-agent pursuit and escape game, it realizes intelligent collaboration within multiple agents, thereby improving team cohesion.

[0135] Based on the same inventive concept, an embodiment of the present invention provides a strategy iteration device. Since the principle of the device in solving the technical problem is similar to that of a strategy iteration algorithm, the implementation of the device can refer to the implementation of the algorithm, and the repeated parts will not be repeated.

[0136] like Figure 4 As shown, the device mainly includes a first obtaining unit 201, a second obtaining unit 202, an updating unit 203 and a determining unit 204.

[0137] The first obtaining unit 201 is used to obtain the The first state of step and the escaper in step The first state in the step determines the tracker and the evader in the The first state error of the step and the system in the The first system value function of the step; according to the system in the The first system value function, input function, and control quantity saturation threshold are obtained in turn in the first step. The first state value information in step The first state output information of the step, The first control strategy of the step;

[0138] The second obtaining unit 202 is used to obtain The first control strategy and system state function are obtained in the first step. step; according to the tracker in the The first state of the step, the escaper in the The first state of the step, The state change of the tracker in the first step is obtained The updated state of the step and the escaper in step The update status of the step;

[0139] The updating unit 203 is configured to update the tracker according to the The updated state of the step and the escaper in step The update state of the step determines the first distance between the tracker and the evader. If the first distance satisfies the exchange formula, the edge weights corresponding to the first distance are exchanged according to the exchange formula, and the adjacency matrix is ​​updated;

[0140] The determination unit 204 is used for determining that if the system The updated system value function in step 1 is consistent with the system in step 2. The absolute value of the difference of the first system value function in the step is less than the error threshold. The updated system value function in step 1 is determined in The update control strategy of the step The updated control strategy of the next step is determined as the final control strategy.

[0141] It should be understood that the units included in the above-mentioned strategy iteration device are only logical divisions based on the functions implemented by the device. In practical applications, the above-mentioned units can be superimposed or split. And the functions implemented by the strategy iteration device provided in this embodiment correspond one-to-one to the strategy iteration algorithm provided in the above-mentioned embodiment. The more detailed processing flow implemented by the device has been described in detail in the above-mentioned algorithm embodiment 1 and will not be described in detail here.

[0142] Another embodiment of the present invention also provides a computer device, which includes: a processor and a memory; the memory is used to store computer program code, and the computer program code includes computer instructions; when the processor executes the computer instructions, the electronic device executes each step of the policy iteration algorithm shown in the above algorithm embodiment.

[0143] Another embodiment of the present invention further provides a computer-readable storage medium, in which computer instructions are stored. When the computer instructions are executed on a computer device, the computer device executes each step of the policy iteration algorithm shown in the above algorithm embodiment.

[0144] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.

[0145] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.

Claims

1. A policy iteration algorithm, characterized in that: include: According to the tracker in The first state of step and the escaper in step The first state in the step determines the tracker and the evader in the The first state error of the step and the system in the The first system value function of the step; according to the system in the The first system value function, input function, and control quantity saturation threshold are obtained in turn in the first step. The first state value information in step The first state output information in step 1 and the The first control strategy of the step; According to the The first control strategy and system state function are obtained in the first step. step; according to the tracker in the The first state of the step, the escaper in the The first state of the step and the The state change of the tracker in the first step is obtained The updated state of the step and the escaper in step The update status of the step; According to the tracker in The updated state of the step and the escaper in step The update state of the step determines the first distance between the tracker and the evader. If the first distance satisfies the exchange formula, the edge weights corresponding to the first distance are exchanged according to the exchange formula, and the adjacency matrix is ​​updated; If the system is in The updated system value function in step 1 is consistent with the system in step 2. The absolute value of the difference of the first system value function in the step is less than the error threshold. The updated system value function in step 1 is determined in The updated control strategy of the step will be The updated control strategy of the next step is determined as the final control strategy.

2. The policy iteration algorithm according to claim 1, characterized in that: The exchange formula is as follows: in, Indicates Tracker and The first distance between the escapers, , Indicates The tracker is The update status of the step, Indicates The escaper is in The update status of the step, express Tracker Remove After the tracker, any tracker and the The second distance between the escapers, Indicates Trackers and The escaper removes the The third distance between any escapers after the escaper, Represents the total number of trackers, represents the total number of evaders, Indicates the swap threshold.

3. The policy iteration algorithm according to claim 1, characterized in that: The tracker and the evader are The first state error of the step is as follows: The system is in The first system cost function of the step is as follows: in, Indicates that the tracker is The escaper is in The first state error of the step, Indicates The escaper and The edge weights of the adjacency matrix of the trackers, Indicates The tracker is The first state of the step, Indicates The escaper is in The first state of the step, Indicates the total number of trackers; Indicates that the system The first system value function of step , Indicates that the tracker is The escaper is in The distance difference between steps, Indicates The tracker is The control quantity input of the step, Indicates The escaper is in The control quantity input of the step, represents the saturation threshold of the control amount of the tracker, represents the saturation threshold of the control amount of the evader, Indicates The tracker is The first control strategy of the step, Indicates The escaper is in The first control strategy of the step, Indicates The in-degree of the tracker, is a positive definite matrix of appropriate dimension, represents the total number of evaders, represents the integral variable, represents the current time, that is, the integration starts from the current moment, is the transpose symbol of the matrix.

4. The policy iteration algorithm according to claim 1, characterized in that: As stated in The first state value information of the step is as follows: As stated in The first state output information of the step is as follows: in, Indicates The escaper is in The first state value information of the step, Indicates The escaper is in The first state output information of the step, Indicates The input function of the tracker is Indicates The input function of the escaper, represents the operation of finding the gradient, Indicates that the system The first system value function of step , represents the saturation threshold of the control amount of the tracker, represents the saturation threshold of the control amount of the evader, is a positive definite matrix of appropriate dimension.

5. The policy iteration algorithm according to claim 1, characterized in that: Said in The first control strategy in the first step includes the avoider The first control strategy and the tracker in the first step The first control strategy of the step, the escaper The first control strategy and the tracker in the first step The first control strategy of the step is as follows: in, Indicates The tracker is The first control strategy of the step, Indicates The escaper is in The first control strategy of the step, represents the saturation threshold of the control amount of the tracker, represents the saturation threshold of the control amount of the evader, Indicates The input function of the tracker is Indicates The input function of the escaper, Indicates that the system The first system value function of step , is a positive definite matrix of appropriate dimension, Represents the operation of finding the gradient.

6. The policy iteration algorithm according to claim 1, characterized in that: As stated in The state change of the tracker in step The state change amount and escaper in step The state change of the tracker in step The state change amount of the step and the escaper in the The state change of a step is as follows: in, Indicates The escaper is in The state change of the step, Indicates The tracker is The state change of the step, Indicates The system state function of an evader, Indicates The system state function of a tracker, Indicates The input function of the escaper, Indicates The input function of the tracker is Indicates The escaper is in The first control strategy of the step; Indicates The tracker is The first control strategy of the step.

7. The policy iteration algorithm according to claim 1, characterized in that: The tracker is in The updated state of the step and the escaper in step The update status of the step is as follows: in, Indicates The tracker is The update status of the step, Indicates The escaper is in The update status of the step, Indicates The tracker is The first state of the step, Indicates The escaper is in The first state of the step, Indicates The escaper is in The state change of the step, Indicates The tracker is The state change of the step.

8. A strategy iteration device, characterized in that: include: The first obtaining unit is used to obtain the The first state of step and the escaper in step The first state in the step determines the tracker and the evader in the The first state error of the step and the system in the The first system value function of the step; according to the system in the The first system value function, input function, and control quantity saturation threshold are obtained in turn in the first step. The first state value information in step The first state output information of the step, The first control strategy of the step; The second obtaining unit is used to obtain the The first control strategy and system state function are obtained in the first step. step; according to the tracker in the The first state of the step, the escaper in the The first state of the step, The state change of the tracker in the first step is obtained The updated state of the step and the escaper in step The update status of the step; An updating unit is configured to update the tracker according to the The updated state of the step and the escaper in step The update state of the step determines the first distance between the tracker and the evader. If the first distance satisfies the exchange formula, the edge weights corresponding to the first distance are exchanged according to the exchange formula, and the adjacency matrix is ​​updated; Determine the unit, used if the system is in the The updated system value function in step 1 is consistent with the system in step 2. The absolute value of the difference of the first system value function in the step is less than the error threshold. The updated system value function in step 1 is determined in The update control strategy of the step The updated control strategy of the next step is determined as the final control strategy.

9. A computer device, characterized in that: The computer device includes a memory and a processor, the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the policy iteration algorithm according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: A computer program is stored, and when the computer program is executed by a processor, the processor executes the policy iteration algorithm as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Game interaction method and system based on close connection, server and storage medium

    CN113117323A

  • Multi-agent pursuit game method and device based on reinforcement learning

    CN115952729A

  • Data-driven adaptive dynamic planning air combat decision-making method

    CN116880186A

  • Spacecraft pursuit game control solving method based on adaptive dynamic programming

    CN117034745A

  • Trilateral orbit game control method based on pulse control

    CN117068394A