Hostname: page-component-77f85d65b8-5ngxj Total loading time: 0 Render date: 2026-03-27T10:04:54.147Z Has data issue: false hasContentIssue false

Exception handling in multi-agent oriented programming

Published online by Cambridge University Press:  29 May 2025

Matteo Baldoni*
Affiliation:
Dipartimento di Informatica, Università degli Studi di Torino, Torino, Italy
Cristina Baroglio
Affiliation:
Dipartimento di Informatica, Università degli Studi di Torino, Torino, Italy
Roberto Micalizio
Affiliation:
Dipartimento di Informatica, Università degli Studi di Torino, Torino, Italy
Stefano Tedeschi
Affiliation:
Università della Valle d’Aosta – Université de la Vallée d’Aoste, Aosta, Italy
*
Corresponding author: Matteo Baldoni; Email: matteo.baldoni@unito.it
Rights & Permissions [Opens in a new window]

Abstract

Exception handling has been successfully proposed in the past years as a simple yet powerful software engineering tool to promote modularity and decoupling, while also preserving robustness. Multi-agent systems (MAS) and organizations (MAOs), in turn, offer powerful abstractions to build distributed systems; current models and methodologies, however, fall short in addressing exception handling in a systematic way, not considering exceptions as part of their design. Thus, the problem is usually approached by ad hoc solutions that hamper code modularization and decoupling. In this work, we outline a vision of how exception handling in MAS can be granted by design. We present an extension of the organizational model and infrastructure adopted in JaCaMo, that explicitly encompasses the notion of exception as a first-class element in the design of an organization. Relying on such a model, we propose an exception handling mechanism that is seamlessly integrated with organizational concepts, such as responsibilities, goals, and norms. In an organization, besides responsibilities for organizational goals, we propose to specify also responsibilities for managing exceptions, that is, for providing feedback about the context in which exceptions occur, and for handling it.

Information

Type
Research Article
Creative Commons
Creative Common License - CCCreative Common License - BY
This is an Open Access article, distributed under the terms of the Creative Commons Attribution licence (https://creativecommons.org/licenses/by/4.0/), which permits unrestricted re-use, distribution and reproduction, provided the original article is properly cited.
Copyright
© The Author(s), 2025. Published by Cambridge University Press
Figure 0

Figure 1. The Therapy scenario

Figure 1

Listing 1. Organization structural, functional, and normative specifications.

Figure 2

Listing 2. JaCaMo library that maps organizational obligations onto agents’ internal goals.

Figure 3

Listing 3. Excerpt of the patient agent’s code.

Figure 4

Figure 2. JaCaMo’s conceptual meta-model extended for exception handling. The newly added concepts are highlighted in orange. Orange lines also highlight the mapping among concepts belonging to different dimensions

Figure 5

Listing 4. Excerpt of the doctor agent’s code.

Figure 6

Listing 5. Excerpt of the pharmacist agent’s code.

Figure 7

Table 1. Condition types for notification policies. When the organization is made of a single functional decomposition scheme instance $\mathsf{scheme\_id(S)}$ can be omitted

Figure 8

Listing 6. XML template for notification policies. $+$ indicates one or more occurrences of the element between square brackets, $*$ indicates zero or more occurrences, and $?$ indicates optional elements.

Figure 9

Figure 3. The Therapy scenario extended with exception handling

Figure 10

Listing 7. Notification policy for the Therapy scenario.

Figure 11

Listing 8. Excerpt of the patient agent’s code extended with exception handling.

Figure 12

Listing 9. Excerpt of the pharmacist agent’s code extended with exception handling.

Figure 13

Listing 10. Excerpt of the doctor agent’s code extended with exception handling.

Figure 14

Figure 4. General architecture of JaCaMo’s organizational component. The parts affected by our extension are highlighted in orange

Figure 15

Table 2. Normative facts capturing notification policies

Figure 16

Listing 11. NOPL norm issuing obligations to achieve goals.

Figure 17

Listing 12. NOPL norm regimenting goal failure.

Figure 18

Listing 13. NOPL norm regimenting exception raising conditions.

Figure 19

Listing 14. NOPL norm regulating agents allowed to raise exceptions.

Figure 20

Listing 15. NOPL norm regulating the achievement of raising goals.

Figure 21

Listing 16. NOPL norm regimenting the raising of unknown exceptions.

Figure 22

Listing 17. NOPL norm regimenting exception arguments groundness.

Figure 23

Listing 18. NOPL norm regulating the absence of required exception arguments.

Figure 24

Listing 19. NOPL norm prohibiting undesired exception arguments.