## 3 Task Assignment Algorithm Based on Extended CNP
### Distributed Multi-Constraint Dynamic Task Assignment Algorithm
Figure 10: The initial setting of the situation between both sides. Figure 9: The feasible area of payload: (**a**) the available detection area; (**b**) the available attack zone. Purple threats represent known threats, and blue threats represent unknown ones, all of which the coordinates are randomly generated. The targets are marked with \"T\"; Each UAV is marked with \"V\", where \"S\" represents the reconnaissance UAV, \"A\" represents the attack UAV, and \"SA\" represents the reconnaissance-attack UAV. In the simulation, the maximum value of the reconnaissance subtask is set at 100, the maximum value of the attack subtask is set at 150, and the attenuation factor \(\lambda\) is set at 0.9. Adopting the designed UAV swarm cooperative dynamic task assignment approach, the sequential task assignment results for known targets are shown in Table 5. The task execution plan of each UAV is expressed in the format of (Target, Subtask type, Start time (s), Winning bidding value). According to the known threat information and the unknown threat information detected by reconnaissance UAV during mission execution, the modified artificial potential field method is adopted to avoid local optimization, and the preplanning flight path considering threat avoidance during mission execution can be realized. Combined with the UAV swarm task assignment results, the preplanned path, and the task sequence, the swarm task execution diagram can be obtained, as shown in Figure 11.

As can be seen in Figure 11, the cooperative task assignment approaches can realize the \"reconnaissance-attack\" coverage of known targets under the consideration of flight path planning coupling and task time window constraints. Figure 11: (**a**) The execution sequence of the UAV swarm; (**b**) the diagram of the UAV swarm performing tasks. \begin{table}
\begin{tabular}{c c c} \hline
**UAV** & **Air-Range Estimation (m)** & **The Number of Tasks** & **The Execution Planning** \\ \hline V1 & 0 & 0 & None \\ V2 & 3524.00 & 1 & (T1, A, 98.7, 79.52) \\ V3 & 0 & 0 & None \\ V4 & 3486.00 & 1 & (T1, S, 73.7, 65.14) \\ V5 & 4230.00 & 2 & (T2, S, 117.5, 62.14)\(\rightarrow\)(T6, S, 167.0, 59.20) \\ V6 & 3756.52 & 1 & (T2, A, 142.74, 74.87) \\ V7 & 3837.18 & 1 & (T6, A, 192.0, 73.23) \\ V8 & 4298.74 & 1 & (T5, S, 249.6, 57.04) \\ V9 & 6475.10 & 2 & (T3, S, 150.3, 51.47)\(\rightarrow\)(T4, S, 193.8, 57.34) \\ V10 & 4477.55 & 1 & (T4, A, 218.8, 60.51) \\ V11 & 5702.98 & 2 & (T3, A, 175.3, 56.75)\(\rightarrow\)(T5, A, 274.6, 66.90) \\ \hline \end{tabular}
\end{table} 
Table 5: The task assignment of the UAV swarm. ### Dynamic TASK Assignment for Sudden Targets

Considering two unknown targets, T7 and T8, the swarm discovers targets through cooperative detection and then assigns tasks. The information of T7 and T8 is shown in Table 6, and the initial operational situation is shown in Figure 12.

The time when unknown targets are discovered by the UAVs and the corresponding subsets that discover the targets are shown in Table 7. The generated subtask time window constraints are shown in Table 7 as well. The sequential task assignment results for the unknown targets are shown in Table 8.

The swarm realizes the coverage of sudden targets through the distributed cooperative dynamic task allocation mechanism after the reconnaissance UAV V8, belonging to Subset 1, and the reconnaissance UAV V5, belonging to Subset 2, detect sudden targets T7 and T8, respectively, during task execution. The concrete analysis is as follows: The reconnaissance UAV V4 and attack UAV V6, belonging to Subset 1, is assigned to perform the subtasks of sudden target T8 successively in the corresponding time window. The reconnaissance UAV V8 and reconnaissance-attack UAV V3, belonging to Subset 2, successively perform the subtasks of sudden target T7 in the corresponding time window so as to realize the \"reconnaissance-strike\" coverage of each sudden target.