Biologically Based Control of a Fleet of Unmanned Aerial Vehicles Facing Multiple Threats

This paper addresses a set of multiagent, unmanned, aerial vehicles (UAVs) in a mission within a threat-prone environment. Each UAV is considered as a nonholonomic, nonlinear model moving in a two dimensional space. The system is composed of a fleet of UAVs, competing UAVs and a target. The approach proposed in this paper is based on a biological model representing collective behavior in predator-prey systems. The fleet of UAV’s (prey) is moving cohesively towards a target and they can come under attack from competing UAV’s (predators) which are also expected to avoid a certain area around the target, treating it as an obstacle that they have to avoid. Prey and predators are expected to obey certain social behaviors within their respective species that include coherent motion, separation to avoid collision, and alignment. The prey are also connected through an adaptable network. During attacks, this networked population of prey could be divided into several small groups that are still connected and naturally observe the same social behavior. To identify these groups and their members, the density-based algorithm DBSCAN is used. The aim of this work is to use this biologically inspired model along with a robust feedback linearization controller to achieve both target pursuance and effective evasion from two predators. Simulation results demonstrate the different aspects and features provided in the proposed approach.


I. INTRODUCTION
The use of unmanned aerial vehicle technology is expected to increase and be an integral part of the operation of several commercial industries. Big tech giants -for example, Amazon with their ''Amazon Prime Air'' (Misener P, 2014, unpublished data) -plan to revolutionize their supply chain systems using unmanned aerial vehicles for home deliveries. The digitization of the economy and the use of artificial intelligence (AI) is catalyzing the development of smarter and more autonomous systems. The increasing use of UAVs continues to make the control design for such systems an active area of research.
Unmanned aerial vehicles belong to the class of nonholonomic systems. A common constraint attributed to this class of models is their inability to be stabilized by a smooth static-The associate editor coordinating the review of this manuscript and approving it for publication was Yichuan Jiang . state feedback controller, particularly because such models can usually have an underactuated structure and hence fail to satisfy Brockett's Condition [1] and [2]. In the literature, several control strategies have been developed to tackle this problem. Discontinuous feedback control laws [3], [4] and continuous feedback laws [2], [5] have been proposed. Reference [6] discussed the problem of achieving complete tracking of a wheeled robot using a torque nonlinear controller. They proposed two fuzzy controllers for solving this problem. Reference [8] proposed a backstepping control technique for a spherical robot for use in unmanned terrain. The backstepping control technique showed asymptotic tracking convergence to the desired trajectory, which was also verified using simulations. Researchers have also considered slidingmode control to achieve tracking goals for nonholonomic systems. A non-smooth feedback using sliding-mode control to track the desired state function of a nonholonomic system has been studied in [4].
Several authors have addressed the tracking problem for nonholonomic systems, which is of importance to our research. Reference [9] proposed an approach where the tracking challenge is converted into a two-system stabilization problem by using a transformation and a cascade technique. A linear matrix inequality (LMI) was then designed to stabilize, that is, to track the given reference. Reference [10] proposed an improvement of [9]. The update allowed for exponential convergence to a desired trajectory. In [11], the authors derived an algorithm that allows a nonholonomically constrained rigid body to track a straight line without twirling. The authors derived a function called the steering function by differentiating the trajectory's curvature as a linear combination of the vehicle's position error, orientation error, and current trajectory curvature. A practical approach to solve the problem of tracking and visual servo control for a nonholonomic wheeled robot can be devised using videos of the desired paths [12]. Reference [13] also considered the combined tracking and visual problem; however, they included parameter uncertainties in their analysis. Positioning and distributed path planning can also be formulated as an optimization problem (see, for example, [14]). In [15], distributed path planning for a fleet of UAVs using the particle swarm optimization (PSO) method was developed and validated experimentally.
Also notable is the use of biologically inspired algorithms based on the collective behavior of animal groups to simulate real world scenarios. These biological behaviors have been found to be extremely useful in several engineering applications. Reference [16] harnessed the movement flow model of a school of fish to investigate the output power efficiency of vertical axis wind turbines as opposed to the commonly used horizontal axis wind turbines. Among other biological applications is robot rescue in times of danger, such as fire or natural disasters. Several other biological behaviors can be imitated for other applications. Our work highlights one of these applications. We propose the application of the foraging and evading behaviors of a school of fish to a fleet of mobile UAVs. The idea is easily applicable to rescue missions heading for a target.
The collective behavior of animals is incredibly fascinating [17]. The self-organizing formations of a group of birds in flight [18], schooling fish [19]- [21], or a swarming bees [22] or the hunting techniques used by carnivores in the wild [23] are among some of the behaviors actively being researched. Reference [24] stated that bioinspired schemes could be implemented in robotic systems and incorporated the foraging behaviors of bottlenose dolphins. In [25], a flocking control for systems with many agents has been developed by identifying team leaders and followers. The results were then applied to a group of nonholonomic robots. The work in [26] built on [25] by using a decentralized flocking controller for situations when the target to be tracked is fixed. In all these studies, the systems studied are composed of one specie.
The predator-prey system was considered in [27]. The study defined the term collective ''in the sense of the collective motion of defense or attack often found in behaviors of animal groups.'' In their assumed nonlinear model, both prey and predator motion is considered in a twodimensional plane. A game is set between predator and prey such that the birth, death and evolution processes are determined by who is winning or losing the game. Coordinated animal group movements, defined as social behavior, serve as a defensive mechanism against predation. In [28], three simple attack strategies were studied: attacking the nearest victim, a peripheral victim or a split victim (an individual separated from the group). Comparison of these tactics was studied in [29]. The simulations showed that the ''attacking the center'' strategy is the least successful for the predator. From the prey point of view, social behavior is more advantageous than individualistic behavior. Fuzzy models called synflocks have been used to model fuzzy logic-based bird flocking [29]. The evolution of swarming behaviors has also been studied by [30]. Reference [31] presented a composite attacking tactic in which the predator either uses one of the simplicities mentioned above with a given probability or disperses the group and then attacks the isolated prey. The study assumed a single predator agent and used a genetic algorithm (GA) to maximize the probability of selecting a specific tactic, the distance at which the predator stops dispersing the prey, and the radius within which it will be looking for isolated prey.
In this work, we consider two predators using a simple attacking tactic wherein the nearest prey is selected. We also assume that the predators are not competing with each other. In addition, the prey are always inclined to engage in social behaviors where they obey cohesion, separation, and alignment requirements. We specifically apply the concept of mobile adaptive networks proposed by [32]. Adaptive networks have been used as the backbone of many biologically inspired networks [20]- [22], [33]. In [32], the author wrote a survey on the study of adaptive networks and advances in the field. A summary of different distribution strategies and the best strategy to use for certain applications was provided in [34]. In [35], an adaptive diffusion least-meansquares algorithm was formulated to ensure cooperation among each node. This work has been extended by adding data-normalized algorithms and a dynamic topology [36]. Reference [37] studied diffusion in concurrent collective strategy diffusion of Multiagents. The study focused on spatial diffusion model. To improve the robustness of diffusion networks in the presence of disturbances, adaptive combiners are added to the networks as in [38]. A similar case of disturbance was analyzed by [39]. More recent advances were investigated in [40]- [42].
The use of biologically inspired control of nonholonomic systems under a single threat has been proposed in [43]. A control law based on backstepping control can introduce system oscillations, and a careful selection of the gains is required. The transformation used in the control design makes the analysis complex. The analysis assumes that the speed of the predator is certain. The case where the pursuers move at uncertain speeds have been studied in [44]. Reference [45] proposed solutions to the flocking and target interception problems of multiple nonholonomic unicycle-type robots using a distance-based framework. They proposed control laws designed using graph theory and exploited the rigidity properties of a graph modeling the sensing/communication interactions among the robots. The authors proposed an input transformation to prove the stability of the network.

CONTRIBUTION
In this paper, building on the pioneering work of [21], [46] and [47], we propose a biologically inspired algorithm for a fleet of mobile autonomous nonholonomic systems in a multithreat environment.
1) A biologically inspired predator-prey model is used to model the system: The three actors interact according to norms similar to the collective behavior in animal groups. The fleet of UAVs acts like prey while facing attacks from adversarial or competing UAVs. The latter acts like predators and uses a simple attack technique based on the nearest victim. Bot species follow collective social behavior defined as the ability to have cohesive motion, separation to avoid collision and alignment for formation control. 2) The work is a direct extension of [43]: The context of this study includes three actors: a target, multiple threats, and a fleet of UAVs. Unlike [43], each actor possesses some cognitive skills and abilities. The fleet of multiagent UAVs can evade, move in a particular formation toward the target, and in the face of a close incoming threat, evade following a planned path. During its movement, the bioinspired fleet follows a predefined navigation trajectory under a designed tracking controller. The fleet is composed of nonholonomic homogeneous UAVs under the Pfaffian constraint, and a local feedback linearization controller is used to ensure path tracking in normal and evasive modes. 3) Different dispersed groups of the original population are identified using density-based clustering: Within the communication range and in the absence of threats, the strongly connected network, with the UAVs as nodes, moves harmoniously toward the target while maintaining a safe distance between agents. This is called the foraging phase. However, during attacks, this unified network is broken as the UAVs under perceived attack break from the group looking for safety. Several small groups build up during this phase. We propose a densitybased technique to identify these groups and apply the same diffusion algorithm to keep them connected, thus forming several clusters of local networks that can reconnect together when they are within the range of communication. 4) The prey can also be the predator: The target has his own dynamic and considers the fleet of UAVs as predators. Once these predators are within its safe zone, the target follows evading paths. Thus, the role of prey changes to that of predators.

5) Obstacle avoidance:
On the other hand, the threat considers the target as an obstacle. Their role as predators is to attack and hunt each member of the fleet of UAVs. They work together in a non-competitive manner in the sense that if one predator is pursuing a prey, the other predators will have to pursue different predators. Both predators and prey also have to avoid colliding with their own species and must maintain a safe distance between members of their own groups. In summary, the novelty resides in • the use of biology to address all the behavioral aspects of nonlinear nonholonomic systems composed of fleets of UAVs, multiple attackers, and mobile targets.
• the use of clustering techniques to identify strongly connected groups of agents in a multi-threat environment.
• ensuring robust control of the whole predator-preytarget system during evasion and during foraging while observing social behavior as previously defined. The paper is organized as follows. Section I is an introduction and highlights the contributions of the paper. The problem is formulated is in section II. We introduce the nonholonomic model, and we set up both the problem and the necessary assumptions. In section III, we build on the foundation of the navigation algorithms. First, we discuss the fish-prey algorithm and its application to UAVs. The biological behaviors of foraging fishes are modeled and applied. In section IV, we introduce density-based clustering and the requirement for coherent motion. We then design cognitive evasive strategies for UAVs in the presence of multiple threats and identify the different velocity estimates in section V. The tracking problem is treated elaborately in section VI. Control strategies are designed to track the path planned by the navigation algorithm for both single and multiple UAVs. Section VII shows the simulations, results, and discussions of the research carried out, and finally, we conclude in section VIII.

II. PROBLEM FORMULATION A. UAV NONHOLONOMIC UNICYCLE MODEL
In this paper, we consider a fleet of multiagent UAV systems, two UAV attackers, and a target of each model as a unicycle moving in the plane. The kinematic model of the unicycle is usually described by a simple nonholonomic nonlinear model, although the methods presented can be extended to the 3-D case [23]. This The particularity of this model is that the velocities are constrained and the states are not completely integrable [53]. Each of these elements is equipped with a global positioning system (GPS) and proximity sensors. A communication system connects the fleet of the UAVs, and the information exchanged is limited. The target will be either mobile or stationary, and its position is known to all UAVs. The attackers play the role of predators, are not connected and are assumed to have identifiers that allow them to distinguish themselves as friends and not foes. They are also equipped with proximity sensors and radar to locate the fleet of UAVs.

Assumption 1: The predators do not compete with each other. A particular prey cannot be attacked by a predator j if it is already in pursuit by a predator i. The predators do not collaborate during the hunt and must keep a predefined distance from each other. The predators should also keep a predefined distance from the target and hence treat it as an obstacle that they have to avoid.
This assumption is not restrictive and is in place to fulfill the following objectives: • Avoid the obvious case where two predators run behind one prey.
• Maximize the hunt, which is a biological behavior.
• Exhibit various social behavior as the predators are assumed to be of different species. An example of such social behavior would be that they maintain a distance between them to avoid colliding with each other, especially during the hunt. The kinematic model of a unicycle considers the steering angle (orientation or heading) θ and the Cartesian position (x, y) of the UAV moving within a plane. The inputs encompass the linear velocity u 1 and the angular velocity u 2 . The motion of the UAV under this model is constrained by the inability to make a sudden change in its inputs and therefore its positions and heading. These constraints are known as the Pfaffian constraints [54] and can be represented as a nonintegrable first-order differential equation. This puts a limit on the instantaneous maneuvers that the UAV can execute. The kinematic model of the nonholonomic unicycle UAV is as follows:ẋ Let q = [x y θ s ] T be the state vector of the model comprising the position and orientation states of the UAV. The generalized velocities of the UAV that form the inputs ofq are coupled and have to satisfy the following Pfaffian constraint [54]: D(q)q = 0, with D(q) = sin θ s − cos θ s 0 . This implies that the system has zero lateral velocity, and thus, all available velocities are within the null space of the matrix D(q). For subsequent work, we will define the position in the plane of the UAV, target and predator as x, w f and w p , respectively. Each position has two components, one in the x-dimension and one in the y-dimension. Given the vector , and ||v|| is the L 2 norm. Let N be the number of UAVs; N i is the set of UAVs considered neighbors of UAV i; w p l,k and w f k represent the position of predator l and of the food at time instant k, respectively; r is the safe distance between UAVs; r down is the distance between UAV and predator below which the UAV is declared inactive; r pp is the distance between predators; r ft is the radius of the zone around the target that predators cannot enter; r tp is the sensing range of the target; R ps is the sensing range of the predators; and t is the sampling period.

B. PROBLEM SETUP
We consider a field where we have a fleet of UAVs navigating toward a target in an environment where they can be subject to multiple attackers (see Figure 10). Each UAV has several modes of operation depending on the realization of the following events: navigation toward the target if no attackers are present within the predefined safe zone, evasion from a pursuing attacker, and hunting the target depending on whether the target is in motion or stationary. During these active modes, the UAV can be completely inactivated by the attackers. Figure 2 illustrates the automata system representing the different UAV navigation and operation modes.
Remark 1: When the UAV is inactived by the predator or breaks away from the fleet, the network size and configuration change; thus, there is a need to consider Adapt-Then-Combine (ATC) and Combine-Then-Adapt (CTA) diffusion algorithms for the adaptive network (see [21]).
Using biology, there are four phases to this system: • Foraging phase: The fleet of UAVs, like a school of fish, forage in search of the target. This mode occurs when there is no close threat. Like the school of fish, UAVs should observe social behavior by moving in a harmonious manner, respecting distancing, avoiding collisions and using the instinctive behavior to remain connected.
• Evasive phase: the UAV, like a prey, has to evade attackers and look for safety by breaking away from the school  and adopting different velocities and headings. If the evasion is successful, the UAV has to follow a selforganizing behavior phase to reunite with the closet cluster of fish.
• Pursuit phase: If the target can be in motion, the UAV fleet starts behaving like a predator and pursues the target. If the target is stationary, the UAV fleet will gather on the target.
• Inactive phase: If a predator succeed to catch a UAV then it will be inactivated and dropped from the fleet. The following are the assumptions regarding the system's capabilities: Assumptions • Each UAV has a GPS.
• Each UAV shares its position and orientation with its local neighborhood.
• The target position is known by all.
• UAVs are not aware of the position and orientation of the attackers until the latter enter the UAV safe zone. The predator-prey behavior is active only then.
• Each UAV is assumed to have physical dimensions [49], with motion governed by physical laws.
• The adaptive network can be in several strongly connected clusters. A cluster can be composed of only one UAV.
• For attacking UAVs assuming the role of predators, the target is an obstacle and has a zone that they cannot access. Figure 5 shows the state transition model and the conditions for moving from one state to another. In this work, the target will follow two scenarios, either idling or moving. The following Figure 4 illustrates the two modes and the conditions for transitioning from one state to another.

III. BIOLOGICALLY INSPIRED NAVIGATION CONTROL A. DIFFUSION ADAPTATION AND THE MEASUREMENT MODEL
Diffusion adaption is concerned with the performance of adaptive networks, which are defined as a collection of nodes that have the ability to learn and interact with each other. In this study, we consider a collection of N UAVs (nodes) distributed in space. Letū k,i be a random process representing some information or measurements related to node k at time i. Every node k, k = 1, . . . , N , evaluates a scalar random process d k (i) as aū k,i , where d k (i) andū k,i are correlated. Each node k calculates the unknown and possibly time-varying weights w k,i such that where n k is a random disturbance or a perturbation, which is usually taken as zero-mean white noise. In the distributed algorithms, a node passes to its neighbors or a subset of the network, which in turn communicates the received data to other subsets of the network. Node N k 's neighbors are a set of nodes immediately connected to it and can be defined as those within its communication range, The network aims to compute the parameter w o such that it minimizes the global objective function [20]. In this work, the Adapt-Then-Combine (ATC) diffusion algorithm proposed by [35] and [39] is used. In this algorithm, a real positive coefficient a l,k is assigned to each communication link between node k, k = 1, . . . , N , and its neighbors l, l ∈ N k . The weighting coefficients are selected such that According to the ATC algorithm, the different weights are updated at each time instant i according to the following relations: where µ k is a non-negative step size applied by node k, and d k (i) is the linearly regressed form of d k (i). Let the vector w o represent the estimated location of the target. The distance between the UAV k and the target w o is given by d o k (i). UAV k is located at x k,i . The unit direction vector from the fish location to the target is given byū o k,i and is a function of θ k 5, whereū o k,i and d o k (i) are the exact values. The estimated k (i) of d k (i) takes into account any disturbance or measurement errors (see [21]).
B. MOTION CONTROL ALGORITHM: Using the Euler approximation, each k th UAV coordinate (x k,i , y k,i , θ k,i ) in the networked school is updated according to  where i is the time instant and t represents the sampling time, which is assumed to be uniform in this paper. The inputs u 1 k,i and u 2 k,i are controlled in a closed loop to drive the UAV to the desired (x d k,i , θ d k,i ) that varies depending on the different operational modes. Since the predators are always in motion, each UAV calculates a local estimate of the target location w f k,i and the predator positions w p k,i in real time. To further illustrate how the UAVs cognitively compute their velocities, Figure 5 gives the control configuration for each UAV.

C. MOVEMENT TO THE TARGET
This mode is valid when no predator is within the safe zone boundaries and the UAV is still active. When a particular UAV is within a predefined distance r down < r p from a predator, it becomes inactive and is no longer part of the group. For all other UAVs, the scenarios illustrated in Figure 6 and formulated in Algorithm (1) apply. These different scenarios relate to zones I, II, III, and IV ( Figure 6) and are used to define the next action by each active UAV.
γ is a design parameter used to balance the attractive forces in both velocity and position. v f is the velocity of the target, and v x is the velocity of the UAV. In this work, the target can be in motion. The indicator function I v f is equal to zero when the target is at rest (v f = 0) and to 1 otherwise. UAVs are also aware of the speed of the target and therefore adapt their velocities accordingly. The velocity of the UAV in each of these zones can be defined with respect to the nearest predator as in Algorithm 1: To find the desired position and angular orientation of the 7: Evasion zones II and III ( Figure 6): 8: Evasion zone IV (Figure 6): target, the following relations are used: During evasion maneuvers, the connected network of the fleet is broken, and small groups of UAVs form several local networks (see Figure 10). These small networked groups are copies of the original group and therefore obey the same conditions of social behavior. There is a need to cluster them to recognize where they are and to reconnect them with clusters having edges within the communication zone.

IV. AGENT CLUSTERING USING DBSCAN
Clustering is a technique used in data mining and consists of finding structure in the collected data by grouping objects having similar characteristics. The resulting groups are called clusters. The similarity is often captured through features such as distance in a normed data set. Typical methods in clustering are based on solving the k-means problem. Detailed VOLUME 8, 2020 reviews of popular clustering algorithms are provided in several books (see, for example, [58]). DBSCAN is a densitybased clustering algorithm first presented in [59]. Since then, it has been implemented in many real-life applications.
In addition to being available in many toolkits, the algorithm has been studied in many publications (see, for example, [57] and [55]). The main idea that governs the DBSCAN algorithm and its extensions and revisions is that points in the dataset belong to the same cluster if they are density reachable from each other [56]. Formally, let D be the dataset and p ∈ D be a set of points in D. The following definitions are from [59], but the notation and presentation are identical to those of [56]. Definition 1 ( -Neighborhood): The -neighborhood, N (p), of a data point p is the set of points within a specified radius around p: where d is a prescribed distance measure and is > 0.

Definition 2 (Point Classes [56]): A point p ∈ D is classified as
• a core point if N (p) has high density, i.e., |N (p)| ≥ minPts where minPts is a positive integer and the userspecified density threshold, • a border point if p is not a core point but is in the neighborhood of a core point q ∈ D, i.e., p ∈ N (q), or • a noise point otherwise. Figure 8 illustrates the definition of point classes in density-based clustering algorithms such as DBSCAN.  points p 1 , p 2 , . . . , p n with q = p 1 and p = p n such that p i+1 is directly density-reachable from p i ∀i ∈ 1, 2, . . . , n − 1.

Definition 5 (Density-Connected): A point p ∈ D is density-connected to a point q ∈ D if there is a point o ∈ D such that both p and q are density-reachable from o. Definition 6 (Density-Based Cluster): A density-based cluster C is a non-empty subset of D satisfying the following conditions:
1) Maximality: if p ∈ C and q is density-reachable from p, then q ∈ C. 2) Connectivity: ∀p, q ∈ C, p is density-connected to q. The DBSCAN algorithm starts with a random point p and performs a depth-first search (DFS) to identify all its -neighbors. This will form the first cluster. The algorithm continues to apply the same DFS to expand the cluster, which is complete only if no more core points are found. Another random point is then selected from the remaining points, and the algorithm starts all over again. After all points are processed, points that do not belong to an identified cluster are considered noise points. Selecting the appropriate and minPts is crucial and may change the identified clusters.
Once a predator attacks the fleet of UAVs, the network is broken into smaller groups as stated previously. For their reunion and biological organization to take place, each UAV at the outer boundaries of the smaller groups must calculate the position of the other groups and advance to them. First, each UAV determines if it is on the edge: where x k l,i is the position of UAV l with respect to k, and W (v) is an orthonormal matrix defined in [21]. for Each UAV i i = 1, . . . , N do 4: if UAV is inactive then set all velocities to zero. 5: else(only active UAVs) 6: for Each neighbor of UAV i i = 1, . . . , N do 7: Compute required input velocity to avoid collision and respect safe distance. Compute distance from non-neighbors. 12: Identify possible new (left, right, or front neighbors) from non-neighbors. 13: Reunite with new neighbors. 14: end for 15: end if 16: end for 17: end procedure

A. COHERENT MOTION
For UAVs to adequately follow the social behaviors of a school of fish, they must move collectively to confuse the predator and keep a safe distance r from each other to prevent collision with their neighbors. Therefore, the distance between UAV l and UAV k must satisfy the following equation: where r is the predefined safe distance required between the UAVs and ε is a very small positive number. The cohesion and anticollision objectives are attained by solving an objective function (see [47]). The solved minimization problem is used to obtain the following potential field forces: The velocity of UAV k due to coherent motion can be defined is the local velocity value of the network's center of gravity and γ is a nonnegative number. Using the diffusion adaptation technique in equation (4), the distributed v g i,k can be estimated as follows: where superscript v shows a relation with v g and a v l,k satisfies equation (3).

B. MOTION CONTROL FOR THE TARGET V. DISTRIBUTED VELOCITY ESTIMATE
Combining all the identified biological behaviors, UAVs will adapt their velocities according to the combined velocity estimate: where γ , β, α and λ are nonnegative weighting elements, while I i,k is a switching function that is either zero if v a i,k+1 and v b i,k+1 are zero or 1 otherwise. To ensure that the distributive velocity estimate meets the nonholonomic constraints of a UAV, a maximum velocity v max is set for the UAVs.

A. THE EVASION PHASE
When the UAVs are attacked by a predator, they will search to evade and look for safety by making acrobatic maneuvers to prevent such attacks from damaging or inactivating them. This scenario has been envisioned in [50]. The author conceived of a fully autonomous UAV that would be capable of executing evasive strategies when challenged by an adversary. This is the essence of the evasion phase. We propose evasive strategies whereby each UAV would track a certain planned straight-line trajectory to maneuver and evade the predator.

1) PATH PLANNING AND TRAJECTORY GENERATION
During evasion, the UAV changes its path by following a trajectory composed of a straight-line segment at an angle θ d adjacent or perpendicular to the original direction of the UAV. Given a Cartesian plane, the line direction that the UAV would track depends on its current location and the direction from which the predator is coming. To analyze this further, the plane will be partitioned into four trigonometric quadrants to consider all the possibilities.
The UAV computes the distance d p k between the predator and itself in real time. At time t 0 , once d p k < r p , the UAV senses the danger within the defined safety zone and switches from its planned foraging trajectory and social behavior to an individualistic evasion mode. The position of the UAV (x(t 0 ), y(t 0 )) is stored, as it would serve as a reference point during the trajectory generation.  The straight line for the evasion path is defined using a set of parametric equations: The variableλ(n) is called the path parameter. It is set as an arithmetic progression that increases to define the tracked trajectory. n is the iteration number during the execution of the evasion maneuvers.

2) EVASION STRATEGIES
There are several ways to design evasion trajectories. In [43], four quadrants were used to compute the inverse tangent of the angles.
• The four-quadrant inverse tangent ''a tan 2'' is used for the computations of the angles because it gives an angle value between −π and π .
• θ np is defined as the actual UAV-to-predator angular direction and is used to decide to which direction the UAV turns to evade the predator.
• θ d is the desired heading of the UAV path that leads to a safer region. θ d is computed using the fourquadrant inverse tangent a tan 2; therefore, its value is also between −π and π .
• θ p is the estimate of the predator's approach angle. In deciding the orientation that the UAV will choose to evade, we compare the angles θ p and θ np − 180 and θ p and θ np + 180 as follows: a) Quadrant 1: In the first quadrant, once a danger approaches, i.e. d p k < r p and θ p ≥ θ np − 180, the desired evasion angle is given as where θ c is the tangential angle (for example, pi/4) desired for evasion. Here, the adversary UAV approaches at an angle between −π and − π 2 ; the UAV evades the predator and tracks an orientation between 0 and π . The detailed conditions for evasion and the respective desired angles for each quadrant are given in table (2).

B. ESTIMATING THE GLOBAL VELOCITY & LOCATIONS OF THE ADVERSARY & TARGET
The goal is for the UAV to compute the adversary's location w p . In reality, the location of the predator or the target is obtained using a GPS. Using the ATC diffusion algorithm discussed in equation (4)

C. PREDATOR BEHAVIORS
The predators are also nonholonomic UAVs, as stated previously. The algorithm below (3) allows computation of the required velocities of the predators. Let V p d , w p d l,k , and θ p d k be the desired velocity, position, and orientation of predator l at instant k, respectively. To estimate the same quantities at k + 1, we use the following relations: γ 3 , γ 4 , γ 5 are positive design parameters that can be selected to balance the different requirements of the velocities.

D. TARGET BEHAVIORS
The target is at rest until a UAV is within a certain distance. Once the target is in motion to flee the pursuing 6: Attack mode: Let UAV, its desired speed can be determined using algorithm (4):

VI. TRACKING CONTROL OF UAVs
In this section, we will integrate all the concepts proposed in the previous sections by developing control techniques that ensure the desired trajectories planned by the navigation algorithms are followed as expected. We discuss the tracking problem for a single UAV and then explore implementing the control algorithm on a fleet of UAVs. We also shed more light on the trajectory generation process and trajectory switching conditions. The control schematic for a single UAV closedloop system is shown in Figure (5).

A. TRAJECTORY GENERATION
Based on the information in Table 2, the trajectory generation algorithms are combined in a concise manner as follows. Let [x d y d ] be the desired states from the trajectory planning, θ d − the desired steering angle for θ s ,ṽ d − be the desired UAV linear velocity in the presence of attacks obtained from the evasive control strategy, V d − be the desired UAV linear velocity in the absence of attacks, and w d − be the desired UAV angular velocity in either the presence or absence of attacks. A more elaborate definition will be given for the desired velocities in the next subsections based on the presence or absence of predators.

1) ABSENCE OF PREDATORS
When there are no predators within the prescribed safe area, each UAV mimics the behaviors dictated by the bioinspired predator-prey algorithm. The velocity obtained is used to obtain the next desired position of the planned trajectory.
It is important to note that this trajectory should also satisfy the nonholonomic constraints of the UAV. Thus, the desired trajectory in the absence of predators is given by:

2) PRESENCE OF PREDATORS
In this case, the UAV will track a desired straight line, which was described in section (V-A2), based on its state when it first senses the presence of the predator. The desired trajectories are given in equation (19).

B. SINGLE UAV TRACKING ANALYSIS
Before considering a fleet of UAVs, we first develop a control technique that ensures the tracking of the desired path. A tracking controller is thus developed for the nonholonomic UAV model. Indeed, during evasion, the UAV is trying to escape and therefore is not required to synchronize its movement with that of the other members of the fleet. However, during foraging, the fleet must observe social behavior. In the next two sections, we will describe the controller design for the case of a single UAV and then treat the design for the case of the fleet as a flocking problem.

1) ROBUST FEEDBACK CONTROLLER DURING EVASION MODE
A nonlinear controller based on the backstepping method is designed to achieve asymptotic tracking of the UAV to a VOLUME 8, 2020 Theorem 1: Let v d be given by equation (18) and A c ∈ R 2 be a Hurwitz matrix designed according to the dynamics of the desired error. For a single UAV under unknown but bounded disturbances given by equation (38), the following control law ensures that the system is uniformly asymptotically stable.
where the design parameters k 1 and η are positive scalars. Proof: We will follow in this proof the same procedure as in [45]. Let the system in (1) be written as follows: Let u 1 = ||v|| cosθ and v d = v d x v d y be the desired velocity set by the guidance and navigation algorithm. v x and v y are the corresponding velocities along the x-and y-axes, respectively. This leads to in the case where v x = 0, θ d = 90 o and in the case where v y = 0, θ d = 0. Therefore, v x = ||v|| cos θ d and v y = ||v|| sin θ d . This allows us to write (38) aṡ Using trigonometric properties and recognizing that θ =θ + θ d , equation 41 leads tȯ where G(θ) is nonsingular ifθ = 90 o . In navigation, 90 o is always avoided and practically impossible to achieve. We will therefore assume that the desired angle that requests a 90 o difference from the actual angle will not be considered. Hence, the following direct feedback linearizing controller can be proposed: This allows us to write the dynamic of the error aṡ X = A cX (46) where A c is a Hurwitz-stable matrix with the desired eigenvalues. Because the system dynamics are subject to an unknown but bounded external disturbance , a robustifying term is required. Using a Lyapunov candidate functional W = 1/2X TX , the control law in equation (47) can be made robust as follows: where η >¯ and¯ max( ). This leads tȯ

2) TRACKING THE FORAGING TRAJECTORY
In this subsection, we will consider the case where the fleet is not under attack. This is the case for multiple nonholonomic UAVs schooling toward a target; it represents a typical flocking or schooling problem except that in this case, because the UAV operation mode changes to foraging after an attack, the original network could be fragmented and composed of several strongly connected groups each with its own network. The clustering technique presented in section IV identifies each subnetwork. Remark 2: In the case where the network is composed of a cluster containing one UAV, the control law given in theorem 1 will be used.
Let C k be the number of clusters as identified by DBSCAN . The algorithm also identifies the corresponding UAVs that form a given cluster C i . Theorem 2: Let C i be a cluster of strongly connected networks formed by N C i UAVs under unknown but bounded disturbances. Let the desired velocity v d i,k be given by equation (18) and A c i ∈ R 2 be a Hurwitz matrix designed according to the dynamics of the desired error. For the i th UAV, the following control law ensures that the system is uniformly asymptotically stable: where the design parameters k i 1 and η i are positive scalars.
Proof: The proof of this theorem is composed of three parts: the design of the controller and the stability of the multiagent system, the guarantee that the error in positions is according to the required safety distance r, and the consensus on velocity to guarantee coherent motion. For part 1, Theorem (1) can be easily used to show that the system is uniformly asymptotically stable. For part 2, since each cluster C i is a strongly connected system, the Adapt-Then-Combine diffusion algorithm equations (15)-(18) ensure that each node will respect the distance r given in equation 16. Based on equations (15)- (18), the coherent motion will be such that v i,k will converge to v g i,k (equation 17), the local speed of the center of gravity of network C i .
• During path planning for a nonholonomic UAV, the objective of tracking certain trajectories can also be achieved using non-smooth paths. Unfortunately, such non-smooth paths usually occur as a result of a large velocity input, which can be too large and impossible for the nonholonomic model to achieve in real applications due to the nonholonomic constraints. Thus, to attain smooth tracking of the reference paths, a maximum value is used to limit the velocities.
• Using Algorithm (3) and equation (24), Theorem 1 can be used to find the necessary local control law for predators during hunting.
• Using Algorithm (4) and equation (31), Theorem 1 can be used to find the necessary local control law for the target during evasion.

VII. SIMULATION EXAMPLE
We consider several examples to highlight some of the important features in this approach. The simulation requires inputting the initial positions of the UAV fleet, predators and target. It also requires inputting different radii to set up the dynamic motion of the scenario at hand. Figure 10 shows the fleet in motion toward the target. The initial distribution of the group of N = 25 UAVs was such that the following requirements had to be met: the distance between neighboring agents was set according to equation 16) with r = 4 and = 0.5, the initial target position was w f k,1 = (60, 60) and the predators initial positions were set to w p k,1 = (60, 65) for predator 1 and at (60, 55) for predator 2. In all the coming simulations, the simulation time = 200 sec; the sampling time = 0.1 sec. The zone around the target that the predators have to avoid is set to a circle centered at the target with radius r ft = 12. Figure 10 illustrates the obstacle avoidance capabilities of the algorithm and how the foraging motion toward the target is harmonious. Figures 11 and 12 illustrate the model performed with N = 9 and N = 4, respectively. The target is placed at w f k,1 = (50, 50). Figure 11 shows the group initially placed at positions less than the required minimum separation r = 4.   The fleet starts by adjusting their distances and repositioning themselves as required. In Figure 12, the initial positions of the group are such that the separation between them is greater than what is required, r = 3, with = 0.5. The figure shows how the individual UAVs correct their positions as required. The time to adjust the positions is not instantaneous, as we are dealing with nonholonomic systems and not points of mass. In both tests, the fleet starts as a single network. In Figure 13, we repeat the same test with N = 25 and r = 3 with   = 0.5, but the system initially starts as two different groups. The two clusters start by correcting the positions of the different UAVs to satisfy the distance requirements and then move harmoniously in the foraging phase toward the target. Figure shows the transient UAVs evading the predator. One can see that the distance between two UAVs becomes smaller than what it is required. However, two other UAVs start moving in a direction that accommodates the distance requirement. During attacks, the network can be divided into   several groups. In Figure 15 and 16, an attack by the predator is already underway. One can see the network divided into several groups, some with only one UAV. The different groups are in different modes. Some UAVs have been inactivated by predators, some are still in evasion mode, others are back to foraging and observing social behavior, and one group is already in pursuit of the target, having initiated its own evasion strategy. The tail of the UAVs in 16 shows the evasion paths the UAV took to evade the predators. The two paths of the predators are also clear and show how they avoided the target by going around it.
Remark 4: One can also see from 16 the presence of an outlier, defined as a UAV performing an evasion that keeps going away from the field and target. It seems natural that the best choice for the predator is to go back and abandon the chase. In the literature, there are several proposed methods for addressing this phenomenon (see, for example, [31]). However, we did not consider this in our work.

COMPLEXITY OF THE ALGORITHM
The complexity of the algorithm is measured by looking at the execution time as a function of the size of the UAV fleet. Table gives an estimate of the execution time required to complete a simulation that runs in 200 sec. Using EXCEL fitting, we can see from Figure 17 that the complexity increases linearly as a function of the size of the UAV population.

VIII. CONCLUSION
In this work, we used a biological model of a school of fish and of predators such as sharks to control a fleet of nonholonomic UAVs in an environment where they can come under attack by enemy UAVs. The problem we considered was designed in the contexts of a flocking problem, an obstacle avoidance problem, a tracking problem, and a collision avoidance problem. During a predator attack, DBSCAN is used to cluster the divided network. Each cluster can be in a different operational mode. The path tracking controller was based on a feedback linearization approach, and the same type of controller was implemented to control both the predators and the UAVs. The motion of the UAV fleet follows social behavior requirements during foraging, but because each system takes time to adjust, the distance requirement could not be satisfied during transient or evasion modes, where the behavior tends to be individualistic.
For future work, there is a need to quantify the transient period during which distancing is not satisfied. The adopted biological model assumes a simple attack strategy based on nearest prey. There is no priority given in selecting the prey, and all are considered equally important. A better approach could be to assume a game between the predator and the prey with high score values given to those prey that are closer to the target. The motion of the predator-prey system considered in this work is modeled in 2-D. A 3-D model could be used, and therefore, more realistic group behavior can be studied. In addition, better and complex evasion strategies can be designed. In addition, the system developed does not learn. Neither the predators nor the prey can learn each other's moves and plan their actions accordingly. This system could be a good base for the application of machine learning and the use of AI in path planning and evasion countermeasures.