Multi-agent cluster task planning method and system
By building a target information matrix in the cluster agent system and using clustering algorithms and random forest methods to group agents, the problem of cluster agents coordinating conflicts and cooperation in a dynamic environment is solved, and the system benefits are maximized and tasks are efficiently completed.
Patent Information
- Application Number
- CN202411493644.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-24
- Publication Date
- 2025-03-04
AI Technical Summary
In a dynamically changing, incompletely considerable and incompletely controllable environment, it is difficult for cluster agents to coordinate conflicts and cooperation between agents to maximize the overall benefits of the system.
By collecting environmental information, building a target information matrix, partitioning multiple targets using the k-means clustering algorithm, the random forest method evaluates the importance of each area, determines the number of agents, and grouping cluster agents based on the importance and quantity requirements.
Adaptive grouping between agents is realized, and each group of agents is responsible for tasks in the corresponding area, so as to complete the task planning of the multi-agent cluster while ensuring the shortest task completion time and the shortest total distance of the agent moving.
Smart Images

Figure CN119558566A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to task planning technology, and in particular to a multi-agent cluster task planning method and system. Background Art
[0002] Swarm agents are systems composed of multiple autonomous, collaborative, and learning agents that can perform various tasks in complex environments. Task planning refers to assigning appropriate subtasks to each agent based on the task's goals, constraints, and environment, and coordinating the behaviors between agents to achieve optimal or suboptimal system performance.
[0003] Swarm agents are usually in a dynamically changing, incompletely observable, and incompletely controllable environment, which brings difficulties to the perception, decision-making, and collaboration of agents. Agents in a swarm agent system may have different goals, capabilities, preferences, and constraints, which requires the design of appropriate collaboration mechanisms to coordinate conflicts and cooperation between agents and maximize the overall benefits of the system. However, there is currently no optimal solution to the above problems. DETAILED DESCRIPTION
[0004] The purpose of the present invention is to provide a multi-agent cluster task planning method and system to coordinate conflicts and cooperation between agents and maximize the overall benefits of the system.
[0005] The technical solution for achieving the purpose of the present invention is:
[0006] A swarm agent task planning method, characterized by comprising:
[0007] Collect environmental information and build a target information matrix;
[0008] Based on the target information matrix, multiple targets are partitioned using the k-means clustering algorithm;
[0009] The random forest method was used to assess the importance of each district;
[0010] Determine the number of agents required in each area based on the importance of each area;
[0011] Cluster agents are grouped based on importance and quantity requirements.
[0012] Furthermore, the target information matrix is:
[0013]
[0014] Among them, m is the number of targets, id is the target number, long id is longitude, lat id is the latitude.
[0015] Furthermore, the partitioning of multiple targets by using the k-means clustering algorithm specifically includes:
[0016] Step 2-1: According to the rule of finding the point farthest from the cluster center array added, for initializing the cluster center, k data points are selected from the target information as the center data. The center data matrix P is expressed as:
[0017]
[0018] Step 2-2, calculate the distance between each data point in the target information and the k center data. If each data point is closest to a certain center, then this data point is considered to belong to the category of this center, and calculate the average error; the calculation formula for the data point distance to these k centers is:
[0019]
[0020] The formula for calculating the average error is:
[0021]
[0022] Among them, C i is the i-th category, n is C i The data points in p i It is C i The center of the cluster, SSE is the clustering error of all data points, which represents the quality of clustering effect;
[0023] Step 2-3: Calculate the average value of the data points in each category as the new center of the k categories.
[0024] Step 2-4: According to the new centers of the k categories, each data point in the target information is re-allocated and the average error is calculated; compare whether the average errors before and after are equal. If they are not equal, loop from step 2-2 to step 2-3, otherwise terminate the loop;
[0025] Step 2-5: Use the Elbow method to determine the optimal number of target partitions.
[0026] Furthermore, the distance between each data point in the target information and the k center data is:
[0027]
[0028] The average error is:
[0029]
[0030] Among them, C i is the i-th category, n is Ci The data points in p i It is C i The SSE is the center of the clustering error of all data points, indicating the quality of the clustering effect.
[0031] Furthermore, the new centers of the k categories in steps 2-3 are:
[0032]
[0033] Among them, p i Represents the center long of category i n represents the longitude of data point n of category i, represents the latitude of data point n of category i, Represents the number of data points in category i.
[0034] Furthermore, the random forest method is used to evaluate the importance of each area, including:
[0035] Step 3-1, collect various data related to task planning, annotate the data, and determine the data set and evaluation set;
[0036] Step 3-2, randomly select a certain number of samples from the data set. For each decision tree, when selecting a split node, randomly select some features from all features, and then select the best feature from them for node splitting;
[0037] Step 3-3, repeat step 3-2 to build multiple decision trees, each of which is trained on a different random subset of the data set;
[0038] Step 3-4, obtain a prediction value through each decision tree, and take the average of these prediction values as the final importance evaluation result;
[0039] Steps 3-5: Use the evaluation set to optimize the model;
[0040] Steps 3-6 use the optimized and adjusted model to generate the importance of each area.
[0041] Furthermore, determining the number of intelligent agents required in each district according to the importance of each district specifically includes: first, constructing a mapping table of importance and intelligent agent requirements, and determining the minimum intelligent agent requirement for each district according to the importance of each district; then, subtracting the minimum intelligent agent requirement for each district from the number of intelligent agents, and if there is a surplus, evenly distribute it to each district to determine the final demand for each district.
[0042] Furthermore, grouping the cluster agents specifically includes: transforming the agent grouping problem into a task allocation problem and constructing the objective function:
[0043]
[0044] The constraints are:
[0045]
[0046] Among them, Z is the total weight function value of the target, which represents the maximized execution high-value target area, c j represents the importance value of the jth target area; x j is a decision variable, indicating whether the target area j is executed. If it is executed, it is 1, otherwise it is 0; a rj represents the number of agents r required to perform task j, b r is the total number of agents of the current class; the agent results corresponding to each target area obtained by solving the model are grouped into the same group.
[0047] A swarm agent task planning system, comprising:
[0048] Environmental information acquisition unit, which collects environmental information and builds a target information matrix;
[0049] The partitioning unit partitions multiple targets using the k-means clustering algorithm based on the target information matrix;
[0050] Importance determination unit, random forest method was used to evaluate the importance of each district;
[0051] An agent quantity requirement determination unit determines the agent quantity requirement of each area according to the importance of each area;
[0052] The agent grouping unit groups cluster agents based on importance and quantity requirements.
[0053] A computer storage medium stores an executable program, and the executable program is executed by a processor to implement the steps of the swarm intelligence task planning method.
[0054] Compared with the prior art, the present invention has the following significant advantages: (1) The present invention partitions the target and can determine the optimal number of partitions; (2) The present invention adaptively groups cluster agents based on the target partition results, with each group of agents being responsible for tasks in the corresponding area, thereby realizing task planning of cluster agents; (3) The present invention can achieve a task planning solution with the shortest task completion time and the shortest total distance moved by cluster agents. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] Figure 1 This is the overall functional flow chart.
[0056] Figure 2 Flowchart of the algorithm for target clustering.
[0057] Figure 3 The target partition result graph.
[0058] Figure 4 The target partition result graph.
[0059] Figure 5 The target partition result graph.
[0060] Example
[0061] Combination Figure 1 A swarm agent task planning method, comprising:
[0062] Step 1, collect environmental information; first construct the target information matrix, record the number of targets as m, the target number as id, and the geographical location information includes longitude long and latitude lat. Then the target data matrix can be expressed as:
[0063]
[0064] Step 2: Partition multiple targets; partition targets using the k-means clustering algorithm based on the known target information collected. In order to better determine the number of target partitions, the improved Elbow method is used to determine the number of target partitions based on the actual environment conditions. Figure 2 , the specific steps are as follows:
[0065] Step 2-1: Select k data points as centers from the target information according to the rule of "finding the point farthest from the array of cluster centers added to initialize the cluster centers". The center data matrix can be expressed as:
[0066]
[0067] Step 2-2: Calculate the distance between each data point in the target information and the k centers. The Euclidean distance is used here. If each data point in the target information is closest to a center among the k centers, then this data point is considered to belong to the category of this center, and the average error is calculated. The calculation formula for the data point distance to the k centers is:
[0068]
[0069] The formula for calculating the average error is:
[0070]
[0071] Among them, C i is the i-th category, n is C i The data points in p i It is C i , SSE is the clustering error of all data points, which represents the quality of clustering effect.
[0072] Step 2-3: In the divided k categories, calculate the average value of the data points belonging to each category as the new center of the k categories. The calculation formula for the new center of the k categories is:
[0073]
[0074] where p i Represents the center long of category i n represents the longitude of data point n of category i, represents the latitude of data point n of category i, Represents the number of data points in category i.
[0075] Step 2-4: According to the new centers of the k categories, each data point in the target information is re-assigned and the average error is calculated. Compare whether the average errors before and after are equal. If they are not equal, loop again, otherwise terminate the loop and the algorithm terminates.
[0076] Step 2-5: In a complex environment, it is difficult to determine artificially how many regions a target can be divided into. Therefore, the present invention adopts the Elbow method to determine the optimal number of partitions of the target in combination with actual needs.
[0077] Step 3: Evaluate the importance of each district; use the random forest method to evaluate the importance of each district. The specific implementation process is:
[0078] Step 3-1 collects various data such as meteorology, hydrology, area and demand value, and annotates the data to determine the quantity set and evaluation set.
[0079] Step 3-2 randomly selects a certain number of samples from the training set. For each decision tree, when selecting a split node, a portion of features is randomly selected from all features, and then the best feature is selected from them for node splitting.
[0080] Step 3-3 Repeat step 3-2 to build a large number of decision trees, each of which is trained on a different random subset of the data set.
[0081] Step 3-4 gives a prediction value from each decision tree, and finally takes the average of these prediction values as the final importance evaluation result.
[0082] Step 3-5: Use the evaluation set to optimize the model
[0083] Steps 3-6 use this model to generate the importance of each area in the planning method.
[0084] Step 4, determine the demand of each district; the method for calculating the number of agents required in each district is as follows. First, construct a mapping table of importance and agent demand, and determine the minimum agent demand of each district according to the importance of each district; then, subtract the minimum agent demand of each district from the number of agents, and if there is a surplus, distribute it evenly to each district to determine the final demand of each district. Since the task planning defaults to supply ≥ demand, there is no situation where there is not enough points.
[0085] Step 5, group the cluster agents. The method for grouping the agents is to transform the agent grouping problem into a task allocation problem and construct the following mathematical model. The objective function in the method is as follows:
[0086]
[0087] The constraints are:
[0088]
[0089] Z is the total weight function value of the target, which represents the maximized execution high-value target area. j represents the importance value of the jth target area; x j is a decision variable, indicating whether the target area j is executed. If it is executed, it is 1, otherwise it is 0. rj represents the number of agents r required to perform task j. r is the total number of agents of the current class. The agent results corresponding to each target area obtained by solving the model are grouped into the same group.
[0090] In order to better illustrate the technical effect of the present invention, a specific example is used to illustrate the present invention. Assume that during the execution of a certain task, there are 8 targets, each of which has 3 attribute information, including target number, longitude, and latitude; the number of our agents is 28, and each agent has 4 attribute information, including agent number, longitude, latitude, and remaining battery life.
[0091] Inputting the initial 6 target information into the algorithm can obtain the following Figure 3 The partition results shown in the figure are as follows. When a target is added, the algorithm will determine whether to repartition based on the distance between the newly added target and the known area center coordinates and the number of agents assigned to the area. If a target is added and the target is close to a certain area, the partition results are as follows: Figure 4 As shown; when another target is added and is far away from all areas, the partition results are as follows Figure 5 The triangles in the figure are the center coordinates of each area, and circles of different colors represent different areas.
[0092] A swarm agent task planning system, comprising:
[0093] Environmental information acquisition unit, which collects environmental information and builds a target information matrix;
[0094] The partitioning unit partitions multiple targets using the k-means clustering algorithm based on the target information matrix;
[0095] Importance determination unit, random forest method was used to evaluate the importance of each district;
[0096] An agent quantity requirement determination unit determines the agent quantity requirement of each area according to the importance of each area;
[0097] The agent grouping unit groups cluster agents based on importance and quantity requirements.
[0098] The present invention can complete the task planning of the multi-agent cluster while ensuring that the multi-agent cluster task completion time is the shortest and the total moving distance is the shortest.
[0099] A computer storage medium stores an executable program, and the executable program is executed by a processor to implement the steps of the swarm intelligence task planning method.
[0100] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0101] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0102] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.
Claims
1. A swarm agent task planning method, characterized in that: include: Collect environmental information and build a target information matrix; Based on the target information matrix, multiple targets are partitioned using the k-means clustering algorithm; The random forest method was used to assess the importance of each district; Determine the number of agents required in each area based on the importance of each area; Cluster agents are grouped based on importance and quantity requirements.
2. A swarm agent task planning method according to claim 1, characterized in that: The target information matrix is: Among them, m is the number of targets, id is the target number, long id is longitude, lat id is the latitude.
3. A swarm agent task planning method according to claim 1, characterized in that: Partitioning multiple targets by using the k-means clustering algorithm specifically includes: Step 2-1: According to the rule of finding the point farthest from the cluster center array added, for initializing the cluster center, k data points are selected from the target information as the center data. The center data matrix P is expressed as: Step 2-2, calculate the distance between each data point in the target information and the k center data. If each data point is closest to a certain center, then this data point is considered to belong to the category of this center, and calculate the average error; the calculation formula for the data point distance to these k centers is: The formula for calculating the average error is: Among them, C i is the i-th category, n is C i The data points in p i It is C i The center of the cluster, SSE is the clustering error of all data points, which represents the quality of clustering effect; Step 2-3: Calculate the average value of the data points in each category as the new center of the k categories. Step 2-4: According to the new centers of the k categories, each data point in the target information is re-allocated and the average error is calculated; compare whether the average errors before and after are equal. If they are not equal, loop from step 2-2 to step 2-3, otherwise terminate the loop; Step 2-5: Use the Elbow method to determine the optimal number of target partitions.
4. A swarm agent task planning method according to claim 1, characterized in that: The distance between each data point in the target information and the k center data is: The average error is: Among them, C i is the i-th category, n is C i The data points in p i It is C i The SSE is the center of the clustering error of all data points, indicating the quality of the clustering effect.
5. A swarm agent task planning method according to claim 1, characterized in that: Step 2-3 The new centers of k categories are: Among them, p i Represents the center long of category i n represents the longitude of data point n of category i, represents the latitude of data point n of category i, Represents the number of data points in category i.
6. A swarm agent task planning method according to claim 1, characterized in that: The random forest method is used to evaluate the importance of each area, including: Step 3-1, collect various data related to task planning, annotate the data, and determine the data set and evaluation set; Step 3-2, randomly select a certain number of samples from the data set. For each decision tree, when selecting a split node, randomly select some features from all features, and then select the best feature from them for node splitting; Step 3-3, repeat step 3-2 to build multiple decision trees, each of which is trained on a different random subset of the data set; Step 3-4, obtain a prediction value through each decision tree, and take the average of these prediction values as the final importance evaluation result; Steps 3-5: Use the evaluation set to optimize the model; Steps 3-6 use the optimized and adjusted model to generate the importance of each area.
7. A swarm agent task planning method according to claim 1, characterized in that: Determining the number of intelligent agents required in each district according to the importance of each district specifically includes: first, constructing a mapping table of importance and intelligent agent requirements, and determining the minimum intelligent agent requirement for each district according to the importance of each district; then, subtracting the minimum intelligent agent requirement for each district from the number of intelligent agents, and if there is a surplus, distribute it equally to each district to determine the final demand for each district.
8. A swarm agent task planning method according to claim 1, characterized in that: The specific steps of grouping cluster agents include: transforming the agent grouping problem into a task allocation problem and constructing the objective function: The constraints are: Among them, Z is the total weight function value of the target, which represents the maximized execution high-value target area, c j represents the importance value of the jth target area; x j is a decision variable, indicating whether the target area j is executed. If it is executed, it is 1, otherwise it is 0; a rj represents the number of agents r required to perform task j, b r is the total number of agents of the current class; the agent results corresponding to each target area obtained by solving the model are grouped into the same group.
9. A swarm agent task planning system for implementing any of the methods of claims 1-8, characterized in that: include: Environmental information acquisition unit, which collects environmental information and builds a target information matrix; The partitioning unit partitions multiple targets using the k-means clustering algorithm based on the target information matrix; Importance determination unit, random forest method was used to evaluate the importance of each district; An agent quantity requirement determination unit determines the agent quantity requirement of each area according to the importance of each area; The agent grouping unit groups cluster agents based on importance and quantity requirements.
10. A computer storage medium, characterized in that: The computer storage medium stores an executable program, and the executable program is executed by a processor to implement the steps of the swarm intelligence task planning method described in any one of claims 1-8.