A Metrics Suite for the Communication of Multi-agent Systems

Multi-agent systems are composed of autonomous entities that cooperate forming emergent behaviors. The communication between agents is sometimes unpredictable, and the resulting communication patterns can become crucial in their performance. This paper presents a metrics suite for evaluating the communication of the multi-agent systems. These metrics assist designers in detecting undesirable communication patterns in multi-agent systems, in order to improve their cooperative behavior. At the same time, we provide a demonstration that a well balanced communication is related to high levels of Quality of Service measured by response times.

values of these metrics are strongly related with the Quality of Service (QoS).This paper presents one of these cases, in which the metrics measures the communication of a MAS for crisis-management, and indicates which is the origin of the low QoS of this system.
Using the same case study, this work shows that the effect of the unbalanced communication becomes greater when the number of agents increases, obtaining worse values for the metrics and the response times (therefore also for the QoS).

II. MULTI-AGENT SYSTEMS AND THEIR COMMUNICATION
A MAS [3] is a system composed of multiple interacting intelligent agents.Multi-agent systems can be used to solve problems which are difficult or impossible for an individual agent or monolithic system to solve.
Designers of MASs describe models of agent interactions in order to guide the communication of MASs.For instance, Jiao et al. [4] propose to define a group of organization models for describing MASs, in which interaction patterns play a central role.The Agent Unified Modeling Language (AUML) [5] is the result of the cooperation of Foundation of Intelligent Physical Agents (FIPA) and the Object Management Group (OMG), and this modeling language includes formalism for defining the interaction protocols of multi-agent systems.In addition, the INGENIAS methodology also considers modeling elements to explicitly define the interactions, such as: the interaction protocols, the interaction units, and the precedence order of these interaction units.
Following this line of research, the presented work measures the amount and type of communication activity in several scopes.According to our study, there can be five main patterns of agents regarding the communication activity: overloaders, overloaded, isolated, overloaded-overloader, and regular.The first four types should not exist in a balanced system and the last one is the ideal agent: 1. Overloaders: Agents that overload the communication by sending too many messages.2. Overloaded: Agents that are overloaded by receiving too many messages.3. Isolated: Agents that neither send nor receive any message.4. Overloaded-overloader: Agents that are overloaded but also overload other ones. 5. Regular: Agents whose behavior is ideal because they send and receive an adequate amount of messages according to the communication activity of the system.The existence of the first four types is related to a low quality of QoS of the system.For instance, when an agent is occupied in paying attention to a great amount of requests (an A Metrics Suite for the Communication of Multi-agent Systems C. Gutiérrez and I. García-Magariño I overloaded agent), its response time delays and, consequently, the overall response time of the system also delays.In this example, the response time is used as an indicator of the QoS.The next section presents the necessary metrics for detecting the aforementioned types of agents.

III. METRICS SUITE FOR MAS COMMUNICATION
In order to determine when an agent is overloader or overloaded, this paper provides the definition of some metrics in two different scopes: the global system and the group of agents playing the same role.Agents will be classified within each scope, e.g. an agent will be classified into any of the mentioned classes using the value of metrics.It is important to distinguish both scopes because an agent can have a pattern (e.g.overloader) regarding the rest of the agents of a scope (e.g.global scope), and have another pattern (e.g.regular) regarding the agents of the other scope (e.g role scope).For instance, the reason can be that its activity is neutralized by the other agents' activity within a particular scope.

A. Scope of the Global System
The scope of the global system is the performance of all agents in the system.Table I provides the metric name with each calculation (1), ( 2), and limits (3), (4).All the metrics presented in this paper use the following notation: • A1..An are agents.
• S is the set of agents in the system.
• n(X) is the cardinality of X set.
• r(A x ) is the number of the A x agent's received messages.
• s(A x ) is the number of the A x agent's sent messages.
• R is the subset of agents playing the same role.
The following rules interpret the measurement with certain thresholds: 1. Agents who do not receive or send any messages will be classified as isolated.2. Agents whose BS is much higher than the threshold will be classified as overloaders.3. Agents whose MS is much higher than the threshold will be classified as overloaded.4. Agents whose BS and MS are both much higher than the threshold will be classified as overloaded-overloader.5. Agents whose BS and MS are close to the threshold will be classified as regular, because their communication is balanced.

B. Scope of Agents Playing the Same Role
The performance of each agent can also be measured in the scope of the agents playing the same role.Table II provides the metric names with each calculation (5), (6), and limits (7), (8): The agents are classified with the following rules, considering certain thresholds: 1. Agents who do not receive or send any messages will be classified as isolated.2. Agents whose BR is much higher than the threshold will be classified as overloaders.3. Agents whose MR is much higher than the threshold will be classified as overloaded.4. Agents whose BR and MR are both much higher than the threshold will be classified as overloaded-overloader.5. Agents whose BR and MR are not much higher than the threshold will be classified as regular, because their communication is balanced.

IV. CASE STUDY: A CRISIS-MANAGEMENT MAS
A MAS with overloaded communication effect has been tested to identify communication patterns.The MAS implements a crisis-management case [6] in which, a poisonous material has been released into a city.Since the centralized medicals services are not enough, the citizens with medical capabilities can offer help to the affected people in nearby areas; at the same time citizens are warned of the affected locations, in order to avoid them.All the experiments presented in this work can be reproduced with both the IDK 2.8, which contains the crisis-management MAS and is available from Grasia Web (http://grasia.fdi.ucm.es in "Software" section and "Additional Material for papers" subsection).
In the experiments, there are coordinator agents (beginning with CoordA prefix) and network agents (beginning with NetworkA prefix), which exchange messages to coordinate help and notify the risk areas.
The experimentation considers two versions of the system: a crisis simulation with overloaded communication and another with balanced communication.In the first version, the crisis management system may be blocked because the coordinator agents send messages to the same network agent due to the ingenuous selection in the communication process, which always selects the first agent of the yellow pages of the MAS.In the second version, this problem has been fixed by randomly selecting a network agent.In particular, this work only alters the mechanism of selecting the network agent for triggering the Coordinator-network interaction (CNInt in Fig. 1).
Furthermore, the experimentation uses two deployments that respectively instantiate four and ten agents of each type.Fig. 2 and Fig. 3 respectively show examples of executions of these deployments.
From the experience of this case study, in both versions, a threshold of unit order (3.00) provides an accurate way to distinguish the regular and irregular patterns, in the global and role scopes, because the values are of unit order.The first experimentation belongs to the metrics and patterns that appear in the deployment of four agents with an ingenuous selection communication; the second one belongs to the metrics and patterns that appear in the deployment of four agents of each type with a random selection communication; the third one contains the results of the response times for both versions of the deployment with four agents; and the fourth experimentation shows all the results for both versions using the deployment of ten agents.

A. Experimental Results in the Crisis System with Ingenuous Communication
Using the metrics from previous sections, concretely BS(A j ), MS(A j ), BR(A j ), and MR(A j ), the results in Table III have been obtained:  In the classification, none of the network agents follows a regular pattern; therefore, there is an unbalanced communication in both scopes.Since a network agent is overloaded while the other network agents are isolated, the problem is the selection mechanism of the network agents in the coordinator-network interaction.The problem is fixed straightforward by changing this mechanism of selection to a more balanced strategy, such as random-selection.In Fig. 4 there is a sample of the metric measurement.Fig. 4. Extraction of the execution of the overloading measurement system for the crisis management case study with ingenuous selection, for ten agents and a threshold of 1.00.In this phase, for each agent there are the classification patterns for both scopes, and finally the values for the metrics.Notice that in this prototype the patterns have been labeled with different names: bully is used for overloader, and mistreated for overloaded.

B. Experimental Results in the Crisis System with Randomselection Communication
This architecture has the same number of agents than the previous one.As the origin of the unbalanced communication is the mechanism of selection of the coordinator agent, this mechanism of selection is changed.Thus, in this version, coordinator agents randomly interact with any agent of the network role.In this system, the values of the metrics are presented in Table V, and the results of applying the classification rules are collected in Table VI.The values of metrics are closer to 1 and all agents of the system are classified as regular; hence, all network agents have taken part in the system in a proper proportion.

C. Response Times in the Crisis System with Ingenuous Communication and with Random-selection Communication
Table VII shows the response times for each agent and the system in both variants.The system response time is the average of the agents' response times.CoordA_034 agent has no response time because it is the one who offers the service requested.As suspected, response times are lower in the second variant, because the communication is well balanced and therefore, it improves the response time and quality of service.Therefore, the presented metrics are strongly related with the QoS of the system.In Fig. 5 there is a sample of the response time measurement execution for the ingenuous selection version.Fig. 5. Extraction of the execution of the overloading measurement system to the crisis management case study with ingenuous selection and ten agents.In this phase, for each agent there is its response time.

D. Experimental Results for both Versions with ten Agents
Both versions of Crisis System have been tested with ten agents of each type instead of four.The aim of this experiment is to know how an increase of the number of agents affects to the values of the metrics, the classification of agents, and the response times.Tables VIII, IX, and X show the results for the version with ingenuous selection method, and Tables XI, XII, and XIII contain the results for the random selection method.The thresholds have been the same as in the deployment with four agents of each type:  In the ingenuous version, there is a network agent (NetworkA_4) which is always selected.As suspected, the values of most of the metrics for that agent are higher than the threshold, whereas the rest of the network agents do not participate in any communication.The consequence of this is to have undesirable patterns for the ten network agents, and high response times.
These effects almost disappear in the random selection version, which has the following characteristics: -There are only two isolated network agents, and the rest become regular.
-NetworkA_4 becomes only overloader for the system scope: the overloaded-overloaded effect has disappeared for the role scope, and the overloaded effect has diminished in the system scope.Nevertheless, the most relevant feature of this experimentation is that the overloading effect becomes worse than in the previous deployment.This can be shown in the values of the metrics for the overloader agent (NetworkA_4) in Table VIII, which are higher than the overloader agent's results (NetworkA_1) in Table III.This effect is worse in the system response time of Table X, which is much higher than the system response time of Table XIII.

V. RELATED WORK
Load balancing has been pursued in MASs in several ways and applied in multiple scopes.[7] explains a multi-agent reinforcement learning process in MAS load balancing.When choosing a resource, the agent must optimize both the resource usage in the system and fairness by using purely local information.[8] mentions that mobile agents are a paradigm used to balance load in dynamic environments because this type of agent can decide when and where to move, depending on the system conditions.
Though effective, the focus of these works is different from ours: their aim is to build a balanced MAS, whereas the aim of this work is to detect unbalances in the execution of MAS communication.
Although load balancing has been studied extensively in MAS context, the design of analysis tools of debugging data of MAS executions is only preliminary.In [9], a task of clustering has been made to detect of agents with similar communication activity.In [10], clustering algorithms and complex data visualization techniques have been applied to the logs of interactions resulting from the execution of a MAS on the JADE platform.
In contrast, our work does not perform a clustering but a classification task, identifying the agents that cause an unbalanced communication.Other differences are that in the mentioned works they do not use metrics, and their work is not related to the QoS.
[11] has a formalism, called Enhanced Dooley Graphs, to explicate relationships within agent conversations and provide aid to new designs.This work combines the graph representation of the agents that are involved in a conversation and the states agents pass through.In contrast, our work has quantitatively evaluated the communication with metrics and classification rules; and these metrics are empirically proven to be strongly related with QoS.Moreover, the advantage of our approach is that assigning these patterns to agents, created with the IDK, allows the straightforward identification of the interactions that are causing the unbalanced communication.With this information, the designer has just to change the selection mechanism of the affected interaction.
The Quality of Service (QoS) of systems is considered several times in the literature.In many applications there are designs of systems that cover the requirements with a high QoS degree but the solutions are dependable on the scope.In [12], a highly satisfactory QoS adaptive multimedia application is provided by the use of machine-learning techniques that adapts the set of settings to the network capacity.In contrast, our approach improves the QoS by detecting undesirable patterns in the execution and allowing the designer to suppress them by altering the design and implementation of MAS.There are works related to the use of MAS to achieve high QoS levels, like [13], where the system was designed to support resource allocation in cellular data services in such a way that it meets both customer satisfaction and cost effectiveness ends.The solution here was to design agents within three modules built into the scheme: the knowledge source, the blackboard system, and the control engine.The cooperation among the agents provides the correct allocation policy.On the contrary, our approach improves the QoS by means of measuring and improving the communications policy.

VI. CONCLUSIONS AND FUTURE WORK
The presented metrics suite measures the communication in MASs, and their measurement values are strongly related with the QoS.The metrics and the presented classification rules assist designers in creating balanced communications in MASs and, consequently, efficient MASs.In this case, the overloading effect has been due to a wrong agent selection mechanism and has been solved by changing it.
According to the scalability, our experiments advocate that the unbalanced patterns of communications have worse effects when MASs are larger.Thus, the presented metrics can become more valuable for huge MASs.Moreover, the proposed metrics can be applied to open MASs, to facilitate the detection of malicious or problematic agents that considerably decrease the performance of the whole opensystem.
In the future, the relationship between the metrics and QoS can be corroborated in other MAS methodologies and tools.One of our short-term goals is to corroborate this theory, applying this tool to other MAS with different communication methods than the crisis-management case-study.
Moreover, other metrics are planned to be defined.Firstly, metrics can be defined for the agent scope, that is to say, measures that indicate if the proportion of sent or received messages is too high with respect to the overall amount of sent and received messages by an agent.Secondly, some metrics can be defined to detect overloading behaviors in systems and roles.This may be achieved by defining metrics that extract information from the system and role scopes respectively.
Finally, a long-term goal is to create a framework that uses the presented metrics to dynamically evaluate running MASs.Regarding the results of the metrics, the framework will dynamically change some communication patterns (e.g.modifying the selection mechanism).In this manner, the framework will dynamically improve the QoS of MASs when some inefficient communication patterns are detected.

Fig. 1 .
Fig. 1.The Coordinator-network Interaction, with the INGENIAS notation.There are two roles represented by the CoordinatorR and the NetworkR roles.The interaction is initiated by a coordinator agent, and is sequenced by the network agent.

Fig. 2 .
Fig. 2. Execution of the Crisis-management MAS with four agents.In this execution three agents are infected, whose positions are indicated in the map as infected areas.Nobody could help the last infected user (CoordA_0), since the unique user with medical capabilities (CoordA_3) is occupied helping another infected user (CoordA_2).

Fig. 3 .
Fig.3.Execution of the Crisis-management MAS with ten agents.In this execution example, CoordA_3 user offered his help, and CoordA_4 asked for help.Therefore, the MAS coordinates these two user, as one can see in the messages of the graphical user interfaces.

TABLE I
Max(MS(Aj)) = n(S) if all messages are sent by the same agent Aj :

TABLE II .
METRICS FOR AN AGENT PERFORMANCE IN THE ROLE SCOPE OverloaderRole Metric measures the amount of an agent's sent messages comparing it to the amount of sent messages by the agents playing the same role, with the following definition:

TABLE III .
VALUES OF THE METRICS FOR 4 AGENTS AND THE INGENUOUS SELECTION

TABLE VII .
AGENT AND SYSTEM RESPONSE TIMES IN MILLISECONDS FOR 4 AGENTS

TABLE VIII .
VALUES OF THE METRICS FOR 10 AGENTS AND THE INGENUOUS SELECTION

TABLE X .
AGENT AND SYSTEM RESPONSE TIMES IN MILLISECONDS FOR 10 AGENTS AND

TABLE XI .
VALUES OF THE METRICS FOR 10 AGENTS AND THE RANDOM SELECTION