Distributed resilient ﬂocking control of multi-agent systems through event/self-triggered communication

This paper proposes a distributed control scheme for multi-agent systems to achieve resilient ﬂocking behaviour via event-based communication. The control scheme can pro-vide the required connectivity conditions to form a ﬂock in the presence of cyberattacks in the network. This method is presented in a fully distributed manner to avoid the use of global data. The developed event-triggered update rules can mitigate the inﬂuence of the non-cooperative agents with the weighted mean subsequence-reduced algorithm and reduce unnecessary communication among them. It is proved that under the proposed method, convergence is guaranteed and there is no Zeno behaviour exhibited inherently. To relax the requirement of continuous monitoring of self-state, a self-triggered mechanism is proposed further. Simulation results are given to illustrate the theoretical analysis and show the advantages of the event- and self-triggered controllers.


INTRODUCTION
Flocking behaviour in multi-agent systems was inspired by the mass movement of animals in nature such as the aggregate motion of a flock of birds, a herd of land animals, or a school of fish. It has attracted intensive attention due to its wide applications such as distributed sensing using mobile sensor networks; self-assembly of connected mobile networks; automated parallel delivery of payloads; and performing military missions such as reconnaissance, surveillance, and combat using cooperative unmanned aerial vehicles [1]. In 1986, Reynolds proposed three rules that led to the formation of the flock in computer animation [2]. These rules are named by alignment: Attempt to velocity synchronisation in flock-members, cohesion: Attempt to stay close to flock-members and separation: Avoid collisions among flock-members. Event-triggered control is a class of control strategy in which the controller is actuated by the occurrence of a special event [3]. The ability to reduce control costs and save resources makes event-triggered control appealing in resource-limited control systems. For example, the application of the event-triggered control strategy in a multi-agent system equipped with microprocessors can decrease the power consumption and increase  [4]. Due to these advantages, growing attention has been paid to event-based control systems.
Some results related to different event-triggered control strategies have been reported in the current literature concerning multi-agent cooperative control. In [5], the average consensus problem for multi-agent systems (MASs) was addressed based on the event-based control strategy which renders both control signals and state measurement. In [6], the eventtriggered average-consensus problem for multi-agent systems with direct and weighted topologies was investigated. In [7], the distributed rendezvous problem of multi-agent systems with novel event-triggered controllers was studied. Also, a combinational measurement approach to event design and developed the basic event-triggered control algorithm was used. In [8], the leader-following consensus problem was investigated for a class of switched non-linear multi-agent systems via event-triggered protocols, where the switching signal of each agent is different. Some distributed event-triggered control algorithms on the flocking problem have been proposed in [9,10]. In these studies, a virtual leader is assumed to be tracked in the flocking motion. Generally, the flocking motion is easier to achieve when all agents are able to communicate with the leader, while for the leaderless flocking problem, limited communication and only local information pose a challenge for the coordination among agents.
Cybersecurity problem is a critical issue for this kind of systems [11]. Control algorithms of networked MASs are generally computed distributively without having centralised monitoring for the activity of agents. Therefore, unforeseen adverse conditions such as uncertainties or attacks can easily result in system instability and prohibit the accomplishment of the system objective [12]. There are two types of attacks on MASs, attack to connection links [13,14] and attack to agent's dynamics [15,16]. To mitigate the effects of attacks on agent's dynamics, a weighted mean subsequence-reduced (W-MSR) algorithm is used. This algorithm is practical and useful while its implementation is straightforward. Essential works on the W-MSR algorithm can be seen in [17,18]. The W-MSR algorithm has been used to reach resilient consensus for second-order MASs in the presence of misbehaving agents [19] and resilient attitude alignment of leaderless multi-spacecraft systems in the presence of cyberattacks [20]. Also, in [21], the W-MSR algorithm has been employed to mitigate the effects of Byzantine nodes in directed networks in the consensus problem for switched MASs.
In [22], the authors presented a control law that allows a team of mobile robots to reach resilient flocking in the presence of non-cooperative robots. Their strategy relied on dynamic connectivity management. Also, in [23], the problem of flocking of multi-agent systems in presence of uncertainties and unknown disturbances was investigated. A biologically inspired distributed resilient controller was proposed based on a computational model of emotional learning.
In the previous studies on resilient flocking control [22], a large volume of information must be communicated in the network due to a large number of members in the flock and high connectivity requirements of resilient control. On the other hand, its method isn't entirely distributed and needs some global information. But in our study, these problems were addressed by event/self-triggered communications and distributed control structures, respectively. Hence, the system can be easily extended to a large scale. The contribution of our study is to show how the event-triggered as well as the self-triggered techniques can be implemented over MASs under the cyberattacks and the Vicsek model to reach flocking behaviour and reduce unnecessary transmissions. The use of the W-MSR algorithm needs strong connectivity among agents, but these techniques can save the communication bandwidth and computation resources.
In this study, the purpose is to achieve resilient flocking behaviour in MASs with the Vicsek model [24] and dynamic network based on consensus protocol. An event-triggered threestate control system is designed to regulate relative distances in the MAS and make the agreement in direction of motions with saving energy in data transmission and reducing bandwidth requirements. Attack on the agent's dynamics causes the cooperative agents to become non-cooperative. F-locally bounded model is considered. In this model, each cooperative node has up to F non-cooperative neighbours, which threaten the group objective by preserving other agents from achieving valid states. The W-MSR algorithm is used to make attacks inef-fective. The proposed control method guarantees to achieve resilient flocking for dynamic networks. Each state has a distinct event-triggering condition (ETC), and agents release their states regarding the ETC. Then, a novel self-triggered structure is suggested. Therefore, continuous monitoring of measurement suffered by the event-triggered control scheme can be avoided.
The rest of the study is organised as follows. In Section 2, notations and preliminaries on graph theory are given. The main results of flocking in MAS with distributed event-triggered control and distributed self-triggered control are presented in Sections 3 and 4. In Section 5, simulations are presented to validate the theoretical results. Conclusions are drawn in Section 6.

PRELIMINARIES ON GRAPHS
Some basic notions on graphs are introduced for the analysis in this section. An undirected graph G = ( , ) is used to model the communication topology of the multi-agent system, where = {1, 2, … , n} is the node-set representing the agents and ⊆ × is the undirected edge-set representing communication links. The neighbour-set of the ith agent is defined as The function A i j is determined to show the quality of the communication links between every pair of nodes(i, j ) based on their position in Euclidean space, x i ∈ ℝ d [25].
where R defines a cutoff distance where the signal becomes unusable and defines a saturation distance where the communication between agents does not change as they get closer together. Based on function A i j (Equation (1)), the Laplacian matrix is defined as For Laplacian matrix L, because we restrict the function A i j to be positive, all the eigenvalues are real and they satisfy 0 = 1 ≤ 2 ≤ … ≤ n and 2 > 0 if and only if the graph is connected. The second smallest eigenvalue 2 is called algebraic connectivity of the system. It is an indicator of how much the topology graph is connected. In the remainder of this section, some important and basic definitions are provided.
Definition 2 (r-robust). A graph G is r-robust if for any pair of nonempty, disjoint subsets S 1 , S 2 ⊆ , at least one of them is r-reachable. Definition 3 (flocking). A group of agents is said to flock when all agents attain the same velocity vector, distances between the agents are stabilised and no collisions among them occur.

Definition 4 (non-cooperative agent). An agent is cooperative if it applies the consensus update rule at every sample time and shares the result with its neighbours at each transmission. It is called non-cooperative otherwise.
Definition 5 (resilient-consensus). A multi-agent system is said to reach resilient consensus if the following conditions are satisfied, even in the presence of up to F non-cooperative agents in the neighbours of each cooperative agent.
(a) Safety condition: There exists an interval S that the cooperative agents' value remains in the interval for all k. (b) Consensus condition: The cooperative agents achieve consensus to a value that lies between the maximum and minimum initial values of the cooperative agents.
Following lemma is the main result in [22] that characterises the robustness of the communication network topology by a metric, and its validity has been proved.

EVENT-TRIGGERED RESILIENT FLOCKING
Considering an MAS of N agents with a connected undirected graph G, the dynamics of each agent can be described as where x i (k) and u i (k) are the position and the control input, respectively, of agent i at t = kT for k ∈ ℤ + . In this study, the Vicsek model is used to model agents. In this model, particles are driven with a constant absolute velocity, and at each time step, the assumed average direction of motion of the particles in their neighbourhood is added [24]. So, the velocity of an agent V i (k + 1) is constructed to have an absolute value v and a direction given by the angle (k + 1). To achieve essential features of flocking behaviour, such as agreement in velocity and direction of motion, following event-triggered update rule is applied for the direction of motions.
wherêj (k) is the last communicated direction of node j and k j 0 , k j 1 , … denotes the transmission times of node j deter- Three-state event-triggered controller mined by an ETC. The weight i j (k) satisfies i j (k) > 0 and ∑ j i j (k) = 1. Each agent updates its direction using its neighbours' information and only when the ETC is satisfied, the agent sends its state to its neighbours. We assume the maximum number of the non-cooperative agents in the neighbourset of the cooperative agents as known and determined by F . In this update rule, the W-MSR algorithm is used to decrease the effects of the non-cooperative agents in the network. The W-MSR algorithm has three steps. First, every cooperative node uses the valueŝj (k), j ∈ N i , most recently communicated from the neighbours and creates a sorted list of them from largest to smallest. Second, comparing with i (k), node i removes F largest and F smallest values from the list. If the number of values larger or smaller than i (k) is less than F , then all of them are removed. The set of values that remained in the list is denoted by  i (k). Third, each cooperative agent updates its value using Equation (4). With this algorithm, if the value of robustness is at least 2F + 1, resilient consensus will be guaranteed. It means that for implementation of the W-MSR algorithm, the condition r ≥ 2F + 1 must be confirmed at each sample time. So it is necessary to control the value of robustness via connectivity control during runtime. To this end, an event-triggered controller with three states is designed. The level of robustness must be computed repeatedly, and the value of r must be preserved in the range of r ≥ 2F + 1. For a given time-varying network, calculating the level of robustness is an intricate problem. For this reason, we use a lower bound of r to control relative distances in the system. Using Lemma 1, 2 2 is a lower-bound for r and 2 must be preserved in the range of 2 > 4F to satisfy r ≥ 2F + 1. The structure of the event-triggered controller can be seen in Figure 1. The system switches from one state to another according to the value of current algebraic connectivity. Also, each state has a distinct ETC.
In state 1, the amount of 2 is less than 4F ; therefore, the system is not guaranteed to achieve resilient consensus. In this state, the agents apply control law as in Equation (5), which increases the algebraic connectivity of the system: where∇ i 2 is an event-triggered gradient of 2 , which can be computed from Equation (6). Equation (6) is an event-triggered form of ∇ i 2 in [25]. For the calculation ofv 2 , the distributed method in [26] is used in an event-triggered manner: where x i, is a single element of x i . ETC in state 1 is considered as follows: where a 1 , b 1 , c 1 > 0 are positive constants. In this state, the purpose of the control is increasing the number of connection links by closing agents together. So, the error for the ETC is defined based on the location information in the next sample time x i (k + 1) and the last location information which has been sent to the neighboursx i (k).
In state 2, the amount of 2 is more than 4F . Therefore, the system is guaranteed to be (2F + 1)-robust, but the system is close to the critical situation of state 1, so the control law in Equation (9) is considered, which includes the main flocking objectives and also assuring the network remains connected: where is chosen such that d 2 dt > 0 . ETC in state 2 is considered as follows: where a 2 , b 2 , c 2 > 0 are positive constants. In state 3, when the system is far enough from the critical situation, it means 2 > 1 (4F ), 1 > 1, control law in Equation (12) will be applied to the agents to obtain flocking behaviour.
ETC in state 3 is considered as follows: where a 3 , b 3 , c 3 > 0 are positive constants.
If the algebraic connectivity of the system decreases and 2 < 2 (4F ) for 1 < 2 < 1 , the system returns to state 2.
In this study, Zeno behaviours are effectively avoided. The event-triggered control is based on periodic event detections. Every two neighbouring event detections are performed discontinuously and separated by a fixed time step.
In the following theorems, we show that by using the controller in Equation (5), the system goes from states 1 to 2. In other words,∇ i 2 can meet control objectives instead of ∇ i 2 properly (Theorem 1). Then by regulation of the parameter in Equation (9), the system never re-enters state 1. When the agents are in states 2 and 3, it is guaranteed that they will agree on a direction of motion through the resilient consensus protocol even in the presence of up to F non-cooperative agents (Theorem 2). The switching frequency between states 2 and 3 is limited. An upper bound for it will be calculated (Theorem 3). Figure 1, if the system is in state 1, the elements of∇ i 2 converge to the elements of ∇ i 2 and the controller in Equation (5) drives the system to state 2:

Theorem 1. For a multi-agent system with the Vicsek model, timevarying undirected topology and the controller in
Proof. The elements of ∇ i 2 and∇ i 2 are defined as g i, and g i, , respectively.
Also,ĝ i, has a similar form of Equation (20). For the computation of the matrix L x i, , just the elements containing x i, might be non-zero. These elements are in the i-th row and column with j ∈ N i and diagonal elements. Also, we write the equations for the neighbours in the interval ≤ ‖x i − x j ‖ < R; otherwise, equals zero: A 2i So, ‖ĝ i, − g i, ‖ can be written aŝ According to Equation (1), is as follows: The first term of the right side of inequality in Equation (24) is examined with j = 1, i ≠ j .
Equation (27) converts to: A similar process is applied to the rest terms in Equation (24), and it can be written aŝ According to the results in Equations (28) to (31), in all conditions, the elements of∇ i 2 converges to the elements of ∇ i 2 . By using Equation (31) for all elements of∇ i 2 − ∇ i 2 , Equation (15) is achieved. Figure 1, if the system is in state 2, it will never re-enter state 1, and if there are no more than F noncooperative agents, the direction of the agents will asymptotically converge to the same value.

Theorem 2. For a multi-agent system with the Vicsek model, timevarying undirected topology and the controller in
Proof. If the system is in state 1, according to Theorem 1, it will move to state 2. The system never returns to state 1 if the parameter is chosen such that 0 ≤ d 2

dt
. Therefore, it suffices to show that: By using the chain rule and Equation (33), Equation (32) can be rewritten as Using the controller from Equations (9) and (34), the following condition for is arrived: Because there is no access to ∇ i 2 at each sample time, the condition in Equation (35) can be rewritten as max e g i, = 4nh (38) Equation (38) is the maximum value of error in Equation (37). The sign of errors in Equation (36) should be chosen in such a way that the amount obtained for is more conservative.
In states 2 and 3, the system is guaranteed to be (2F + 1) -robust. So according to the results in [27], each cooperative agent will converge to a common value for direction of the motion, as long are there are no more than F non-cooperative agents. Figure 1, if there are no more than F non-cooperative agents, the switching frequency between states 2 and 3 is bounded and

Theorem 3. For a multi-agent system with the Vicsek model, timevarying undirected topology and the controller in
Proof. By the regulation of such that 0 < d 2

dt
, system will inter to state 3. The minimum time of switching from states 3 to 2 must be considered. To investigate that, Equation (33) is used as For off-diagonal entries of [ ] i j , k ∈ {i, j } : And for diagonal entries of [ According to the first theorem of [27], the consensus error | i − j | has an upper bound that we name it by . So, the value of | i − j | converges to a constant small value by arriving at the consensus on the direction of the motions in state 3. As a result: So, Equation (40) converts to the inequality in Equation (47).
When the system enters states 2 from 3 and 2 < 2 .(4F ), the time of the switching is called T s32 . Using Equation (58) and 2 < 2 .(4F ), a lower bound for the switching time is obtained.
So, the frequency of the switching becomes limited as

Computation ofv 2
For the computation ofv 2 , the distributed algorithm in [26] is modified with the event-triggered mechanism. w i is a row vector associated with each agent whose entries are the ith component of all the eigenvectors of L. Also, W is a matrix, and its rows are We assume that ith agent receivesŵ j = w j (k j l ) , j ∈ N i from its neighbours when f j,s > 0 , s ∈ {1, 2, 3} and compute w i by the following algorithm at each sample time. So, matrix W converts toŴ .
Also, for ortho-normalisation of the row vector e (s+1) i , we use the centralised ortho-normalisation approach. The orthonormalisation is typically performed by the factorisation of the matrixŴ in the form E =Ŵ H, where the rows of the matrix E are not orthonormal eigenvectors e i and H is an upper triangular matrix that must be computed by the following algorithm: This distributed algorithm can estimate all eigenvectors of the Laplacian matrix. In the next step, regarding −Lv 2 = 2v2 , each agent can estimate 2 as where i 2 is the estimation of 2 for agent i.

SELF-TRIGGERED RESILIENT FLOCKING
The event-triggered scheme proposed in the last section needs each agent to monitor its states continuously to check the triggering function. In this section, the results related to state 3 are extended to the self-triggered scheme (Figure 2), so the continuous self-state monitoring is relaxed. In state 3, the next triggering instant is preset at the previous triggering instant and no monitoring is required between two triggered events.
Let T i be a trigger interval between the trigger times k i l and k i l +1 , that is, Note that a trigger is not executed and agents do not update their control inputs u i between FIGURE 2 Three-state self-triggered controller the trigger times k i l and k i l +1 . Then we have Then, for each agent, k j l ′ j is the latest event time instant before the current sample time k. Also, the error that is defined in Equation (13), in the trigger time k i l + T i is The ETC in state 3 was e i,3 (k i l + T i ) = a 3 + b 3 e −c 3 (k+1) , so it can be rewritten as So, the next trigger instant can be evaluated as According to Figure 2, the self-triggered communication is applied in states 2 and 3. In state 1, there is no control effort in i (k), and Equation (54) is not satisfied. So, this state remains with the event-triggered mechanism.

NUMERICAL EXAMPLE
In this section, some simulations were made to verify the performance of the event-triggered control system ( Figure 1) and the self-triggered control system ( Figure 2). An undirected MAS is considered with n = 6. Agents were initialised in a pattern as depicted in Figure 3. The attacks may occur in the agent located in the centre (F = 1). We indicated that with red colour. The system parameters are chosen as = 0.5 , 1 = First, the event-triggered three-state control system was applied to the MAS without the occurrence of an attack. The parameters of the event-triggering conditions are chosen as The trajectory of 2 has been plotted in Figure 4. It rises from 3.4 (in state 1) to 6 (in state 3). The amount of 2 in state 3 must satisfy the condition 2 > 5.3, but because of a jump before reaching 5.3, 2 arrives at 6. The cause of these jumps in the 2 diagrams is the entrance of the agents from the exponential interval to the constant interval A i j = 1 in Equation (1). Figure 5 shows the behaviour of the agents in the 2D coordinate system. The agents initially close together to enhance the connectivity, then they start to align and reach a consensus on the direction of the motion. The heading value ( i ) of the agents is shown in Figure 6. According to the figure, the heading value of all agents converges to a particular value accurately. Sample times have decreased significantly for each agent compared to the time-triggered approach. Moreover, there is no data transformation after convergence.  In the next experiment, we considered that agent 6 was attacked and the attacker injected a constant value into the actuator. Figure 7 shows that cooperative agents neglect noncooperative agent data and align with each other. The consensus value and attack value are shown obviously in Figure 7. Then, a time-varying attack was applied to agent 6. According to Figure 8, the heading value of agent 6 varies with time in a sinusoidal form. Likewise, this kind of attack was repelled well and the cooperative agents reached the consensus on the direction of motion.
To examine the performance of the self-triggered mechanism, we repeated the last experiments with the self-triggered control system (Figure 2). Consensus on the motion directions in three cases (no attack, constant attack, and the time-varying attack) was achieved, and the attacks were repelled successfully (Figures 9-11). Compared to the event-triggered control system, sample times increased but there is no requirement for continuous monitoring of self-state by agents. Each agent estimates the next sample according to the value of the neighbourhood error at the latest sample time. Overall, these simulations explain that the three-state controller, when used with the W-MSR algorithm and the event/self-triggered mechanism, ensures that the agents achieve resilient flocking with minimum data exchange.

CONCLUSION
In this study, the resilient event-triggered flocking problem of MASs with the Vicsek model and non-cooperative agents was solved. The method can manage connectivity for dynamic interaction topology with the event-triggered approach to guarantee the resilient consensus. To this end, an event-triggered threestate controller was designed. The convergence of motion directions was shown analytically. The theories represent that the suggested control structure can successfully drive the system to reach secure flocking behaviour. In the last recent studies, controllers need some global data from the whole system and assume a lot of energy for data communications. Our study tried to resolve this issue by event-triggered mechanisms in a distributed manner. Also, a self-triggered mechanism was combined with the event-triggered structure, and a new structure that does not need for each agent to monitor its state continuously was made. In future research, the effects of other types of cyberattacks can be studied. Simulation results demonstrate that an event-triggered mechanism can reduce unnecessary data transmissions while preserving system performance.