Keywords

1 Introduction

Electronic systems might encounter many unexpected circumstances in dynamic and ever-changing environments that negatively impact their functioning. Some of these adverse events might be internal (e.g., device failures and dead batteries), and others might be external, i.e., originated in the environment where these systems are placed (e.g., stolen components, power outages and fires). Thus, electronic systems can hardly be programmed statically but should adapt to changing situations autonomously. To this end, systems should have computational and learning capabilities to understand their nearby environment, identify potential threats, and respond accordingly.

Multi-agent systems (MAS), an active research area in distributed artificial intelligence, are key enablers to meet these requirements. They comprise multiple autonomous computing entities, called agents, able to communicate and cooperate in a shared environment while performing complex tasks [1]. Through sensors, agents can acquire information from the environment, make local information-based decisions, and take action on the environment accordingly. While each agent decides the best action to solve a specific task, MAS leverage social abilities, such as coordination, negotiation and cooperation, to deal with complex problems that cannot be solved using the capabilities of a single agent. Since MAS can flexibly and efficiently perform complex problem-solving, they are suitable for uncertain environments under constant change. Despite their benefits, it is not yet clear how to organise agents to maximise their adaptability and reliability capabilities, and this design decision remains problem specific.

In his article, we discuss the opportunities of adopting a hierarchical organisation for MAS-based systems in the context of pervasive electronics. More specifically, after describing the hierarchical organisation, we exemplify its application with a use-case focused on smart classrooms. The remainder of the article is organised as follows: Sect. provides a quick overview of MAS organisations. Next, Sect. 3 outlines our hierarchical approach, and Sect. 4 presents a case study in school smart classrooms. The article finishes with some conclusions in Sect. 5.

2 Quick Background on MAS Organisations

Multi-Agent Systems (MAS) is a field within the broader discipline of Distributed Artificial Intelligence. They have been defined as systems comprising multiple autonomous computing elements—called agents—that can interact and cooperate with each other [1]. MAS use these cooperation (i.e., social) abilities and their interactions with the environment to solve problems collaboratively (e.g., by dividing them and addressing smaller tasks) in a flexible way. Thanks to their knowledge of the environment, agents in a MAS can choose and perform actions, making them suitable for dynamic and complex environments. MAS have been used in various areas, including computer science, logistics, transportation, industry, and control engineering. However, most of the work on applying MAS is still domain-specific, and there is a lack of flexibility and resilience. Moreover, there is no consensus on a single taxonomy for MAS, and several approaches, following diverse criteria can be found in the literature. Regarding how MAS organise their agents, the following approaches are mostly considered:

  • Flat organisation: all agents are considered equal and collaborate and communicate at the same level. The flat organisation significantly increases communication and local processing overhead.

  • Hierarchical organisation: agents follow tree-like hierarchical relations by which higher-level agents can control and assign tasks to lower-level agents.

  • Holonic organisation: fractal-like organisation in which agreed commitments in nested groups bound agents together. Any group (holon) can be logically seen as an agent comprising sub-agents arranged in a self-similar structure.

  • Coalitions: agents with similar goals form temporary groups that are dismantled when they are no longer needed. Cooperative and self-interested agents may form coalitions, which usually have a flat structure.

  • Teams: Agents in teams pursue a commonly agreed objective. That is, agents collaborate to reach a team goal, which can differ from their own goals.

  • Markets: resemble real-world market economies. Based on self-interested agents that compete to receive items (such as services, shared resources, or tasks), trying to maximise their individual utilities.

  • Congregations: agents with complementary abilities form congregations, which are long-lived flat organisations, to attain requirements that they cannot achieve individually. Agents in a congregation do not have any concrete predefined goal, and they group together to achieve a stable set of capabilities.

  • Matrices: are multi-hierarchy organisations in which at least one manager agent manages each agent. That is, managed agents may follow multiple chains of command and rules.

  • Societies: are open systems formed by heterogeneous agents having any goal or capability. Interactions inside a society are flexible, and agents can form other types of structures or be unrelated while belonging to the society.

  • Federations: grouped agents transfer some degree of autonomy to a single intermediary or broker agent representing the group. Group members interact only with their broker, which can communicate with other brokers.

It is still unclear which organisation strategy is best, and the election is made ad-hoc and problem specific.

3 Multi-layered Event-Driven Hierarchical MAS

Inspired by the Complex Adaptive Systems (CAS) properties [2], we propose a multi-layered event-driven hierarchical MAS model to enhance the resiliency of pervasive electronics systems applications. As introduced in the previous section, in a hierarchical organisation, agents follow tree-like hierarchical relations by which higher-level agents can control and assign tasks to lower-level agents. The tree-like structure in which agents are organised allows partitioning problems into smaller, more manageable portions that can be solved collaboratively. This facilitates the coordination of multiple behaviours and enables the resolution of conflicts that may arise among agents [3].

In our multi-layered event-driven hierarchical MAS model, agents are organised hierarchically in stacked layers according to a set of semantic categories representing different levels of abstraction. Each layer represents an increased level of complexity. Our approach is characterised by (i) events, i.e., relevant pieces of contextual information about the system’s state sent from one agent to another, (ii) roles, i.e., behaviour, capabilities and constraints that agents are compelled to fulfil, acting as a representation of the observable behaviour exhibited by agents. According to a role-transition graph, agents change roles in response to the events received and the world perceived. And (iii) the very agents, i.e., heterogeneous software or hardware entities with diverse capabilities assigned in real-time based on the system’s needs.

Regarding communications, a double flow of data and control between adjacent levels guide the MAS operation. In particular, agents operate in a continuous Observe-Orient-Decide-Act (OODA) loop [4] through which they: (i) perceive the world, (ii) enrich perception with contextual data, (iii) decide which role is enacted, and (iv) enable the proper roles and follow the associated behaviours.

The hierarchical organisation of the agents is exploited in two ways: first, lower-level data flows towards higher levels, where it gets aggregated to achieve contextual awareness. Second, control messages are pushed towards lower-level agents to keep the MAS aligned with the needs of higher abstraction levels.

Agents activate roles according to their capabilities, the occurrence and priority of events, and the needs of the collective. Collective needs, evaluated following distributed multivariate criteria, comprise: (i) minimising the duration of adverse events, (ii) maximising role redundancy across any level, and (iii) maximising role diversity across any level. Using a repository of roles (available to all agents for installation) promotes code modularity and re-usability. In addition, enforcing role redundancy and diversity enables flexible responses to various adverse events, which enhances the preparedness and resiliency of the system.

Several properties of our model can be easily identified:

  • Robustness: The distributed nature of this organisation reduces performance bottlenecks and service outages, improving robustness.

  • Heterogeneity: The ability to allocate resources across a network of agents allows the use of resource-constrained devices (e.g., IoT devices) in lower-level agents. By providing a hierarchical relation among agents, lower-level agents can sit in low-capacity devices and send data to a parent agent hosted by a powerful device, where complex processing is made.

  • Awareness: Agents can act as malfunction detectors for their sibling agents (e.g., by comparing the readings of several sensor agents or polling them with a heartbeat event), and take action, such as role switching, to support the continuity of operations.

  • Compartmental-friendly: Our organisation allows partitioning the scenario into several levels of complexity, which aids problem conceptualisation, access control, and agent behaviour design.

  • Distribution of Labour: Low-level agents can respond to environmental changes by sensing their surroundings and taking action. Higher-level agents concerned with abstract contexts can run more complex roles that imply deliberation and learning to make inferences and gather knowledge.

Since this model is very theoretical, in the next section, we put it into practice and show a real application to clarify its functioning.

4 Case Study: School Classrooms Monitoring

To validate the suitability of our model, we have implemented a monitoring system for contextual sensing [5]. This system, installed in a hundred classrooms from forty schools across Catalonia, captures and analyses several contextual variables, such as air temperature, relative humidity, CO\(_2\) concentration, particulate matter, room ventilation, UV light, noise level, and people’s movement, among others, using low-cost sensors [6, 7]. Within the classrooms’ context, these variables gain relevance due to their relationship with academic performance and the spread of respiratory viruses [8].

Fig. 1.
figure 1

Our MAS model adapted to contextual monitoring in schools

Fig. 2.
figure 2

Contextual monitoring in primary schools’ classrooms in Catalonia (Spain)

According to our model, we distinguish four agent roles (see Fig. 1). At the lowest level, the sensor agent is responsible for interacting with a specific sensor. This agent uses the sensor’s library to collect the corresponding contextual variable. Note that if a sensor is broken, its agent will malfunction, but the rest of the sensor agents will not be affected. Also, this agent can raise alarms if a given variable exceeds a threshold (e.g., air temperature higher than 28 \(^\circ \)C). At the second level, there is the controller agent, which orchestrates the logical functioning of several sensor agents. This agent is responsible for (i) verifying that all sensor agents are up and running and (ii) forwarding the data received from the sensor agents to the higher level. At the third level, there is the classroom agent, which is responsible for controlling all the sensor agents within a classroom. With the advent of smart classrooms [9], several technological systems will interact within the classroom: contextual sensing, multimedia systems, teaching facilitators, and smart equipment. Classroom agents will therefore be essential to coordinate all the functionalities, operations, and data flows within each classroom. Last but not least, at the fourth level, there is the school agent, able to manage and coordinate all the information gathered from its classroom agents. This agent provides a graphic data visor to display and report all the school’s related information to the school’s principal (see Fig. 2).

5 Conclusions

Environments are becoming increasingly unpredictable, and electronic and computing systems must be ready to adapt to changing circumstances. Regarding resiliency, systems must be able to adapt to guarantee proper functioning. This property is essential in sensitive environments like healthcare. Thus, in this article, we have presented a multi-layered event-driven hierarchical MAS model, and we have exemplified its functioning in a real-world application. With our solution, agents are organised hierarchically with multiple layers of abstraction and can dynamically adapt their roles/behaviours depending on events.

This is a first step towards a more comprehensive analysis. We recognise that with this paper, we have only started to scratch the surface of a very complex and promising research line. Further work could focus on the following lines:

  • Performance: There is a need for a thorough analysis of the performance of our hierarchical organisation. Protocols for the exchange of messages and events should be carefully studied.

  • Roles marketplace: Creating a “marketplace” for agents to access a variety of roles is paramount for the real scalability and reusability of our solution.