Real-Time Task Allocation of Heterogeneous Unmanned Aerial Vehicles for Search and Prosecute Mission

In recent years, the Internet of Things (IoT) has developed rapidly after the era of computers and smart phones, which is expected to be applied to cities to improve the quality of life and realize the intelligence of smart cities. In particular, with the outbreak of coronavirus disease 2019 (COVID-19) last year, in order to reduce contact, some IoT devices, such as robots, unmanned aerial vehicles (UAVs), and unmanned vehicles, have played a great role in temperature monitoring, goods delivery, and so on. In this paper, we study the real-time task allocation problem of heterogeneous UAVs searching and delivering goods in the city. Considering the resource requirement of task and resource constraints of the UAV, when the resource of a single UAV cannot meet the requirement of the task, we propose a method of forming a UAV coalition based on contract net protocol. We analyze the coalition formation problem from two aspects: mission completion time and UAV’s energy consumption. Firstly, the mathematical model is established according to the optimization objective and condition constraints. Then, according to the established mathematical model, different coalition formation algorithms are proposed. To minimize the mission completion time, we propose a two-stage coalition formation algorithm. Aiming at minimizing the UAV’s energy consumption, it is transformed into a zero-one integer programming problem, which can be solved by the existing solver. Then, considering both mission completion time and energy consumption, we propose a coalition formation algorithm based on a resource tree. Finally, we design some simulation experiments and compare with the task allocation algorithm based on resource welfare. The simulation results show that our proposed algorithms are feasible and effective.


Introduction
We are stepping into the era of IoT from the information age with computers and smart phones. In particular, with the development of the fifth-generation (5G) technology, 5G network not only brings us faster network speed, more importantly, but it also promotes the faster arrival of the IoT era and lays the foundation for the development of IoT applications [1][2][3][4][5], such as smart home, smart agriculture, and smart city. Wearable equipments, smart cars, and UAVs are also members of the extended family in the next generation of wireless networks. Among them, UAVs have attracted more and more attention due to its own advantages such as low cost, strong maneuverability, and no risk of casualties. It can be used for surveillance and reconnaissance [6], communication relay [7], and detection and localization [8]. During the COVID-19 epidemic, in order to reduce contact and ease the pressure of material transportation, Shunfeng UAV was used to transport medical and epidemic prevention materials, such as protective clothing, gloves, and masks. Due to the increasingly complex mission environment and the increasing difficulty of the mission, using a single UAV to perform the mission has low efficiency and poor robustness. Therefore, multiple UAVs cooperative mission execution has become a main way of applying the UAV [9,10].
In the multi-UAVs cooperative search and prosecute mission, a key problem is the mission planning of multiple UAVs, that is, to allocate task and plan path for multiple UAVs under multiple constraints, so as to maximize the system efficiency [11]. According to the hierarchical control method [12], this problem can be divided into two subproblems: task allocation and path planning, but these two subproblems are coupled with each other [13]. To get the task allocation scheme, it is necessary to obtain the path cost of each UAV, and the accurate path cost depends on the result of task allocation [14]. Task allocation is the basis of mission planning, and it will affect the quality of mission completion.
At present, some scholars at home and abroad have done a lot of research on the problem of multi-UAVs task allocation. Gerkey et al. [15] categorized multiagents task allocation along with three scenarios: (1) each agent can execute only one task at a time or multiple tasks simultaneously, (2) each task requires multiple agents or only one agent to prosecute it, and (3) only the current allocation or both the current and future allocation are considered. In this paper, our problem belongs to the multiagents-multitasks instantaneous assignment problem, because the UAV can perform target search and prosecute simultaneously, and the target execution may require multiple UAVs. There also have been lots of algorithms to solve the multi-UAVs task allocation problem, which can be divided into two types: centralized and distributed. The centralized algorithm is that a control center is responsible for collecting mission information, performing calculation, and obtaining an appropriate task allocation scheme. The UAVs act on orders, without any independent decision-making. The advantage of a centralized algorithm is that it can guarantee better global optimality, but if some unexpected situations are encountered during task execution, the task may fail, such as integer linear programming algorithm, graph theory, genetic algorithm [16], and particle swarm optimization algorithm [17]. Compared with centralized task allocation, the distributed algorithm is more flexible. Its decision-maker is not a control center, but the UAV itself. Multiple UAVs together form an intelligent body, which can communicate with each other. Each UAV can perform independent calculation, autonomous analysis, and decision-making, such as auction algorithm [18], consensus theory, and contract network algorithm [19].
Most of the work cited above have some common assumptions: (1) the UAVs are homogeneous and have sufficient resource, (2) the requirement and location of targets are all known beforehand, and (3) each task can be fulfilled by a single UAV. However, in the real mission environment, these assumptions may not be satisfied. For example, due to the limitation of technology and its size, the type and amount of resources that UAV can carry are limited. Due to the weather or equipment limitation, we cannot obtain target information in advance through some means such as radar or satellite. The execution of the target may require multiple UAVs at the same time, and it happens that a single UAV has insufficient resources to prosecute target. Therefore, in this paper, we study the real-time task allocation problem of heterogeneous UAVs with limited resources. We analyze it from two aspects: mission completion time and energy consumption, and propose a task allocation algorithm using contract network algorithm and resource tree. The main contributions of this paper are summarized as follows: (1) We introduce a theoretical model for the propulsion energy consumption of fixed-wing UAVs. Then, two special energy consumption models are derived, namely, uniform linear motion and uniform circular motion. Through this model, we can accurately calculate the energy consumption of UAV to prosecute the target, instead of using Euclidean distance to represent the cost. Even if the task distance is the same, if the UAV heading angle is different, the energy consumption to complete the task may be different (2) Considering the turning constraint of the UAV, we introduce the Dubins curve to plan the flight path for the UAV. Combined with the derived UAV energy consumption model, we can calculate the mission time and energy consumption, which is close to the real flight environment (3) We analyze the task allocation problem from two aspects of mission time and energy consumption and establish mathematical models under different objectives. For minimizing mission time, we propose a two-stage task allocation algorithm. We transform the task allocation problem into zero-one integer programming to minimize energy consumption. Considering both, we use the linear weighted sum method to transform it into a single objective optimization problem and propose a solution algorithm using a resource tree The rest of the paper is organized as follows. Section 2 describes the related works of online task allocation. Section 3 introduces the problem formulation. In Section 4, Dubins curve is presented, and the UAV energy consumption model is derived. Section 5 describes the coalition formation algorithm. Simulation results are shown in Section 6. Lastly, we conclude the paper in Section 7.

Related Works
In this paper, we consider the task allocation problem of heterogeneous UAVs online cooperative target search and prosecute. In our scenario, UAVs are heterogeneous, carrying different types and quantities of material resources which will be depleted with use. The targets are of various types, and each target requires multiple types and amounts of material resource. When the UAV detects a target, a single UAV may have insufficient resources to distribute. At this time, it is necessary to form a subteam of UAVs, which is also called the coalition formation game [20]. This subteam is called a coalition, and each UAV in the coalition is called a coalition member. The UAV that detects the target is regarded as a coalition leader.
The coalition formation problem is an NP-hard combinatorial optimization problem, and it is computationally intensive. Because the UAVs are always moving, the algorithm needs to have low computational complexity and give a feasible coalition formation result in a short time. Manathara et al. [21] proposed a distributed polynomial time coalition formation algorithm (PTCFA). The algorithm first 2 Wireless Communications and Mobile Computing sorts the candidate UAVs according to their time to reach the target, selects the minimum time coalition, and then removes the unnecessary members in turn. Sujit et al. [22] considered the influence of time-varying communication network on the formation process of UAV coalition. Zhu et al. [23] considered the influence of communication constraints and built a multinode dynamic network model for modern aerial combat based on the concept of "time to live" (TTL) to identify the potential coalition members in a dynamic network and realized coalition formation using the improved PSO algorithm. When multiple UAVs perform a search and attack mission, the search and attack tasks are coupled, and their strategies jointly determine the performance of the mission. Therefore, for a given task allocation strategy, it is necessary to design an effective search strategy. George et al. [24] proposed three different search strategies: random search strategy, lanes-based search strategy, and grid-based search strategy. Kim et al. [25], inspired by the concept of social welfare in economics, proposed a distributed coalition formation algorithm based on resource welfare, which realized a balanced resource consumption among UAV. Ma et al. [26] proposed an improved multiobjective genetic algorithm (VC-NSGA-II) to form the task coalition by adding validity check and correction rules and used clustering algorithm and VC-NSGA-II algorithm to solve the coalition problem with large task volume. However, the objective function in the above-cited literature only considers the maximum target profit and does not consider UAV's cost, which usually leads to a large number of UAVs in the coalition, thus increasing the price of our UAV group. Yan et al. [27] considered both the target benefit and UAV's cost in the system function and proposed a distributed particle swarm optimization algorithm to plan flyable and safe Pythagorean hodograph curve trajectories for UAVs to achieve simultaneous arrival. However, they used path length as the UAV's cost and did not establish an accurate fuel consumption model of UAV. If a UAV coalition is assigned to distribute medical materials, they should reach the target at the same time, thus reducing the waiting time of the staff. Currently, for the simultaneous arrival problem, there are two main ways to solve it. The first method is to plan the path for each UAV and, then, achieve simultaneous arrival by adjusting the speed [28]. This method is easy to cause speed saturation. The second method is to plan an equal length flight path for each UAV, and each UAV flies at the same speed, such as directly planning an equal length flight path [29], short flight path, and maneuver [30]. In this paper, we use the second method to achieve simultaneous arrival.
In this paper, we study the task allocation problem of heterogeneous UAVs cooperative real-time target search and material distribution. Considering the UAV resource constraints and target resource requirements, when the resource of a single UAV cannot meet the target requirements, we use a way of forming a UAV coalition to complete material transportation. Then, for the coalition formation problem, we study it from three aspects: minimizing mission completion time, minimizing UAV energy consumption, and minimizing mission completion time and UAV energy consumption. In order to accurately calculate the UAV energy consump-tion, we derive the energy consumption model of the fixedwing UAV based on the aerodynamic theory. To minimize the mission completion time, we propose a two-stage coalition formation method. For the goal of minimizing UAV energy consumption, we express the coalition formation problem as a zero-one integer programming problem and, then, use the solver to solve it. Then, considering both the mission completion time and UAV energy consumption, we use the linear weighted sum method to transform it into a single objective optimization problem and solve it using a resource tree.

System Model
Consider a search and prosecute mission in an unknown environment, for N heterogeneous fixed-wing UAVs carrying a variety of limited material resources, such as masks, protective clothing, and thermometers. The requirement and location of all targets are unknown beforehand. The UAVs first perform the target search task. When the target is found, according to the target's resource requirements, a suitable UAV coalition is assigned to distribute the required materials as shown in Figure 1. To simplify the problem, we make the following assumptions: (1) The UAV's take-off and landing process are not considered (2) The UAVs fly at different altitudes to avoid collision (3) In the process of task allocation, due to the high data transmission rate and low latency characteristics of the next generation-enabled IoT, we consider that the network communication topology remains unchanged (4) The velocity of the UAVs is constant and equal 3.1. Targets and UAVs. Assuming that T = fT 1 , T 2 , ⋯, T L g are L targets in the mission region, the location and resource requirement are unknown at the beginning. There are Q different material resources in total. The resource requirement of target T l is expressed as a vector: where r T l q , q = 1, 2, ⋯, Q denotes the quantity of q-type resource required by T l .
Let U = fU 1 , U 2 , ⋯, U N g be the set of N heterogeneous UAVs. Each UAV carries different material resources, which is written as a vector: where r U n q , q = 1, 2, ⋯, Q denotes the quantity of q-type resources carried by U n .
It is assumed that multiple UAVs use random search strategy [24] to perform search task in the mission area, and their sense range is limited, denoted as R s . Regardless where (x n , y n ) is the coordinates of U n , φ n represents the UAV's heading angle, and ω n and V n are the UAV's turn rate and speed, respectively.

Objective Function and Constraints.
In this paper, we study the task allocation problem of multiple UAVs cooperative real-time target search and material resources distribution and analyze it from two aspects: mission completion time and UAV energy consumption. Consider a scenario where the UAV U n detects target T l , but cannot meet the material requirements of T l , then U acts as a leader and broadcasts T l 's location and required resource information. All the N UAVs have the required resources and respond to U n , denoted as set A. Let D l n = fD l 1 , D l 2 , ⋯, D l N g and ε l n = fε l 1 , ε l 2 , ⋯, ε l N g represent the arrival time and energy consumption to T l for the N UAVs, respectively. The set I A represents a subset of candidate coalition A, and Π A is all nonempty subsets of A. The objective function is as follows: where T T j represents the execution time of the target T j . Since the location and resource requirements of each target are unknown, task allocation is an online and real-time process. Therefore, in this paper, we adopt a greedy strategy to minimize the mission completion time, that is, minimize the completion time of each target. For the target T l , the objective function can be expressed as follows: (2) Minimum energy consumption where ε T j is the UAV's energy consumption of prosecuting the target T j . Similarly, we use a greedy strategy and achieve objective (6) by minimizing the energy consumption of each target. For the target T l , the objective function can be written as follows: where jI A j represents the number of UAVs in set I A     Input: potential coalition members P ðU n , T l Þ and their earliest arrival time DðU n , T l Þ Output: coalition CðU n , T l Þ 1: Initialize: 2: Sort the set P ðU n , T l Þ in ascending order according to arrival time DðU n , T l Þ. 3: ½D sorted , P sorted = sortðDðU n , T l Þ, P ðU n , T l ÞÞ 4: CðU n , T l Þ = ∅ and r CðU n ,T l Þ = 0 5: fori = 1 to jP ðU n , T l Þjdo 6: Select the last member from CðU n , T l Þ as the root of the tree, denote as n c 17: Select a member from CðU n , T l Þ except for the current node and its parent, all grandparents, and left brother nodes, and add it to the tree, denote as n j 22: n p is n j 's parent node 23: end while 26: CðU n , T l Þ = ∅ 27: Append current node, its parent node, and all grandparent nodes to CðU n , T l Þ 28: returnCðU n , T l Þ 29: else 30: return No feasible coalition 31: end if Algorithm 1: The two-stage coalition formation algorithm. 5 Wireless Communications and Mobile Computing and ε l j is the energy consumption of the jth UAV in I A to prosecute T l .

(3) Minimum mission time and energy consumption
If only the mission time is considered, the UAV that is closest to the target will be given priority every time. There may be a situation in which UAVs that are closer to the target have fewer remaining resources, so in order to meet the target resource requirements, a lot of UAVs will be needed, resulting in greater energy consumption. Similarly, if only the UAV's energy consumption is considered, the mission completion time cannot be guaranteed. In order to maximize the system utility, we consider both mission time and energy consumption and use the linear weighted sum method to transform the multiobjectives optimization problem into a single objective. The objective function is as follows: where ωð0 ≤ ω ≤ 1Þ is the weight coefficient. Similarly, we achieve objective (8) by minimizing the utility of each target. That is, In the calculation process, the dimension of time and energy consumption is different, so it is not easy to compare them. Therefore, we convert the target execution time into the energy consumption of the corresponding UAV, namely, where represents the UAV that arrives at T l the latest in candidate coalition I A .
To successfully complete the task, the total resource of the candidate coalition I A should be greater than the T l 's demand, namely,

Path Planning and Energy Consumption Model
In this paper, although we study the task allocation problem of multi-UAVs, in order to accurately calculate the UAV's flight time and energy consumption, we also consider the path planning of UAV. We model the UAV as a Dubins model and derive the calculation formula of the UAV's energy consumption.

Dubins Curve.
Dubins [31] considered the influence of the vehicle's minimum turning radius and used a geometric method to give the vehicle's shortest path formula between any two points (including coordinates and directions). It is composed of the maximum curvature arc and straight line segment, which is also called the Dubins path. As shown in Figure 2, assuming that the UAV's initial position, flight direction, and the target location are known, there are two Dubins paths that can reach the target, namely, the shortest path (SP) and the longest path (LP). SP has the shortest distance to reach the target. If we use the SP to plan the path for the UAV, when the distance between the UAV and the target is less than the minimum turning radius, the UAV will be unable to reach the target. Compared with SP, LP has a longer path length, but it will not fail to reach the target. Therefore, in this paper, we use the LP. Its length calculation method can refer to literature [32].

Energy Consumption Model.
We focus on the UAV's propulsion energy consumption which is used to maintain aloft and support its maneuverability. Based on the classic aircraft consumption model in aerodynamic theory, the required propulsion energy can be expressed as a function of the location pðtÞ for fixed-wing UAVs with a constant altitude [33]: where represent the UAV's instantaneous velocity and acceleration, respectively, and c 1 and c 2 denote two parameters related with aircraft mass, wing area, aircraft shape, air density, and so on. The parameter g is the acceleration of gravity,  In the Dubins model, the UAV's flight path consists of arc and straight line. Therefore, we consider the energy consumption model in two special cases. One is that the UAV flies along a straight horizontal line at a constant speed V, i.e., kaðtÞk = 0 and kvðtÞk = V for all t. (13) can be simplified as According to formula (15), the relationship between energy consumption and speed is depicted in Figure 3. As can be seen from Figure 3, given the required parameters, we can calculate an optimal speed, which has the lowest energy consumption.
The other is that the UAV makes uniform circular motion, i.e., kvðtÞk = V and a Τ ðtÞvðtÞ = 0 for all t. At any moment, the UAV's acceleration direction is always perpendicular to the speed direction. The magnitude of the acceleration is aðtÞ = kaðtÞk = V 2 /r for all t. Therefore, (13) can be simplified as where r denotes the radius of the circular trajectory. We can find that, compared with uniform linear motion, additional energy consumption is generated when the UAV's flight direction is changed.

Coalition Formation
When the UAV finds a target, it decides its next action based on its current status. As shown in Figure 4, the UAV U n detects the target T l which requires r T l resource. If U n has the required resources of T l , it will prosecute T l .
If U n has insufficient resources for the target T l , U n becomes a coalition leader and broadcasts the requirement and location of T l to the other UAVs. The UAVs, which have required resources, will respond to U n with their resource vector and cost to prosecute T l . After receiving all the responses, U n uses the coalition formation algorithm to obtain a suitable coalition for T l . If there is no suitable Input: potential coalition members CðU n , T l Þ, and their arrival time DðU n , T l Þ, energy consumption εðU n , T l Þ Output: C l 1: C f = ∅, C l = ∅, flag = 0 2: Take the target T l as the root node, denote as n c . 3: n c = r T l 4: whileflag == 0do 5: Select a member from CðU n , T l Þ except for the current node and its parent, all grandparents, and left brother nodes, and add it to the current node, denote as n s . 6: n p is n s 's parent node 7: n s = r U n p − r U n s 8: ifn s ≤ 0then 9: C f ⟵ current node, its parent node, and all grandparent nodes except for the root node 10: flag = 1 11: end if 12: ifflag == 1 and no nodes can be added to this layer then 13: C l ⟵ select an optimal coalition from C f 23: end if Algorithm 2: The resource tree-based coalition formation algorithm.

UAVs
Resource vector coalition, U will broadcast a rejection message to all responders. Otherwise, it broadcasts coalition information to all the selected UAVs. The selected UAVs will replan their path to achieve simultaneous arrival to the T l . The rejected UAVs will continue to perform their original operation. When forming a coalition, the coalition leader has to solve an optimization problem which is computationally intensive. We propose different coalition formation algorithms according to different optimization objectives.

Minimum Mission Time.
To achieve the minimum mission time goal, the coalition leader has to solve the optimization problem given by formula (5) and (12). The traditional exhaustive method is not suitable for real-time task assignment problem because of its large search space and high time complexity. In this paper, we propose a two-stage mechanism which has low computational complexity. The specific process is given in Algorithm 1.
In the first stage, we decide on a minimum time coalition which satisfies the target resource requirements. Then, we build a resource tree to prune some unnecessary UAVs to achieve the minimum coalition size. Suppose that U n has detected T l but has insufficient resources. Therefore, U n broadcasts the information of T l to other UAVs. After receiving all the responses, U n sorts the responders in ascending order of their cost, i.e., the earliest arrival time to T l (line 2 in Algorithm 1). Starting with the first UAV after sorting, only one UAV is taken at a time until the requirement of T l is met (line 3-14 in Algorithm 1). After the above step, if there has a feasible coalition, its time must be minimum to prosecute T l . Then, for the obtained minimum time coalition CðU n , T l Þ, we build a resource tree to remove some members whose resources are not necessary. Since the resource of the last member of CðU n , T l Þ is necessary, we take it as the root node. Then, we select a member from Cð U n , T l Þ and add it to the current node. The value of new node is its resource vector plus the value of its parent node. This process is repeated until the value of the current node meets the target demand. The final coalition is made up of the current node, its parent node, and all grandfather nodes. To illustrate the pruning process, we give a hypothetical example as shown in Figure 5 where the selected minimum time coalition CðU n , T l Þ is fU 1 , U 2 , U 3 , U 4 , U 5 g.

Minimum Energy Consumption.
Due to the limitation of UAV's size and technology, its energy is limited. Therefore,      Wireless Communications and Mobile Computing in order to maximize the efficiency of the UAV team, we need to consider the UAV's energy consumption when assigning tasks. To minimize the UAV's energy consumption, we model the task allocation problem as a zero-one integer programming problem. Assuming that the UAV U n is a coalition leader for the target T l and the set of candidate coalition members is CðU n , T l Þ = fU 1 , U 2 , ⋯, U N g. We first define the following binary variable: Then, a general scheme of the zero-one integer linear programming formulation of the task allocation problem can be expressed as follows: where (19) is the resource constraint, which is used to ensure that the selected UAVs meet the target resource requirement. jCðU n , T l Þj represents the number of the UAV in the set CðU n , T l Þ. ε l i is the energy consumption of the ith UAV in the set CðU n , T l Þ to prosecute T l .

Minimum Mission Time and Energy Consumption.
Considering both the mission time and energy consumption, the coalition leader needs to tackle the optimization problem (10). Meanwhile, the number of UAVs in the coalition also needs to be considered, because it implicitly assists in fast completing mission. To solve it, we develop a resource tree and use it to get a suitable task allocation solution in an acceptable time.
The detailed process is shown in Algorithm 2. Similarly, we assume that the UAV U n detects the target T l and has insufficient resource. CðU n , T l Þ is the candidate UAV set for T l . Firstly, we initialize a cell structure C f to be empty, which stores some feasible coalitions that meet the T l 's resource requirement. Then, we take T l as the root node of the tree. When we add a new node, we select a UAV from CðU n , T l Þ except for the current node and its parent, grandfather, and left brother nodes and, then, add it to the current node. The value of the new node is the value of its parent node minus its resource vector. If the value of the new node is less than 0, the current node, its parent node, and all grandfather nodes except the root node form a feasible coalition. If the first feasible coalition is found, the process ends when there is no node that can be added to the current layer. Otherwise, the above process is repeated. Then, U n selects a optimal coalition from C f based on (10).
We give a simple example to better understand Algorithm 5.3. Assuming that U 1 has detected T 1 and the set of candidate UAV is CðU 1 , T 1 Þ = fU 1 , U 2 , U 3 , U 4 , U 5 g. Their resource vector is given in Table 1, and the resource  9 Wireless Communications and Mobile Computing requirement of T 1 is r T 1 = ð5, 3Þ ⊤ . According to Algorithm 2, the final result is shown in Figure 6. f1 : ð5, 3Þg represents a key-value pair, where the key is the number of a tree node, and the value is the value of its parent node minus its resource vector. The value of the root node T 1 is its resource requirement. Since the values of node 7, 11, 12, 13, 14, and 16 are less than 0, the feasible coalition set C f is fðU 1 , U 2 Þ, ð U 2 , U 3 Þ, ðU 2 , U 4 Þ, ðU 2 , U 5 Þ, ðU 3 , U 4 Þ, ðU 4 , U 5 Þg.
The above process ensures that the size of feasible coalition is the smallest. Then, U 1 selects an optimal coalition C 1 among C f based on (10).

Simulation Results
In this section, three groups of numerical simulation are carried out to evaluate the performance of our proposed algorithms. In the first example, we give a general scenario to illustrate the entire search and prosecute process. In the second example, we show the difference between the proposed three coalition formation algorithms. Finally, we show the effects of changing the number of UAVs on the mission completion time and energy consumption through the Monte Carlo simulation. In addition, we compare our proposed algorithms with the task allocation algorithm based on resource welfare [25].
6.1. General Scenario. Considering a general scenario with six UAVs and two targets in a bounded region 3200m × 3200m, we analyze the whole process of heterogeneous UAVs cooperative target search and execution. If the UAV flies out of the mission area, it will take the minimum turning radius to return to the mission area. Table 2 shows the initial information of each UAV, and Table 3 lists the location and resource requirement of each target. Note that the UAVs do not have any information about the location and required resource of the target at the initial moment. The information of the target can be obtained only when the UAV detects the target. The control parameters are shown in Table 4 where V is the flight speed, R s denotes the sensor radius of the UAV, and R min denotes the UAV's minimum turning radius. Figure 7 illustrates the initial environment.
At the initial moment, all UAVs perform a random search task along the heading direction. At time t = 0:1s, U 5 detects T 1 and T 2 . U 5 chooses T 1 as the target, because the resource of U 5 cannot meet the resource requirement of T 1 or T 2 , while T 1 is closer to U 5 . As U 5 does not have sufficient resource to prosecute T 1 , U 5 becomes a coalition leader and broadcasts the requirement and location of T 1 to other UAVs. After receiving all the responses, U 5 forms a coalition C 1 = ðU 3 , U 5 Þ for the target T 1 using our proposed resource tree-based coalition formation algorithm, which comprehensively considers the target execution time and energy consumption. Then, U 3 and U 5 replan their path based on the Dubins curve to simultaneously arrive at T 1 as   Figure 8. At time t = 0:2s, U 5 detects T 2 . U 5 cannot be a potential coalition member, because it is now in the state of performing task. However, U 5 can still act as a coalition leader and broadcast the location and resource requirement of T 2 to other UAVs. After receiving all the responses, U 5 forms a coalition C 2 = ðU 1 , U 4 Þ for T 2 . The trajectory of U 1 and U 4 is shown in Figure 9. The total mission time including target search and prosecute is 37.9 s, and the total energy consumption is 5:4419 × 10 4 J. Figures 8 and 9 show that our proposed task allocation algorithm effectively completes the target search and prosecute in an unexplored environment. The proposed resource tree-based coalition formation algorithm can assign suitable UAVs for the target.

Comparison of Four Algorithms.
In this example, we consider a simple scenario with one target and six UAVs in a bounded area. Our goal is to compare the differences between the four coalition formation algorithms. Table 5 shows the initial information of all UAVs. The target is located at (1500, 1500), and resource requirement is r T = ð5, 3Þ ⊤ . The control parameters are the same as in Table 4.
We compare the mission time, energy consumption, and mission planning time which includes coalition formation time and path planning time. The specific results are shown in Table 6. The trajectories of coalition member are shown in Figures 10-12, where the coalition member for minimum energy consumption is the same as the resource tree-based coalition formation algorithm.
It can be found from Figures 10-12 that different coalition formation algorithms get different coalitions even if the target and potential coalition members are the same. Table 6 shows that the energy consumption of the twostage coalition formation algorithm is the highest, because it only considers the mission time and do not consider the energy consumption of UAVs when it forms the coalition, which leads to the increased number of UAVs. The resource tree-based coalition formation algorithm has the same coalition members as the minimum energy consumption. However, the resource tree-based algorithm has less mission planning time, because the solver of the zero-one integer programming problem uses the cut plane method which has intensive computation. Therefore, the resource tree-based algorithm is more suitable for a real-time task assignment application. Compared with the resource welfare-based task allocation algorithm, the resource tree-based algorithm has less mission time and energy consumption. Because the 11 Wireless Communications and Mobile Computing resource welfare-based algorithm chooses U 1 instead of U 4 as one of the coalition members to achieve a balanced resource depletion, and U 1 is farther from the target than U 4 . 6.3. Effects of Varying Number of UAVs. In this example, we make use of Monte Carlo simulation to illustrate the performance. The average mission completion time and energy consumption are measured and compared by varying the number of UAVs. The size of the mission area is 5000m × 5000m. The control parameters are the same as in Table 4. At the beginning, assume that all the UAVs are located at ð 0, 0Þ, and the resources of the UAVs and targets are randomly generated. The heading angles of UAVs are different. There are five targets in the mission area. The number of UAVs varies from 6 to 20. The experimental results are shown in Figures 12 and 13. Figure 13 shows the average mission completion time of four algorithms when the number of UAVs changes. As the number of UAVs increases, the mission completion time decreases. Because the increased number of UAVs allows the resource requirements of the targets to be met as soon as possible, and the execution of multiple targets can be performed simultaneously. Compared with the resource welfare-based algorithm, the resource tree-based algorithm has less mission completion time. However, there is a small difference in the average mission completion time among the proposed algorithms. Figure 14 compares the average energy consumption of four algorithms when the number of UAVs changes. As the number of UAVs increases, the energy consumption of UAVs continues to increase, because more UAVs are dispatched to perform mission. The resource welfare-based task allocation algorithm has the highest energy consumption. Because it uses an average resource consumption strategy, and each UAV maintains almost equal resource surplus. As the number of UAVs increases, multiple UAVs are allocated to execute the target with more resources, thereby increasing energy consumption. The energy consumption of the resource tree-based algorithm is less than the other two proposed algorithms.

Conclusions and Future Works
In this paper, we studied the task allocation problem of heterogeneous UAVs cooperative real-time target search and prosecute in an unexplored area. We analyzed it from two aspects: mission time and energy consumption. According to different optimization objectives, we established the corresponding model and designed the solution algorithm. For the minimum mission time objective, we proposed a two-stage coalition formation algorithm. For the minimum energy consumption objective, we solved it by modeling the problem as a zero-one integer programming problem and using the existing solver. For the minimum mission time and energy consumption objective, we proposed a resource tree-based algorithm. Through simulation experiments, we verified that our proposed algorithms is feasible and effective.
In the future, we intend to consider the impact of timevarying communication network on online task allocation. The UAVs are always in flight and have limited communication ranges. Therefore, the coalition is formed in a timevarying network. It takes some time to transmit and process the message, which will affect the calculation of the time and energy consumption of UAV to reach the target.

Data Availability
I will put my experimental code and data on my github as soon as possible. The hyperlink is https://github.com/lilirm/ Real-Time-Task-Allocation-of-Multiple-Heterogeneous-Unmanned-Aerial-Vehicles-for-Search-and-Prosecut.

Conflicts of Interest
The authors declare that they have no conflicts of interest.