Abstract
Flexibility is considered as one of the key objectives of agent-based technology. Despite this, we still lack a fundamental understanding of just what “flexibility in multi-agent system (MAS)” really is. Two main questions must be asked. First, how do agents and MAS achieve a high degree of flexibility? Second, what makes one agent or one MAS more flexible than others agents or others MASs? This paper addresses the answer to these two questions by proposing an ontology of the flexibility property and a mathematical measurement model for this property. The proposed ontology gives a comprehensive view of the flexibility by decomposing it on several characteristics and presents several techniques for implementing each characteristic. In addition, it relates these characteristics to MAS components. The proposed model presents a set of metrics for measuring the different characteristics of the flexibility property. The proposed metrics have been applied to JADE applications using a tool developed for this purpose.
Introduction
With advances in industry technology, agent-based technology has received increasing attention because agents and multi-agent systems (MASs) offer promise of much more modularity, intelligent, distribution and flexibility when conceptualizing, designing, and implementing complex systems [15]. Recent years have witnessed significant advances in the growing employment of agent-based technology in several domains of everyday life such as robots, air-traffic control, and information retrieval management [2, 16]. The reason for the success of agents and multi-agent system (MAS) is mainly related to their salient features, including reactivity, proactivity, and sociability, which make them an effective solution to solve complex tasks [2].
On the other hand, measurement in software engineering is very important activity. To apply effectively this activity, some basic concepts need to be clarified. Mainly, a measurement is a process by which numbers or symbols are assigned to an attribute of a software product or process [9]. By cons, a metric is a quantifiable measurement of a software product or process that is directly observed, calculated or predicted [6]. Consequently, measurement provides the software engineer with on-the-spot instead of after-the-fact insight [66]. Measuring the different attributes of software provides several advantages [48]: it gives objective indicators about the software quality assurance, performance, and management, it predicts the project risks and success, and it quantifies several goals in project management. So, it was said “If you can’t measure software engineer then it can’t be called engineering” [32]. Considering multi-agent systems as one of relatively recent software paradigm on one hand, and the variety of its application domains on the other hand, we can understand the importance of proposing metrics for the different properties of such systems. Nowadays, measuring the properties of multi-agent systems is receiving close review [30, 42, 51, 52, 69, 82]. Indeed, several studies targeted proposing metrics for both classical software properties [30, 68, 81, 82] and multi-agent-specific ones [17, 19, 70].
For decades, flexibility is considered as one of the key objectives of any manufacturing system [89]. It has been observed in many scientific fields and deployed to solve a number of different problems. In addition, it is considered as a vital characteristic in many recent applications [6, 13, 50]. Despite this, flexibility is still a vague concept in software systems and we still lack general consensus as to its definition and how it should be measured. The author in [75] defines it as the capability of the software product to change its behavior according to its actual situation to satisfy its objectives. According to [23] flexibility denotes the ability of a system to behave as required in different situations. Since multi-agent paradigm is one of the best and most applied software paradigms for developing distributed and complex systems [82], the researchers have paid great attention to the flexibility of multi-agent system. According to [75], the most important promise of agent-based system technology is flexibility.
Although the flexibility is a very important characteristic of MASs, its measurement is not yet studied deeply. This is what led us to deeply understand what flexibility is in MAS? And how to measure it? To answer these two questions, this paper presents an ontology of the flexibility property and a mathematical measurement model for this property. To clearly understand flexibility, it must be studied according to all components that compose MAS. To do this, the proposed ontology presents flexibility according to the vowels approach (AEIO) [87]. This allows flexibility to be defined according to four components: the agent, the environment, the interaction and the organization. On the other hand, the ontology defines flexibility by aggregating a set of characteristics linked to the components of the MAS. By doing this, we improve understanding the positive and negative effect of each characteristic on the flexibility property.
The work presented in this paper shows that flexibility can be affected by the reactivity, proactivity, sociability, learnability, adaptability, dynamism, openness, accessibility and fault-tolerance characteristics. As a result, we can understand the impact relationship of each characteristic on the flexibility and exactly on which component of MAS. Moreover, we can describe the main implementation techniques of each characteristic.
In order to measure the flexibility of MASs, a mathematical model has been proposed based on the developed flexibility ontology. This model presents a set of metrics for measuring the different characteristics of the flexibility property by taking into account the implementation techniques which have a direct impact on the proposed metrics. For the purpose of validating the efficiency of the proposed model, it was applied to JADE (Java Agent Development Environment) applications.
The rest of the paper is organized as follows: In Section 2, we present the literature review. Section 3 describes the proposed flexibility ontology and its upper ontology. Section 4 provides a detailed discussion on measurement model of the flexibility. Sections 5 and 6 are devoted to present the proposed tool and our case study respectively. Section 7 presents a discussion about our proposed approach. Finally, a conclusion and future work directions are presented in Section 8.
Literature review
Measurement is very important issue in software engineering. It allows evaluating, controlling and predicting software aspects (like the quality, the complexity and the cost) during the software project. Especially, proposing metrics for multi-agent systems caught the attention of the research community since the emergence of this software paradigm. Indeed, the first studies in this field targeted the empirical specification of the intrinsic properties of MASs. In this context, [39] proposed measurement for the autonomy as a part of the formal specification of the adjustable autonomy. Then, this field has been undergoing intense study since almost a decade. In fact, during this period several researches targeted measuring the different attributes of agent and MASs [30, 42, 51, 52, 69, 82]. Those researches can be classified into two classes: general purpose metrics and agent-specific metrics. General purpose metrics are proposed metrics to measure the general attributes of software taken into account the specificities of MAS like the quality [30, 82], the complexity [81] and the performance [68]. By cons, we mean by agent-specific metrics, the measures of specific attributes of the agent and MASs like the autonomy [19, 70], the proactivity [17] and the intelligence [42].
By studying deeply the proposed approaches in this field we can conclude two remarks. Firstly, most studies shared the same principle: dividing the studied property into several characteristics, then proposing metrics for each characteristic. Secondly, this field has evolved from the measurement of essential properties (like the autonomy [39]) to the measurement of more complex and sophisticated properties (like rationality [83], intelligence [42] and security [69]). According to the second remark, this study is proposed.
Because the flexibility is a required property in many fields that appeared before MAS (like manufacturing and software engineering), it has been studied firstly in them. In the manufacturing domain, the flexibility measurement has been recognized as a necessity since its earliest days. For example, [5] proposed that the manufacturing system flexibility can be measured as the combination of two factors: the quickness which can be evaluated as the lead time between a customer’s order receipt and the completion of products, and the economical response to a change. Contrariwise, the work presented in [73] proposed a model for comprehensive flexibility which covers various types of flexibility in manufacturing systems. According to the proposed model, before measuring comprehensive flexibility, the status of each machine and part should be examined to determine the inefficiency in machines and parts-processing measurements.
In addition, the flexibility is identified as an important property of software. Hence, several studies in software engineering have proposed metrics to measure it. The authors in [29] introduce the notion of evolution complexity to measure software flexibility. They suggested that flexibility can be measured as the complexity of a software evolution which can be described as the process during which changes occur in the problem, which entail changes in the implementation. According to the authors, flexibility is directly linked to the amount of code that is affected by a software evolution. Thus, they proposed evolution cost metric which counts the number of modules that are affected (added, removed, or adjusted) by software evolution. The authors in [45] proposed a set of metrics for software flexibility such as flexible degree, flexible force, flexible distance and flexible capacity. The authors presented a schema that utilizes these metrics to quantitatively measure software flexibility and its related properties such as adaptability, brittleness, rigidity, elasticity and plasticity. In [37], the authors proposed a nonlinear model to measure software flexibility. They used the second-order cone programming approach to calculate software flexibility by taking into account the relationship between operation control force and deformation of the software. The proposed model is focused on the flexible point as an interface which leads to change in software function, and the size of deformation of the software. The authors in [1] proposed a flexibility measurement model that establishes the correlation among flexibility, object oriented design properties and object oriented metrics by establishing multiple linear regression.
Despite the importance of the cited research works, it is important to study the flexibility of MAS according to the specificities of this software paradigm. Indeed, it is possible to reuse some proposed metrics (like the quickness [5] or the flexible degree [45]), but it is more important to propose suitable flexibility metrics for MAS. This point of view is justified by the breadth spectrum of this property. The flexibility in manufacturing systems is related to adapting production processes to satisfy costumers’ needs or to correct undesirable situations. Consequently, the economical aspect is usually used to estimate the cost and benefits of this updating. On other hand, the flexibility in software engineering is defined as “the ease with which a system or component can be modified for use in applications or environment other than those for which it is specifically designed” [33]. From this point of view, the flexibility requires the human intervention to update an existing product. In this context, the flexibility for MAS is a novel property that ensures an automatic updating of the system as a reaction of the current situation or to reach some goals. It represents the main property of intelligent agent [53].
Recognizing the importance of the flexibility, several approaches have aimed to integrate this property on agents’ architectures or their interaction protocols [12, 38]. Unfortunately, measuring this characteristic is almost omitted. In the specialized literature, the only two research works for measuring the flexibility of MASs, known to us, are proposed in 2006 by Robby et al. [78] and Kirn [75]. Robby et al. [78] proposed several design metrics based on state-space coverage measures to determining system flexibility at design time. The proposed approach is based only on organization-based MASs because authors defined system flexibility as the ability of the system to reorganize to overcome individual agent failures. Although this work can be considered as a good starting point for flexibility measurement of MASs, it limited the flexibility on reorganization and omitted other aspects such as interaction, agent and environment. In addition, this work targeted the flexibility of MAS at design-time which poses real difficulties. In fact, the flexibility is the main property that generates dynamic behaviors of agents. Consequently, measuring the flexibility at this development stage can gives wrong information. Moreover, the flexibility as an organization changing is considered here as a solution to overcome agent failures. In fact, the reorganization can be done for other goals rather than processing the agent failures. On the other hand, overcoming agent failures can be realized using other techniques as fault tolerance.
The approach presented in [75] is based on the study of the flexibility from four different points of view: the organization theory, the machine learning, the production theory and the software technology. Then, the author has chosen to study this characteristic on the basis of production theory. Hence, the flexibility is formalized and measured using a set of metrics. Essentially, the flexibility of a MAS is described by the set of services generated as a reaction to a received input (called qualitative flexibility), the number of times by a unit of time the service is generated (called quantitative flexibility) and the number of processes that can produce a single service (called problem solving flexibility). In addition, the flexibility is considered as a characteristic that requires additional resources. Consequently, the author in [75] proposed the economic flexibility that specifies the required additional resources and the possible risks, the time flexibility that represents the required time to ensure the flexibility and the configuration flexibility that represents the possible modifications in the MAS. Each element of these attributes of the flexibility is quantified by a given metric. For example, the qualitative flexibility is measured as the cardinality of the services set.
The proposed measure of the flexibility proposed by Kirn [75] provides a solid foundation to formalize the flexibility characteristic. However, this work suffers from several limits. Foremost, the formalization is based on the production theory and it ignored some important perspectives. Especially, the machine learning (and the artificial intelligence) and the organization theory perspectives have a direct influence on the multi-agent flexibility. An agent ensures the flexibility thanks to the artificial intelligence techniques. For this reason, the flexibility is considered as the main characteristic of intelligent agent. On the other hand, the flexibility in the macro level should be studied from the organization theory perspective because it is realized using the techniques of this field (the self-organization and the reorganization). Secondly, the proposed framework over simplifies the studied characteristic. In fact, the flexibility is very complex characteristic that needs some sophisticated techniques to implement it (like machine learning, sociability and adaptability techniques). Obviously, the implementation techniques have their impact on the flexibility measurement. However, this work omitted these aspects. In addition, the framework considered the MAS as a whole entity. It did not relate the metrics to their associated component of the MAS. Indeed, measuring the flexibility of an agent must be different to measuring the flexibility of the interaction protocol. Finally, the relationships between the flexibility and the proposed metrics are not always obvious. Taken as example the quantitative flexibility that is measured by the number of times the service can be offered by unit of time. We think that this metric can measure the productivity but not the flexibility. Obviously, a dispensing machine that provides a single drink X times per unit of time is not more flexible than a dispensing machine that provides several drinks Y times per unit, only because X is greater than Y. On the contrary, the second machine can be considered more flexible than the first one because it can adapt to the users request thanks to its diversity of drinks.
Based on the presented related work, we can remark that the flexibility is not studied deeply for multi-agent systems. Moreover, some of proposed approaches are either based on independent domains (work in [75] is based on manufacturing systems) or they consider only a specific point of view (the work in [78] considered only the organization aspect). Consequently, there is no comprehensive model for the flexibility of MAS. Hence, in this paper we propose a comprehensive metrics for the flexibility of MAS. These metrics are based on an ontology that represents most concepts of this domain. In addition, the proposed metrics are based on a mathematical model that relates the characteristics of the flexibility and their metrics, on one hand and these characteristics and the MAS’ components on other hand. The next section is devoted to present an ontology of the flexibility in MAS domain.
An ontology for the flexibility of MAS
The ultimate goal of the work presented in this paper is proposing mathematical model to measure the flexibility property of multi-agent systems. However, in order to reach this goal an ontology for such property is proposed. This ontology makes clear the flexibility property of agents and MASs, as well it represents the relationships between this latter and its related concepts (characteristics, techniques …etc.). It allows understanding the flexibility for proposing relevant metrics. Relevant metrics give objective information about the measured property.
In addition, before developing the ontology of the flexibility, an upper-ontology of such ontology is proposed. Hence, in the rest of this section the upper ontology will be explained. Then, we will present the flexibility ontology.
The upper ontology can be considered as a meta-model for the proposed flexibility ontology. A meta-model is a formal definition of a model which helps to understand it and which facilitates reasoning on its structure, its semantics and its use [72]. Indeed, the upper ontology prevents ambiguities during the definition and the use of the flexibility ontology and allows its future refinement and extensibility.
Figure 1 shows the upper ontology of the flexibility represented using ontology UML-based notation for OWL ontologies [71]. This upper ontology makes it possible to define on the one hand any property of MAS and on the other hand its relation with the MAS’ components. Usually, a property represents an ambiguous, complex and composed concept. The Quality [35, 82], the complexity [81], the rationality [83] and the security [34] are examples of such properties. Hence, a property will be decomposed to a set of well-defined characteristics. Thanks to this decomposition, we can manage the complexity and the ambiguity of the property. Obviously, the characteristics directly affect the property.
Upper ontology of MAS properties.
Also, it is well-known that a MAS is composed of several components (agents, environment, interaction and organization). Thus, a component of the MAS can be characterized by one or several characteristics. For example, the autonomy is a characteristic of the agent component, while the accessibility is a characteristic of the environment component. Relating characteristics with the components of the MAS provide several advantages. First, it improves understanding the studied property because it provides causal relationships between characteristics and their related components of MASs. Moreover, it helps to identify the anomalies’ sources if a divergence is detected. Finally, it allows an effective acting to improve the property.
These characteristics are implemented using various techniques. By technique we mean technical procedures that aid in the implementation of the characteristic from the flexibility point of view. For example, to implement the fault tolerance characteristic we can use redundancy, diversity and replication techniques. Also, each characteristic can be measured by a set of metrics. A metric is an assigned value to an attribute according to a well-defined scale and using a measurement method [35]. In the context of this paper, a metric is a numerical value assigned to a characteristic which is implemented using a specific technique. It is important to note that it is hard difficult to specify general metrics applied independently to the implementation technique.
The flexibility ontology.
In this work, we are interested in the study of flexibility. Figure 2 presents an ontology for the flexibility of multi-agent systems, which is represented using a UML-based notation for OWL ontologies [71]. Although many researchers have stressed the importance of flexibility in software systems [2, 53], the concept of flexibility is not well defined in the literature. In MAS, flexibility allows agents to be able to perceive their environment and assess the current situation and then adapt their actions accordingly. According to [53], flexibility reflects the intelligent nature of the agents, which is represented by three characteristics: sociability, reactivity and proactivity. Although these three characteristics are considered intrinsic to characterize intelligence, they represent only a primitive form of flexibility. In fact, there are more advanced features to ensure flexibility, in its general sense, in the context of MAS. Indeed, changing the behavior of agents can be ensured by the adaptability and the learnability (using machine learning techniques). Also, in the macro-level, agents should change their behaviors because dynamic join or leave of other agents to the system (dynamism) or because updating of relationships between agents within the organization. According to the upper ontology presented previously, these features represent the characteristics that define the flexibility of multi-agent systems. The whole characteristics that affect the flexibility will be presented later in this section.
As it said above, in the upper ontology, a MAS is composed by several components. In fact, several models are proposed to give a comprehensive and integral approach that defines MASs [21, 80, 84, 87]. AEIO approach (or vowels) proposed by Demazeau [87] is one of this approaches. It represents MASs in simple and single framework. In addition, compared to other approaches (like FAML model [21], this model presents MASs according to a single vision that does not differentiate the design vision and the implementation vision. Because these reasons, we choose AEIO approach to represent the components of MASs. Hence, a MAS is composed of [80, 87]:
The Agent component (A): gathers all the internal reasoning functionalities of an agent. These functionalities can relate to the agent’s own capacities: capacities of perception, planning, reasoning on his own skills and knowledge, and capacities of interaction. The Environment component (E) concerns the representation of the elements that make up the environment in which agents are situated. These elements can be resources or even agents. The Interaction component (I) represents all the possibilities and means offered for structuring the external interactions among the agents: interaction languages, protocols of interaction, and the mechanisms linked to conversations. The Organization component (O) concerns all the links between agents which allow the structuring of the MAS. It can therefore include, operating and behavior rules, relationships between agents.
The work presented in this paper shows that the flexibility of MASs can be affected by several characteristics like: Reactivity, Proactivity, Social-ability, Learnability, Adaptability, Dynamism, Openness, Accessibility and Fault-tolerance. In the rest of this section, each characteristic will be presented in detail according to the proposed flexibility ontology. In addition, it will be made clear for each characteristic its definition, its importance in the context of MAS (its relationships with the MAS components), its impact on flexibility as well as the techniques used for its implementation. It is important to note that in order to implement the characteristics, we can use explicit techniques such as the representation of goals to implement proactivity. Unfortunately to implement certain characteristics, there are no explicit techniques; for that, one must use implicit simple or complicated techniques.
The reactivity is the agent’s ability to perceive his environment and respond to the various changes that may occur, in this environment, in a timely fashion [61]. This characteristic is directly linked to the ‘agent’ component. It makes the agents simple entities that behave following their perceptions, which is efficient for tackling complex problems especially life systems simulation/study and problem/game solving [59].
From the flexibility point of view, without reactivity, we cannot have a flexible system. Indeed, changing of behaviors or structure is usually a response to some updating in the environment of the agent. Consequently, an agent who cannot perceive changes in his environment or cannot respond to perceived changes cannot act and therefore cannot be flexible.
In order to implement reactivity, several techniques can be applied simultaneously or separately:
Implementing agents’ behaviors as a simple rules (if …then). Using this technique, an agent can give direct and quick responds to any environment updating. Allowing the implementation of preemption behaviors. Obviously, some behaviors must be implemented as complex entities. Consequently, executing these behaviors prevents agents to perceive and react to environment updating. However, it is possible to respond to the environment events by suspending the current behavior to execute higher priority one. Several approaches proposed layered architectures to implement reactive agent [41]. In fact, a layered architecture separates behaviors in several independent layers according to their priorities. An example of these architectures is the famous architecture of Brooks (Called Subsumption architecture). This architecture confines responsibilities to isolated layers, but allows the layers to subsume one another if the need arises [54].
The proactivity can be defined as the agent’s ability to exhibit goal-oriented behavior by taking the initiative to act in order to satisfy its goals [17, 64]. It is a characteristic of the ‘agent’ component. It makes the agent an autonomous entity capable of taking the initiative, according to his goals, rather than simply acting in response to the environment.
From the flexibility point of view, proactive agent can improve his knowledge, anticipate future situations and conduct a communication with the other agents. Thanks to the proactivity, an agent can change its behavior not because its environment is updated but because its goal is changed.
Implementing this characteristic is generally made by specifying explicitly goals of the agent and the conditions for triggering them. Also, it is possible to implement the proactivity by explicitly making relationships between agent’s goals and agent’s behaviors to allow a direct executing of a behavior in order to reach a goal. An example of agent’s architectures that allow implementing proactive agent is the architecture Belief-Desire-Intention (BDI) model agent [7]. Beliefs (B) represent the state of the environment; Desires (D) represent the motivations of the agent; and Intentions (I) represent the goals of the agent. Thus, an agent uses its beliefs and its desires in order to select the intentions it must achieve.
Sociability
The sociability is the agent’s ability to interact with other agents, by exchanging messages, in order to satisfy its designed objectives [64, 92]. The sociability characteristic is attached to the two components ‘Interaction’ and ‘Organization’. On the one hand, agents need to interact with each other in order to achieve common goals or resolve conflicts (Interaction). On the other hand, agents can form societies and have relationships with each other (Organization).
It is possible to ensure the flexibility of MAS by making changes in the macro-level (the sociability characteristic). As example, an agent can change acquaintances (the agents with which they can interact). Moreover, it can change the interaction protocol to reach a collective goal. Obviously, the ability of applying several interaction protocols instead of limited number of them can helps agents to reach their goals. Also, it is possible to change the organization structure to reach the goals of the society. In this case, we can update the roles played by an agent or the relationships between agents.
In the context of MAS, we propose the use of different techniques for the implementation of sociability: Interaction protocol based techniques, reorganization based techniques, self-organization based techniques and emergence based techniques.
Interaction protocol based techniques allow agents to change the interaction protocol in order to respond to a given situation. Naturally, an agent that can apply several interaction protocols will be able to ensure more flexibility. Taking as example, an agent that buys products on web sites using well-known auction techniques. If this agent can apply only a single interaction protocol, it cannot interact with several agents compared by an agent that has the possibility of applying several interaction protocols. In addition, an interaction protocol can offers more flexibility for an agent, if it provides the possibility of giving several responds to the same message compared by another one that limits the number of choice as responds.
Reorganization based techniques allow agents to change the organization endogenously or exogenously. The agents being aware of the organization, they are able to manipulate primitives in order to modify their social environment [26]. The reorganization can be initiated either by an entity external to the system or by the agents themselves. Several techniques have been proposed to ensure reorganization [28], the most effective of which are technique based on a dynamic role assignment and technique based on cooperative behavior assessment [25].
Self-organization based techniques allow agents to change the organization endogenously. Since agents are oblivious to the state of the organization, they can manipulate local information and representations only to directly change the configuration of the system. In order to achieve effective self-organization, the authors in [22] propose to have: an observed organizational structure; a process that produces and maintains that structure; and a certain function or global goal that the system aims to fulfill at maximum using self-organization.
Like self-organization based techniques, emergence based techniques allow changing the organization of a MAS endogenously. This change can be seen as a result of the agents’ interactions within the system’s dynamics. For example, birds flocking is an emergent phenomenon of a group of birds [88]. According to many researchers such as in [39, 88] the two concepts, emergence and self-organization, are practically identical and the distinction between them is blurred. Therefore they are not generally separated in the literature. The authors in [11] stated that emergence most likely occurs as the system self-organizes. It is noteworthy that emergent behavior can be beneficial or harmful whereas self-organization behavior is often beneficial [85]. Thus, the concept self-organization can be considered as a specific case of emergence.
Dynamism
The concept of dynamism of software systems is not well defined in the literature. In the context of MAS, dynamism can refer to the capability of agents to dynamically join or leave the system during execution time. The dynamism characteristic is linked to the ‘Interaction’ component. Obviously, the passive existing of agents in the system cannot contribute in the solution. Agents should be able to interact between them in order to ensure collective intelligence. Therefore, agents should be able to identify the existing agents in the system. Hence, the dynamically joining or leaving the system must be managed according to specified interaction protocols.
From the flexibility point of view, with dynamism, the system can dynamically adjust itself to changes in the environment, tasks, and availability of resources [58]. By adding new agents, new capabilities can be introduced, but also resources may become limited. Dynamism is very important in several applications such as internet of things (IoT), smart power grids, social network, and multi-vehicle coordination, etc. [47].
As it said above, agents should manage their joining or leaving of the system in order to allow other agents to take advantages from this dynamism. This is can be managed by well-defined joining and leaving protocols. For example, an agent aims to join the system; it must present its abilities to other agents. Also, when an agent aims to leave the system, it is necessary to manage its resources and its roles (for example, find an agent that can be charged by the roles of the leaved agent). Generally, a mediator agent (like Directory Facilitator (DF) agent) is used to manage the dynamic leaving and joining of agents.
Openness
An open MAS is a system where heterogeneous agents interact to pursue particular or common goals [46]. For example, it is composed of different models or generations of robots. The openness characteristic is attached to the ‘Organization’ component because a social setting must be made by heterogeneous agents in order to allow them to position themselves in an organization adapted to this constraint of heterogeneity. This social setting concerns the roles of agents and their relationships with each other. In fact, multi-agent organizations are modeled by roles that can be affected to agents. Each role can be played, in a general case, by only a set of agents. Hence, this diversity of agents that represents the heterogeneity is the key attribute of the openness.
From the flexibility perspective, openness allows agents to change their roles in order to reach a goal. Indeed, the existence of heterogeneous agents in the system gives us the possibility of assigning a role to an adequate agent. By cons, the existence of only one single agent model or architecture (homogeneous agents) limited the possibility of assigning roles to agent because if a role required specific agents’ capabilities, it will be hard to find an agent with these capabilities.
In order to implement the openness characteristic, designer of agents must have the possibility to build architectures of different agents. Hence, it is necessary to develop classes of agents for different architectures and from these classes the designer can build heterogeneous agents.
Adaptability
The adaptability represents the ability of changing the behavior or the structure of a component. Traditionally, the main focus on adaptability of MASs is changing the individual behavior of an agent, changing the interaction protocols and the organizational structure of the system [43]. Changing in the interaction protocols and organizational structures are due to the dynamism and openness as is explained above. Moreover, adaptability can be also studied for the environment of the MAS. Although the environment is considered for longtime as a passive component of MASs, it is an integrated part of the system and it can play active role [14]. Indeed, changing can be performed by the environment as a response to a new situation. As example, considering traffic lights as objects of the environment, perceiving a traffic jam we can change these lights in order to ensure more fluidity. Consequently, in our work, we distinguish the adaptation of the agent from that of its environment. The adaptation of the agent is the ability of the agent to change its structure or goals according to a new situation [44]. Adaptability of the environment refers to changes that occur in the environment that are independent of the actions taken by the agents [2]. According to this definition, the adaptability characteristic is attached to both ‘Agent’ and ‘Environment’ components.
From the flexibility point of view, adaptability enables agents to dynamically modify their behaviors by changing their structure [90]. Furthermore, adaptability allows the environment to change and therefore helps the agent to make the correct decisions, for example changing the traffic lights allows the agent to make the safe decision. Modeling of recent applications such as grid computing, web services, etc. where the environment changes frequently, has pushed researchers to devote a lot of effort to MASs in particular to build adaptive agents.
The implementation of the adaptability characteristic can be done by techniques that provide an agent with a self-control mechanism to dynamically involve new behaviors. These techniques must have a mechanism that observes agents and detects undesirable behaviors. Generally, this mechanism is modeled as meta-level that changes the behavior according to the situation. Techniques based on object-oriented programming paradigm can be used to change the number or state of objects in the environment without the intervention of agents.
Accessibility
The accessibility characteristic is a well-known propriety of the ‘Environment’ component. An accessible environment is one in which the agent can obtain complete, accurate, up-to-date information about the environment’s state [53, 79]. In addition, an accessible environment allows agents to update its state. For example, a network firewall agent may capture the entire traffic feed of a network [2].
From the flexibility point of view, accessibility enables agent to sense data from the environment and therefore introduce new knowledge and make the right decisions. Generally the environment is made up, apart from the agents, of a set of passive objects. The implementation of the accessibility characteristic therefore consists in proposing techniques making it possible to offer functions allowing agents to access objects in the environment. Encapsulation is one of these principles of the object-oriented programming that prevent agents to access to some properties of the environment. It consists in restricting the access to some information or methods of objects.
Learnability
Learnability is the agent’s ability to learn, from past experience, how to become more and more efficient over time and how to better interact with the particular environment [57]. When designing MAS, agent cannot be provided with all the necessary knowledge, and it is impossible to foresee all the potential situations that an agent may encounter and to specify all the appropriate behaviors [16]. Therefore, form flexibility point of view; agents have to learn from their environment to involve new goals and new behaviors, and to self-improve their future performance [27]. For instance, in competitive scenarios, the agents have to learn decisions that maximize their goal and minimize their adversaries’ goals [60].
The learnability characteristic is attached to both ‘Agent’ and ‘Environment’ components because we distinguish two types of learning: single agents learning and collective agents learning. Single agent learning emphases on how one agent learns and improves its individual skills from his own experiences and independently of other agents; where collective agents learning emphases on how learning is distributed across multiple agents. Obviously, other agents are considered as a part of the environment of an agent.
To achieve MAS learning, several techniques have been proposed such as logic-based techniques, social learning techniques [16], reinforcement learning technique [40], Markov decision process [49] and Case-based reasoning [77]. Traditionally, these techniques are classified into two types of methods [31]: lazy learner and eager learner. In the first case, data training is stored until the appearance of the test data that will be conducted based on the most related training data. Case-based reasoning as example belongs to this class. By cons, the second type of methods consists in construction of a classification method like artificial neural network or decision trees.
Fault tolerance
Changing in the MASs is not only the result of a natural evolution of the environment and the structure, goals and behaviors of agents. It can also emerge as a result of an unexpected interaction, adversarial intrusion or perceived faults in general [8]. Generally, failure of the system is one of factors that decrease performance and reliability. In addition, consequences of failures in multi-agent context can become critical because agents are designed autonomous for acting in a situation where humans cannot control them (for example, robots in spatial mission). In order to cope with failures, a flexible system should be fault tolerant. Fault tolerant is system’s ability to mask the failure in order to continue providing the necessary services without any delay [86].
Despite that the fault-tolerance are usually omitted when studying the flexibility of MASs, we think that it can affect and improve this characteristic. The general principal of the fault-tolerance consists in replacing the fault’s source by another component. Obviously, this process requires changing in the structure or the behavior of the system. To deal with the fault tolerance in MAS, several approaches have been introduced [3, 4, 55, 56, 74]. Based on these research approaches, fault tolerance can be applied in different levels or components of the MAS: Fault tolerance integration into the internal agent behavior [4], extend FIPA Agent Communication Language (ACL) to deal with the communication crash failure of agent [55], handle the communication between agents using pre-defined languages for describing exception resolution actions [3], handle the MAS faults using sentinels which observe the different agents and detect functionality deviations in order to diagnose faults and to repair them [74], use the replication by cloning critical agents system [56], and use a social diagnosis approach where socially similar agents compare their own state with the state of other agents for detecting possible failures [76]. These techniques are based on redundancy, diversity or replication.
Measurement model for the flexibility
Based on the flexibility ontology presented in the previous section, a mathematical model has been proposed to measure the flexibility of a MAS. Hence, the comprehensive flexibility (CF) measurement is defined as a function from MAS to nonnegative real numbers, as it is described in Eq. (1). Supposing that we have a multi-agent system (mas) that is composed of a set of agents (
The flexibility of agents is specified by the reactivity, proactivity, fault tolerance, adaptability and learnability characteristics. Obviously, the importance of each one of these characteristics is strongly related to the agent kind and its application domain. For example, while the reactivity is important for some applications, the proactivity can be considered more required in other application domain. Equation (2) models the flexibility of agents as an arithmetic mean of the measurement of the flexibility of agents that compose the MAS (known that
Using Eqs (2) and (3), we can express the flexibility of agents using the characteristics cited above as it is presented in Eq. (4).
The flexibility of the interaction is affected by the sociability, the dynamism and the fault tolerance characteristic. As it is presented in Eq. (5), the flexibility of the interaction is calculated as the weighted arithmetic mean of these characteristics using their corresponding coefficients.
The flexibility of the organization has three characteristics: the sociability, the openness and the fault tolerance. Equation (6) shows the measurement function of the organization flexibility. It is calculated as the weighted arithmetic mean of the cited characteristics.
In the same manner, the flexibility of the environment is defined, by Eq. (7), as the weighted arithmetic mean of the characteristics that affect it. These characteristics are the adaptability, the learnability and the accessibility.
Using Eqs (1) and (4)–(7), the comprehensive flexibility of a MAS can be modeled by the weighted arithmetic mean of all the characteristics that affect the flexibility property. Equation (8) shows this model knowing that functions
This characteristic is assessed by taking into account the capacity of perception of the environment and the rapidity of acting. For that, a set of metrics are proposed to evaluate the reactivity characteristic which are:
Capacity of perception (CP): for perceiving an object on the environment, an agent represents this object in its internal structure [53]. Usually, an agent has a limited perception capacity because it cannot perceive all the objects of the environment. Hence, the capacity of perception of an agent mainly depends on the number of objects of the environment represented in the agent. Consequently, capacity of perception metric can be given as the ratio of the number of environment’s objects that the agent can perceive and the number of all objects in the environment. Supposing that the environment
Frequency of perception (FP): perception is not a continuous process because agents have not always the ability of remarking changes on the environment. Typically, an agent works on cycle of perceiving the environment, reasoning about the perceived environment and acting. Consequently, if this cycle takes a longtime, the perception ability of the agent will be affected. Hence, we propose frequency of perception as a metric of the reactivity. This metric consists on the number of perceptions made by the agent in a unit of time. Equation (10) shows the measurement function of this metric. In this equation
Response time (RT): this metric presents the average time to generate responds to perceived events. A response time to an event is the time from the event occurrence to the generation of the response. This metric reflects the rapidity of acting of the agent. Supposing that an event
The proactivity is the ability of an agent to exhibit goal-oriented behaviors. Implementing this characteristic can be made using several techniques. BDI model is the famous model that implements this characteristic. It provides explicit representation of the goals of an agent (called Desires). For reaching these goals the agent has a library of plans. Consequently, the flexibility from this point of view is judged according to the number of existing plans to reach a goal. So, we propose the following metrics to measure the proactivity:
The ratio of plans per goal (RPA): as we explained above, the richness of plans allows the agent to choose the appropriate plan for each identified goal. This metric presents the ratio of plans per goal for each agent. It can be calculated by Eq. (12), knowing that
The ratio of reached goals (RRG): the diversity of plans to reach a goal is not the only indicator of the proactivity. Indeed, sometimes all the existing plans fails in reaching the goal. Contrariwise, we can found in other system only one plan for each goal, but this latter is more effective because it allows reaching the identified goal. Consequently, we propose to measure the ratio of reached goal (
In a flexible MAS, agent has the ability to change the interaction protocol, reply to the same message in more than one way, and change his role and relationships. So, sociability characteristic can be evaluated using the following metrics:
Number of interaction protocols (NIP): an agent that can participate in various interaction protocols can contribute in more situations compared by one that has a limited number of interaction protocols. For example, for buying an object several protocols that represent different auction methods can be applied. Obviously, an agent can participate only in situations where it can apply their interaction protocols. More the agent has interaction protocols, more it can be flexible. Consequently, this metric assesses the number of interaction protocols applied in the system.
Number of response messages (NRM): interaction protocols are proposed to ensure the interaction structure by specifying the possible responds for each situation. However, some interaction protocols restricted the possible responds which affect the flexibility of the agent (for example by restrict the possible response on accept or refuse). The response of the agent can be more flexible than this strict classification (by giving a counterproposal instead of refuse). Thus, this metric represents the ratio of the number of possible response messages (RSM) compared to the total number of received messages (RCM). Equation (14) shows this measurement function.
Frequency of role changing (FCR): roles are a key concept for modeling multi-agent organizations. It gives an abstraction representation of the functionalities of the MAS. An agent can play one or several roles. Naturally, by changing its role, an agent will execute different functionalities to respond to different situations. Consequently, changing the role can be considered as an indicator about the flexibility of the multi-agent organization. For this reason, the frequency of role changing is proposed as a metric. It represents the number of times of role change in a unit of time. Formalizing the role changing can be done by Eq. (15), knowing that the function
Based on the above formalization, the metric frequency of role changing will be calculated by the number of executed instruction of
Frequency of relationship changing (FRsC): in multi-agent organizations, the roles are related by different relationships (acquaintance, authority, communication, etc.). Thus, changing the organization cannot do only by changing the roles, but also by changing the relationships between these latter. For example, in teamwork the leader can remark that a critical mission requires more control than ordinary mission. Hence, he will change its relationships with other members to ensure more authority. Consequently, the frequency of relationships change is proposed as a metric of the sociability. This latter represents the number of times of relationship change in a unit of time. In order to calculate this metric (FRsC), changing the roles’ relationships is formalized. In fact, a relationship is a function that relates two roles, and it is defined in a specific set
Emergence efficiency (EE): agents change their relationships to achieve their goals; unfortunately, agents can perform this change without achieving their goals. In this case, the emergence can be considered as an inutile process. It is important to note that the emergence is not a goal in itself but a process to reach goals. Hence, using this metric we can make a difference between utile emergence and inutile ones. This metric is assessed as the ratio of the emergence situations in which the agents achieve their goals and the whole emergence situations. Supposing we have a function
Dynamism is the ability of introducing or excluding new agents to/from the system. Obviously, agent joining or agent leaving must be done according to well-defined protocols to allow other agents to interact with new agents. Usually, a specific agent is used as facilitator which ensures registering of new agents or deregistration leaving ones. Using this technique, an agent can interrogate the facilitator to know the existing agents in the system when it needs. Hence, we propose as metrics of this characteristic:
The frequency of registering agents (FRA): this metric is the number of registering new agents by a time unit. It indicates the joining of the system process. This metric is calculated by Eq. (21), where
The frequency of deregistering agents (FDrA): this metric is the number of deregistering agents. It represents the agents leaving from the system. This metric is calculated by Eq. (22), where #DrI represents the number of executed instructions to deregister an agent.
The frequency of searching agents (FSA): because the dynamic joining and leaving of agents, an agent cannot know a priori the existing agents in the system to interact with them. It must search the existing agents when, it needs a service. Several platforms provide mediator agents (like DF agent) that ensure the registration of existing agents, and give responds to the agents’ requests. Searching the existing agents indicates that the system is dynamic because the agent has not enough information about the other agents of the system. Consequently, the frequency of searching agents measures the dynamism of the MAS. This metric is calculated by Eq. (23), where
The heterogeneity has been observed in many scientific fields and several approaches have been proposed to quantify heterogeneity [62]. Many biologists have proposed measures to quantify heterogeneity to define the biodiversity within an ecosystem [10, 63]. These measures take into consideration the differences between species and the percentage of the total population belonging to each specie. Based on these approaches, two metrics are proposed to evaluate the openness (or the heterogeneity):
Number of agent classes (NAC): various classifications of agents are proposed. In fact, we can distinguish agents according to their abilities, models or architectures. Diversity of agents’ classes in the same system helps for reaching the specified goals because it provides diversity of agents’ abilities. Counting the number of classes of agents in the MAS is the metric of the diversity within this system.
Statistical distribution of agents (SDA): the previous metric gives us a limited indicator about the diversity of the MAS. Indeed, MASs can be composed of several agent classes, but most agents are of the same class. In this case, we cannot benefit from this diversity. Hence, we proposed the statistical distribution of agents. This metric is assessed by the number of agents belonging to each class. Considering
Adaptability concerns the change in the agent structure, its behavior and the state of the objects of the environment. Hence, adaptability is measured using the following metrics:
Behavior diversity (BD): to be adaptive, an agent should be able to change its behavior according to the current situation. Hence, an agent with a limited number of possible behaviors will be characterized by a limited ability of adaptation. So, this metric represents the average number of behaviors per agent. Let’s suppose that the agents are represented by the set
Frequency of behavior changing (FBC): in order to ensure the adaptability, the agent should be able to change its behavior. Several mechanisms allow representing the structure of agents’ tasks. JADE platform, as example, provides the possibility of describing complex behaviors as a finite-state machine (FSM) [20]. By cons, DIMA platform allows implementing adaptive behaviors thanks to a meta-level that represents the structure of behaviors as Augmented Transition Network (ATN) [91]. In both cases, it is possible to change the structure of these behaviors by changing the FSM or the ATN at runtime. Consequently, adaptability of agents’ behaviors can be measured by measuring the frequency of behavior changing. This metric represents the number of times of behavior change in a unit of time. Supposing that
Frequency of structure changing (FSC): in addition to adapting the behavior, an agent can also adapt its structure. In fact, belong the internal structure of the agent, we save its goals, its plans, its messages and its acquaintance list. Changing this internal structure allows changing the goals, the plans and the relationships of the agent. Consequently, structure adaptability can be measured by measuring the frequency of changes that affect the agents’ structure. This metric is calculated as the number of times of agent structure change in a unit of time. In the same manner as the frequency of behavior changing, the frequency of structure changing can be calculated by Eq. (27) knowing that
Frequency of environment changing (FEC): as it said above (in the flexibility ontology), it is possible to adapt the environment to reach some goals of the system instead of adapting the agents. Considering the environment as a set of passive objects, it will be possible to ensure the adaptability of the environment by changing its states. Changing the environment states may be considered as an indicator of its adaptability. Consequently, the frequency of environment changing is measured as a metric of the adaptability. Of course, the environment changing in this case must be made without a direct influence of agents. Equation (28) formalizes a function Inv that define for each executed instruction the class of its invoker (agent (A) or object (O)). Consequently, this metric can be calculated by the number of executed instructions to change the objects of the environment, knowing that their invoker is an object, by time unit (Eq. (29)).
An accessible environment enables agents to obtain information about the state of the environment; therefore accessibility depends on how many attributes of the environment are accessible to agents. To evaluate the accessibility characteristic, we use:
Ratio of accessibility (RA): generally, an agent has a limited ability to access to its environment. Although, an agent cannot perceive all the possible changing in its environment; more the agent perceive its whole environment more it will be able to take correct actions. Hence, this metric assesses the ratio of the accessible attributes of the environment and the whole attributes of the environment. Let’s consider
Learnability allows agents to create new goals and behaviors to deal with new situations. Several techniques are proposed in the specialized literature to ensure the learnability of agents [57]. The diversity of these techniques makes proposing common metrics for this characteristic a hard difficult task. Although each technique has its particularities which must be taken in consideration when intrinsic metrics are proposed, we can propose extrinsic metrics. By extrinsic metric we mean a metric of related aspects of learnability. Especially, we propose metrics for the frequency and effectiveness of the learnability. Also, we propose a metric of the degree of difference between a new goal and existing goal.
Frequency of creating new goals (FCG): as it said above an agent can create new goals to deal with new situations. The frequency of creating new goals indicates the ability of this agent to process rapidly the unexpected situations. This metric is the number of executed instructions (
Degree of novelty of a goal (DNG): a goal of an agent can be modeled by the desired state of its environment or its internal state. To process a new situation, an agent can create new goals. This goal can be derived from the existing goal or it can be totally new one. Obviously, the ability of creating totally new goals means an important ability of learning by the agent. Hence, this metric represents the difference between the new goal and the existing goals. Let’s consider the agent’s goals as states of its environment or its internal state (
Ratio of new goals utility (RNgU): the learnability is not a goal in itself but it is a way to process new situations. Obviously, creating new goals can conducts to a success as it can be failed. Thus, it is important to measure the effectiveness of the learnability. This metric presents the ratio of new goals accomplished and the number of all goals accomplished. Using this metric we can know either the learnability technique is effective or not. Like the emergence efficiency presented above, a function of the utility of new goals is defined (Eq. (33)). The utility of a goal (
Based on the definition of replication, redundancy and diversity techniques, the fault-tolerance characteristic in MAS can be assessed using the following metrics:
Number of agents per role (NAR): this metric presents the average number of agents that can play the same role; and therefore the number of agents that can play the role of another broken down agent. Existence of several agents that can play the same role is a good indicator of the ability of the system to be fault tolerance. Indeed, if an agent failed, it is possible, in this case, to replace its roles simply. Considering the two sets
Number of replicated agents (NRA): in the case where a role is played by only one agent, it is said that this agent is critical. Obviously, fault tolerant system must replicate critical agents. Considering the function
Number of replicas per agent (NRpA): a critical agent can fail several times. In this case, increasing the number of replicas per agent improves the flexibility of the system. Compared to the precedent metric, the set of replicas (
In order to validate our approach, a tool is developed to measure the flexibility metrics of JADE-based applications. In fact, JADE is a popular agent development platform which is widely used to develop MASs [20]. This platform extends JAVA with the necessary concepts that fit with the agent-oriented programming. Mainly, it provides an abstraction level allows programming MASs without a deep knowledge about agent’s theory. Naturally, the basic component provided by JADE platform is Agent class. This class allows programming the autonomous agent because it includes a specific method (called setup) that will be executed automatically by JADE platform when the agent starts its execution. Instead of the classical object-oriented programming where methods are invoked by programmers, executing the setup method preserves the autonomy of agents. Moreover, the activities of an agent should be developed as behaviors. In this context, JADE provides several classes which allow the implementation of the different kinds of behaviors. Generally, a behavior class includes two specific methods: action and done. The action method is used to implement the activity of the behavior. By cons, done method is used to specify the termination condition of the behavior. Consequently, the programmer has not a direct control about the activities of the agent. He can only schedule a behavior by adding it to a pool of agent’s behaviors. The execution of the behavior is controlled by JADE platform. When a scheduled behavior is selected to execution, the agent will execute the action method. Then, the done method will be executed to determine whether the behavior is reached its goal or not. If the done method return false, then the behavior will be scheduled for another execution until reaching its goal. Based on this general form of behaviors, JADE platform provides also several kinds of specific behaviors like OneShotBahviour, CyclicBehaviour and FSMBehaviour.
JADE is designed also to simplify the interaction between agents. In fact, the communication between JADE agents is compatible with the FIPA standards. Hence, an agent can send FIPA-ACL messages to other agents using a simple method (called send). A message is an object that includes several attributes like the performative, the receiver list, the sender and the content. In this context, JADE accomplishes the transfer of messages between agents by hiding the complexity of this process to programmers. Also, this platform provides several interaction protocols to simplify the tasks of programmers.
As an agent development platform, JADE provides several services like
The developed tool measures static and dynamic metrics of the flexibility of JADE-based applications. By static metrics, we mean metrics calculated using the code of the application without need to run the application. Contrariwise, the dynamic metrics require the execution of the application. Figure 3 shows the overall architecture of the developed tool to measure both kinds of metrics. The developed tool is implemented as a package that includes aspects that intercept the execution of relevant instructions, specific class to analyze these events and calculate dynamic metrics, specific class that use the source code of the application under evaluation to calculate the static metrics and a specific class to present graphically the results of the calculated metrics. Figure 4 shows the developed package.
The overall architecture of the developed tool.
The developed tool as a package on eclipse environment.
In fact, the static metrics are calculated based on a lexical analysis of the code of the MASs. It consists of researching some key words in order to collect information about the code of the application (like Agent, Behaviour, OneShotBehaviour, etc.). The collected information will be interpreted to a set of metrics like the number of agents’ classes and the behavior diversity.
The dynamic metrics are measured thanks to aspect-oriented programming. Originally, this software paradigm is proposed to improve the reusability by separating crosscutting concerns to core concerns [24]. Using the aspect-oriented programming, the crosscutting concerns, implemented separately as aspects, will be automatically integrated into the system using the weaver. In order to collect information about the execution trace of the MAS, a set of aspects are developed. These aspects aim to intercept some relevant events during the execution of the application (like the execution of setup, action and done methods). These events are used to calculate the proposed metrics (like the frequency of executing a specific instruction). Figure 5 gives an example of these aspects implemented using AspectJ [65]. In this aspect, the pointcut is specified to intercept each call of the function search (line 4). The function search is used by JADE to search in
The aspect used to intercept the search function.
Finally, it is important to note that despite that JADE is the most popular and widely used platform for developing MASs; it does not support all the techniques discussed in the proposed model. Considering the wide spectrum of concepts studied by the agent paradigm, it will be impossible to propose a platform that meets all the requirements of developers. Consequently, each set of platforms targeted some concepts and techniques of MASs. As example, JADE does not provide the role concept which is a main one for programming organization. Moreover, developing specific reasoning techniques (like case-based reasoning) requires exploiting some specific library or frameworks. Evidently, it is possible to apply the proposed metrics on these frameworks, but this goal is outside the scope of our paper. In fact, due to the limited size of this paper, we will examine only some metrics to validate the proposed model and metrics.
The developed tool is used to measure the flexibility metrics of two applications implemented using JADE platform. Both applications shared the same goal: cleaning an environment. These applications are composed of an explorer agent that explores an environment to identify the garbage’s situations, and one or several carrier agents that transfer the identified garbage. However, the second application is designed to be more flexible compared by the first one. The first application is composed of an explorer that scans the environment and a single carrier agent used to transfer the found garbage. When garbage is found, the explorer requires the service of the carrier agent using the Request interaction protocol because there is only one carrier agent. By receiving the request message, the carrier will move to the garbage position to clean it. Figures 6 and 7 present the activity diagrams of explorer agent and carrier agent respectively.
The activity diagram of explorer agent of the first application.
The activity diagram of carrier agent of the first application.
In the second application, a dynamic system is developed where carriers could join and leave the system depending on the degree of garbage present in the environment. If there is a lot of garbage, carriers must be created and join the system. Otherwise, carriers must be liberated and leave the system. Figure 8 shows the activity diagram of the explorer agent. This last moves to the next position to explore it. If the agent detects a sequence of free positions (i.e. the number of free position is superior to threshold), then it supposes that the rest of the environment is less loaded by garbage. Thus, the explorer agent will liberate some carrier agents. In the opposite way, the explorer agent will recruit new carriers if the number of sequence garbage detected is superior to a threshold because it supposes that the rest of the environment is more loaded. Detecting occupied position necessities requiring the service of carriers according to the number of existing ones. Obviously, if there is only a single carrier, the explorer will use the Request interaction protocol. Elsewhere, it will apply Contract-Net interaction protocol to choose the least loaded carrier. The explorer agent moves through the environment until the end of it.
The activity diagram of explorer agent of the second application.
The activity diagram of carrier agent of the second application.
Figure 9 shows the activity diagram of the carrier agent. Naturally, this agent starts its behaviors by registering in DF agent to allow future interaction with existing agents. Then, it will wait messages from the explorer agent. If a request message is received, then the carrier will clean the received position and return to wait state. Contrarily, receiving CFP messages signifies that several carriers exist in the system and these latter should apply the Contract-Net strategy by sending their proposals and waiting the response of the explorer. Of course, a proposal of a carrier agent can be accepted, and the agent will clean the occupied position in this case, or it can be refused and the agent will return to the wait state if there are more positions to be explored. As a special case, the carrier can receive a message to liberate it (inform message) if there are several consecutive free positions as it is explained above. In this case, the carrier must deregister before leaving the system.
As it said above, some proposed metrics are static ones. It means that calculating these metrics is done by using only the source code of the application. Figure 10 gives some static flexibility metrics for both applications. The proposed metrics measure some attributes of the adaptability, the openness and the sociability characteristics. The number of interaction protocols is a metric of sociability. As we explained above, the first application has only one interaction protocol (Request protocol), but the second application has two interaction protocols (Request and Contract-Net protocols). Considering the metric number of the agent classes that represent the heterogeneity attribute of the openness, we can remark that both applications have two classes (Explorer and Carrier agents). The third metric is a metric of the adaptability; it represents the behavior diversity of an application. This metric indicates that an agent has the ability to adapt its behavior if he has a high level of behavior diversity. In the first application we have only 04 behaviors. On the other hand, we have 08 behaviors in the second application (one of which is complex one). As we explained above, implementing the Contract-Net protocol for the second application (and some related behaviors) justifies the value of this metric for the second application.
In the second phase of validating our approach, we measured some dynamic metrics. These metrics require the execution of the applications. Hence, we validate the two applications using two scenario of each one. The first scenario consists on an environment with only few positions with garbage (only 04% of positions). In the second scenario, the environment is too loaded by garbage (33% of positions). Table 1 gives an overview of the results of the dynamic metrics.
An overview of results of some dynamic metrics
Static metrics of adaptability, sociability and openness.
In the first application and for both scenarios, we can remark that there is no search for agents nor behavior change. In fact, as we said the application does not allow joining and leaving the system. Consequently, the explorer knows, a priori, the existing carrier in the system. Moreover, the statistical distribution of agents in both scenarios is one explorer agent and one carrier agent.
In the second application, we can remark, in Table 1, that the frequency of behavior change is zero (0) because in this scenario there are only few positions of garbage. Consequently, there is only one explorer agent and one carrier agent (as it is presented in the statistical distribution of agents’ metric in Table 1). The explorer agent applied always the Request protocol and did not adapt its strategy to apply the Contract-Net protocol.
Figure 11 presents the Frequency of research about existing agents of the second application. Figure 11a represents the results of the execution of the first scenario. Although there is only one carrier agent in this scenario, we can remark that the explorer agent requests existing agents from DF almost regularly (01 to 05 time each 10 milliseconds). To explain this result, we have to remember that in this second application, the carriers are released if the load of garbage position is low. Knowing that the explorer does not know a priori the existing carriers, it must search in the DF. Consequently, after each regular number of free positions, the explorer agent makes search in the DF.
Figure 11b gives the frequency of search about existing agents for the second scenario. We can remark that during the first 500 millisecond, there is no search of existing agents because the explorer worked with request strategy. After this duration, other carriers are created and join the system. Consequently, the explorer sent a query to the DF agent to identify the existing carriers each time it found garbage. The high level frequency detected in the end of the diagram is justified by existing of free positions. In this case, as we explained above, the explorer wants to release eventual existing carriers.
The results of the Frequency of research about existing agents metric.
The result of the frequency of behavior change metric.
Figure 12 presents the frequency of behavior change metric. This later is a metric of the adaptability. In fact, the explorer agent has a complex behavior designed as FSM behavior. During the execution, we can deactivate some transitions and create new ones to adapt the strategy of the agent (choosing Request Strategy or Contract-Net Strategy). Hence, during the first 2000 milliseconds, this metric is zero because the explorer agent applied the request strategy. Then, the explorer detects the existence of several carriers and adapts its strategy by deactivate a transition to the old strategy and create a new transition to the second one. Consequently, this metric took the value 2. In time 7000 milliseconds, the explorer detected that there is only one carrier and it needs to adapt its strategy by deactivate a transition to the Contract Net strategy and create a new transition to request strategy. Hence, this metric took the value 2.
Figure 13 presents the evolution of the statistical distributed of agents. This metric measures the openness of the MAS. So, during the execution of the second application, the number of agents of the class Explorer did not change (it is 01 from the beginning to the end). However, the number of carrier agents evolved from 01 agent at the beginning of the execution, to become 2, 4, 1, 3, 2 and finally 1. We have mentioned above that carrier agents can join and leave the system during runtime.
The result of the evolution statistical distribution of agents metric.
This work gives a measurement model of the flexibility of MASs. First, it provides an ontology of this property. The role of this ontology is specifying clearly the used concepts of this domain. In fact, these concepts are sometimes ambiguous and overlapping. Then, the proposed ontology is used to define a mathematical model to measure the flexibility of MAS.
As it is cited in the literature review, the flexibility is studied in different domains, by taking into account several points of view and for different products. Table 2 gives a summary of the flexibility measurement approaches analyzed according to several axes. First of all, these approaches are presented according to their original domains (manufacturing, software engineering and MAS). It is obvious that measuring the flexibility is closely related to the definition of this property which is dependent to the study domain. The second analyzing axe is the comprehensive/specific metrics. In fact, most proposed researches consider the flexibility depending on a specific point of view. However, some researches attempt to present a comprehensive flexibility measurement. The third axe to which we analyzed the presented researches is a distinction between metrics of design products and metrics of codes. Obviously, this axe is specific to the approaches of software engineering and MAS. Finally, we distinguish between approaches that proposed model of flexibility in terms of decomposing this property into several characteristics and approaches that proposed direct metrics to measure this property. Dividing the flexibility property into several characteristics is suitable with principles of this domain in which complex properties are targeted.
Compared to the proposed approaches, especially those devoted to MAS, the proposed model in this work gives a comprehensive point of view about the studied property. In fact, this work presents the flexibility property according to the components of the MAS on the one hand, and this property according to its characteristics on the other hand. Moreover, this work is suitable with most researches that targeted complex properties by proposing a measurement model instead of direct metrics. The proposed measurement model is applied to measure the flexibility of implemented MAS. In this context, a tool is developed to measure the flexibility of JADE-based applications.
Summary of related work
Summary of related work
By proposing several metrics for each characteristic of the flexibility property, these metrics can be used as dashboard to control the flexibility of MASs. Despite that this property is fundamental in different fields, it is important to control it. In fact, very flexible system can produce dangerous behaviors. Consequently, users aim to identify the level of each characteristic to limit the possible dangerous behaviors and allowing the desirable ones. For example, despite that learnability can open new perspectives in the interaction between human and machines; it can be also considered dangerous characteristic because it can deprives users from privacy. In this case, users should focus on improving other characteristics of the flexibility without losing the control about the learnability.
In addition, the proposed metrics can be used by managers to compare the different MASs. Taken as example the case study, although both applications have the same goal, but one of them is more flexible than the other. Obviously, this flexibility has an impact on the efficiency, the reliability and the quality of the developed application.
The metrics can also be used to improve developed MASs. Indeed, thanks to the diversity of the proposed metrics, it will be possible to make precise diagnosis. For example, if we need to improve the flexibility of the second application, it is useless to improve the dynamism characteristic because agents are already joining and leaving the system dynamically. However, it is possible to improve the openness by enhancing the heterogeneity of agents (for example by distinguish heavy and light carrier). Also, it is possible to improve the system by implementing techniques of fault-tolerance.
Despite the cited advantages, this work suffers from some limits. As we cited above, JADE platform does not support all the discussed techniques in the proposed model. Hence, it is important to develop other tools and case study suitable with some other multi-agent platforms which support these techniques.
Nowadays, measuring the properties of MASs is becoming a hot research field. Although there have been many past attempts to measure quality characteristics of MASs, the measurement of the most important property, which is flexibility, is not yet studied deeply.
In this paper, we proposed an ontology and a mathematical model to measure the flexibility of MASs. The proposed ontology gives a comprehensive view of the flexibility by decomposing it on several characteristics which are measured by a set of metrics according to their implementation techniques.
Obviously, the proposed characteristics do not have the same importance for measuring the flexibility property. In fact, each characteristic has specific weight on the overall measurement method. These weights can be customized by users according to their needs and the application domains of MASs.
This work can be extended to support other multi-agent platforms by proposing specific metrics of them and developing devoted tools to calculate automatically the proposed metrics. Moreover, integrating the proposed model in more comprehensive model can be helpful to understand and measure the intelligence of agents. In the same context, producing more comprehensive model requires studying of some related properties (like the agility, re-configurability and scalability) and their influence on the flexibility property.
Footnotes
Author’s Bios
