## 3 Methodology
### Dynamic Task Allocation
Our algorithm requires neither fixed leader nor fixed formation so that the team can easily move in any direction even the opposite one in order to find an alternative path solution in facing with an environment with complex distribution of obstacles. \begin{table}
\begin{tabular}{l l} \hline \hline
**Parameter** & **Value** \\ \hline UAV radius (\(r\)) & 0.4 m \\ safe distance (\(d_{safe}\)) & 0.8 m \\ minimum velocity (\(v_{min}\)) & 0 m/s \\ maximum velocity (\(v_{max}\)) & 15 m/s \\ maximum acceleration (\(a_{max}\)) & 0.3 m/s\({}^{2}\) \\ minimum yaw rate (\(\omega_{min}\)) & \(-40\cdot\frac{\pi}{180}\) rad/s \\ maximum yaw rate (\(\omega_{max}\)) & \(40\cdot\frac{\pi}{180}\) rad/s \\ maximum yaw acceleration (\(\omega_{max}\)) & \(40\cdot\frac{\pi}{180}\) rad/s \\ predicted time (\(t_{T}\)) & 2 s \\ time tick & 0.2 s \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Simulation parameters. Figure 3: Simulation of trajectories in a narrow passage: (**a**) Waiting state validation, (**b**) All passing. Figure 4a shows that the 6 agents are encountered with a dead-end corner shortly after they moved for some distance at the beginning. Nevertheless, the leading agents would invoke a _manueuvering_ state when they found that no path was available. On the other hand, the following agents behind would switch the _moving_ state to the _waiting_ state and thus waited for their teammates to move. To prevent the deadlock for the whole team to wait for each other, we preset a time-out variable _clock_. The _clock_ is randomly assigned from 2 to 3 s for dealing with the synchronizing problem. That is, every agent will start to move and search for new feasible paths after the time-out. Finally, if there is a feasible path, the team would successfully find the alternative route and then continue to move toward the target. Figure 4b shows the analysis of agent's performance from \(N=1\) to 15, where \(N=1\) represents a single agent which does not require formation coordination. The green line denotes the agent's average distance, while the red line denotes the total spent time. Since we define \(v_{max}=1\) m/s in the simulation, the average waiting time when agents are being stuck can be analyzed from the difference between both lines. It can be seen that the average distance is not affected much by increasing the number of agents that implies the stability and efficiency of the formation coordination algorithm. On the other hand, the total time spent depends on \(N\) due to the waiting of agents to get around the obstacle that blocks the team moving direction. In the situations where agents attempt to find a way out of the obstacles, each agent will switch between the _waiting_ and the _manueuvering_ states to prevent a deadlock. In another word, its behavior is somewhat similar to data retrieval in a stack (i.e., last-in-first-out structure) and the total time spent is a linear growth depends on \(N\). Figure 4: UAVs in Maze-like environment and Analysis: (**a**) All trajectories in a maze-like environment, (**b**) Line chart of the average distance and the total time spent. #### 4.2.2 Static Target

Figure 5 shows the simulation of static single target. We place random obstacles between the starting and target positions to evaluate the coordination capability between agents using our algorithm. The number of agents as well as the number and distribution of the obstacles can be given arbitrarily. Figure 5 shows agents launch around the starting positions near the lower left corner toward the target position near the upper right corner. Agents must achieve the goal position by adjusting their paths and maintaining as a compact group as possible to avoid obstacles. The agents do not know the obstacles prior to realizing that they get near an obstacle or other agent by a sensor. The obstacle avoidance path planning is conducted autonomously by agents to minimize the cost. Agents can adjust their trajectory constantly to avoid collision between agents and environmental obstacles.