Proceedings Woa 2020
Proceedings Woa 2020
st
Proceedings of the 21𝑠𝑡 Workshop
Edited by
Roberta Calegari
Giovanni Ciatto
Enrico Denti
Andrea Omicini
Giovanni Sartor
Table of Contents
Preface iii
Giovanni Ciatto, Roberta Calegari, Enrico Siboni, Enrico Denti, Andrea Omicini
2P-Kt: logic programming with objects & functions in Kotlin 219
iii
iii–iv
MAS, based on her review “Logic-based Technologies for Multi-agent Systems: A Systematic
Literature Review”. The talk emphasised the core role of MAS in the design of intelligent systems
since their very beginning and their long-term connection with logic-based technologies, thus
opening new ways to engineer explainable intelligent systems.
The “Fabio Bellifemine” keynote speech was given by Alessandro Ricci discussing the topic
of programming multi-agent systems—“Reflections after a decade building and using JaCaMo”.
There, JaCaMo is a platform that allows to program multi-agent systems integrating agent,
environment and organisation as first-class design and programming dimensions, and exploiting
Jason, CArtAgO and Moise as concrete technologies. Within the talk, Alessandro Ricci shared
his experience, reflections, and thoughts about the future of agent-oriented programming.
The 17 papers collected in this issue were organised, presented, and discussed into six
thematic sessions. The final versions here includes also include the outcomes of some of the
several interesting discussions that followed the presentations at the workshop. The authors’
contributions cover quite relevant research areas that include (i) simulation, (ii) organisations,
norms, and argumentation, (iii) features of MAS as robustness, trust, and explainability, (iv)
healthcare applications, (v) agents and actors for data science and (vi) tools and application for
MAS.
Finally, the Organising Scientific Committee gratefully thanks all those who have contributed,
with their work and their enthusiasm, to the success of this edition of WOA: the members of
the WOA Board; the members of the Program Committee; the Department of Informatics –
Engineering and Information Sciences (DISI) of the University of Bologna; the Alma Mater
Research Institute for Human-Centered Artificial Intelligence of the University of Bologna; the
local organisers; the speakers of the workshop sessions; the mini-school lecturers; the sponsors;
and all collaborators who participated in the organisation. More generally, we would like to
thank the lively, creative, and sometimes even volcanic community that has been regularly
meeting for 21 years at the workshop.
Bologna, Italy
October 15, 2020
Roberta Calegari
Giovanni Ciatto
Enrico Denti
Andrea Omicini
Giovanni Sartor
iv
Session 1
Simulation in MAS
An Agent-based Simulator for Urban Air Mobility
Scenarios
Maria Nadia Postorinoa , Francesco A. Sarnéb and Giuseppe M. L. Sarnéc
a
Department DICAM, Alma Mater Studiorum, University of Bologna, Viale Risorgimento 2, 40136 Bologna, Italy
b
Politecnico of Milan, P.za Leonardo da Vinci, 32 20133 Milano, Italy
c
Department DICEAM, University Mediterranea of Reggio Calabria, Loc. Feo di Vito, 89122 Reggio Calabria, Italy
Abstract
In the next years, flying cars are expected to become a real opportunity to realize Urban Air Mobility
(UAM) systems. Most of the appeal is given by the opportunity of avoiding congestion, gaining time and
reducing environmental impacts with respect to conventional mobility. However, UAM implementation
is not trivial as it has several implications in manifold areas like safety, security, traffic control, legal
issues and urban design among the others. To investigate on the impacts of UAM, a dedicated agent-based
framework has been designed. The results of some preliminary tests carried out to verify the capabilities
of this simulator are presented.
Keywords
Flying cars, Simulator, Software agents, Transportation network, Urban Air Mobility
1. Introduction
In the wake of Icarus, thanks to recent technological advancements, Personal Aerial Vehicles
(PAV) and Passengers Unmanned Aerial Vehicles (PUAV) moving on both land and aerial
modalities, also known as “flying cars”, make it real the opportunity to realize an Urban Air
Mobility (UAM) for point-to-point connections. To this aim, a growing number of flying cars is
being developed or tested all over the world also by commercial companies like Uber [1], which
is planning to start with aerial services [2] when technical, urban, legal and economic criticisms
will be solved. Indeed, until now UAM requirements have not been considered neither in urban
planning policies (e.g., landing and take-off spaces for transition from ground to aerial mode
and vice versa) nor from laws and regulations point of view (e.g., safety, security and privacy
issues due to flights over or close to buildings have not been considered yet).
Consequences on urban transportation contexts and economic convenience of UAM scenarios
are not fully understood and, therefore, there is the need to investigate about them. To this aim,
the state of a transportation network [3], where conventional vehicles coexist with flying cars,
has to be simulated. In particular, interactions and decision processes not taken into account in
WOA 2020: Workshop “From Objects to Agents”, September 14–16, 2020, Bologna, Italy
" [email protected] (M. N. Postorino); [email protected] (F. A. Sarné);
[email protected] (G. M. L. Sarné)
~ https://www.unibo.it/sitoweb/marianadia.postorino/ (M. N. Postorino);
https://www.unirc.it/scheda_persona.php?id=50234 (G. M. L. Sarné)
0000-0002-6609-4818 (M. N. Postorino); 0000-0003-3753-6020 (G. M. L. Sarné)
© 2020 Copyright for this paper by its authors. Use permitted under Creative Commons License Attribution 4.0 International (CC BY 4.0).
CEUR
Workshop
Proceedings
http://ceur-ws.org
ISSN 1613-0073
CEUR Workshop Proceedings (CEUR-WS.org)
2
Maria Nadia Postorino et al. 2–14
usual traffic simulations (e.g., interactions of flying cars with other vehicles and obstacles or
criteria adopted to choose of moving in aerial or ground modality) have to be considered for
evaluating their effects in UAM scenarios.
Intelligent software agent technology (from here on only agent) has been extensively applied
to simulate and manage different aspects, at different level of detail, of a wide variety of
transportation systems [4, 5, 6, 7]. In transportation systems, agents can play different roles
(e.g., travelers, vehicles, signals, etc.). Many studies have explored the opportunity of taking
advantage from the autonomous, adaptive, learning, pro-active and social abilities of agents [8]
as well as their capabilities to work in large, centralized or distributed contexts also in presence
of uncertainty or dynamic behaviors [9, 10].
Such agent features well fit with the need to simulate autonomous vehicles, their motion
on transportation networks and their choice processes. Therefore, the agent technology has
been adopted also to implement an UAM simulator by associating an agent with each moving
flying or ground vehicle that, similarly to Connected Automated Vehicles (CAVs), has been
assumed to be fully automated. By using this UAM simulator, we want to investigate on the
potential advantages, in terms of travel times, deriving by the possible, future realization of
UAM scenarios but without to simulate other aspects which depend from laws and regulations
that at the moment are not defined. To this aim, some test transportation networks of different
size have been considered, in order to have comparable scenarios. In fact, it is expected that
UAM scenarios in existing urban contexts of different size, to which transportation networks
refer, will be affected by the urban features, such as location of spaces for landing and take-off,
urban structure, building height and specific vertical obstacles among the others, which will
result in specific requirements for each tested real network. Then, to avoid specific-feature
effects and provide appropriate comparisons, in this study modular test transportation networks
have been used, which are based on the aggregation of suitable, unitary modules and refer to the
same urban features. The preliminary campaign of experiments carried out on these modular
transportation networks of different size has allowed to calibrate the agent-based simulator,
including agents’ behaviors.
To compare UAM scenarios, the index called “Travel Time Advantage” (TTA) has been
introduced, which is the ratio between travel times computed when both ground and flying
mobility are allowed on the examined transportation network and travel times computed when
only ground mobility is admitted.
The paper is organized as follows. In Section 2 some of the main characteristics of flying cars
and some scenarios are presented. In Section 3 the agent-based UAM model is described and in
Section 4 the UAM agent-based simulator is presented and discussed. Section 5 some related
work are described and, finally, in Section 6 some conclusions are drawn.
1. Vehicle architecture. Shape and size of vehicles must be compatible with both flying
3
Maria Nadia Postorino et al. 2–14
(e.g., aerodynamic) and land (e.g., road lanes width, take-off, landing and parking spaces)
constraints [11]. Vehicles mainly differ for take-off and landing (TOL) operations, which
can be Conventional (CTOL) or Vertical (VTOL). In urban contexts, VTOL vehicles are
expected to be preferred to CTOL ones for the smaller TOL spaces required and the higher
maneuverability [12].
2. Operability. Different aspects can influence the vehicle operability [13, 14, 15, 16], which
is usually defined in terms of:
a) Range - the maximum flight distance, measured on the ground, traveled for the
maximum fuel/charge capacity;
b) Endurance - the maximum flight time with respect to the maximum fuel/charge
capacity;
c) Speed - with respect to both “on-the-road” and “in-flight” modalities.
3. Vertical position and main flight rules. The vertical position of flying objects in low level
space may be identified by the following vertical distances, namely:
a) Height - measured from the Above Ground Level (AGL);
b) Altitude - measured from the Mean Sea Level (MSL);
Flying conditions [17] currently operating are:
a) Visual Flight Rules (VFR), for Visual Meteorological Conditions (VMC), permitted
until 3000 𝑓 𝑡 from the ground or sea level;
b) Instrument Flight Rules (IFR), applying to Instrument Meteorological Conditions
(IMC) [18].
Flying car VFR conditions are expected to be realized at a Very Low Level (VLL) airspace,
i.e. 0 − 500 𝑓 𝑡 AGL, where cabin pressure plant does not need.
4. Automation level. Flying-cars can have different automation/autonomy and flight assis-
tance degrees, depending on the on-board driving systems [19, 20] and communication
features, e.g. FANET [21]. Note that autonomous vehicles are expected to be driverless
and fully automated (e.g., they monitor the environment around them to adapt their
positions/behaviors).
II) Long/medium-distance trips, with flying mode for the longer legs and ground mode
within cities, and with take-off and landing areas on external or dedicated transition roads
completely separated from ground mode operations;
4
Maria Nadia Postorino et al. 2–14
III) Short/medium-distance trips (Figure 1), where flying cars can move both between city
pairs and almost everywhere within cities, although TOL operations happen only at
dedicated areas linked to roads for only ground mode.
The agent-based simulator has been designed for the latter one, which includes the main
features of the other two cases.
5
Maria Nadia Postorino et al. 2–14
area and (ii) sufficient to provide safe conditions for entering/leaving the ground transportation
network also along the TAs [22]. Moreover, flights have been allowed only along prefixed, safe
routes. Other issues concerning rules and prescriptions for security reasons are behind the
focus of this research.
To obtain realistic simulations, we assumed that: (i) flying cars keep safe distances with
ground obstacles and other flying cars; (ii) TOL transition areas are suitably connected to
the ground transportation network; (iii) flying mode can be chosen to move between TAs by
maintaining a height suitably greater than the highest building or ground obstacle.
In detail, the agent framework has been specified as follows:
1. Vehicles are homogeneous for characteristics and equipment and each vehicle 𝑖 is associ-
ated with an agent 𝐴𝑖 .
3. For a given origin/destination (𝑂/𝐷) pair [23] the following conditions hold:
a) The flying leg of a trip follows the Euclidean route. If the Euclidean distance of a trip
is greater than 𝑑𝑚𝑖𝑛 it will take place by combining ground and aerial links, otherwise
it will be only on ground mode.
b) For each 𝑂/𝐷 trip, the minimum travel time path is computed as 𝑡(𝑓𝑔 ) = 𝑙𝑔 /𝑣𝑔 +𝑙𝑓 /𝑣𝑓 .
The ground speed 𝑣𝑔 is empirically computed for urban roads as 𝑣𝑔 = 𝑐1 − 𝑐2 · 𝑓𝑔 ,
where 𝑓𝑔 is the traffic volume (i.e., the number of agents) on the ground link at a
given time, 𝑐1 = 37.5 and 𝑐2 = 8.5 · 10−6 (for 𝑣𝑔 measured in 𝐾𝑚/ℎ) are coefficients
empirically computed for averaged road features (e.g., width, slope, etc.), 𝑙𝑔 , 𝑙𝑓 and
𝑣𝑓 are respectively the length of the ground link, the length of the aerial link and the
speed on the aerial link. Note that, congestion effects have been assumed to be caused
only by ground traffic flows [24].
c) Agents are autonomous in their choices, although coordinated by a central Agency
to/from which they send/receive information about their position, those of other agents
and obstacles in their neighboring and about the status of the transportation network.
6
Maria Nadia Postorino et al. 2–14
Combined ground and aerial trips will start only after agents receive information by
the Agency, in order to avoid congestion effects at the transition areas
d) All the agents adopt the same TOL procedures.
To compare UAM scenarios at increasing network size, the index “Travel Time Advantage”
(TTA) is computed as the ratio between the total “flying-ground” travel time and the total
ground travel time for “only ground” mode to move between an 𝑂/𝐷 pair over all the agents
and O/D pairs, has been considered:
∑︀ 𝐺+𝐹
𝑖 𝑇 𝑂/𝐷, 𝑖
𝑇 𝑇 𝐴 = ∑︀ 𝐺
(1)
𝑖 𝑇 𝑂/𝐷, 𝑖
𝐺+𝐹
where, for each 𝐴𝑖 , (i) 𝑇𝑂/𝐷, 𝑖 is its travel time in ground+flying mode and (ii) 𝑇𝑂/𝐷, 𝑖 is its
𝐺
7
Maria Nadia Postorino et al. 2–14
L
5
V1
4
TA
3
V2
2
V3 l
1
1 2 3 4 5
Figure 2: Baseline transportation network module (green lines represents real connections, red line
represent virtual connections with trip origin/destination red nodes 𝑉 , 𝑇 𝐴 is the transition area of the
module).
In particular, the basic transportation network module consists of a square mesh grid (see
Figure 2) of dimensions 𝐿 × 𝐿 formed by 5 × 5 nodes and two-way road links of equal capacity
and length 𝑙 = 𝐿/4. TOL procedures at the transition area 𝑇 𝐴 (represented by the yellow
circle in Figure 2) are maintained distinct for ground traffic flows entering to/exiting from it.
More in detail, each combined (i.e., ground + flying) trip: i) starts from an origin (o) node 𝑉𝑜 ;
ii) reaches the transition area 𝑇 𝐴𝑜 in ground mode; iii) takes-off from the transition area 𝑇 𝐴𝑜
and lands at the destination (d) transition area 𝑇 𝐴𝑑 in flying mode; iv) reaches in ground mode
the destination node 𝑉𝑑 where the trip ends.
The UAM simulator has been applied on two test transportation networks formed by 2 × 2
and 3 × 3 modules and by setting the length of each module to 𝐿=1600 𝑚. Moreover, the
𝑂/𝐷 trip demand has been simulated by adopting an average value of 250 vehicles/h. For each
O/D pair, the demand for time intervals of 5 minutes has been generated by using a variation
coefficient set to 0.4. The minimum flight height has been set to 50 𝑚1 , by assuming a maximum
building height of 30 𝑚. Based on the aerial link length and height, the cruise flying speed
varies in the range 80 ÷ 120 𝐾𝑚/ℎ. In principle, departure times at a transition area depend
on i) the expected ground travel time to reach the transition area from an origin node and ii)
the queue at the transition area. To avoid or minimize waiting times at the transition area (i.e.,
queues for departures and arrivals), the Agency will inform each agent (i.e., vehicle) about the
estimated times:
i) to reach, in ground mode, the transition area from an origin node by considering the current
number of agents on the path;
ii) to fly between two transition areas by considering take-off and landing procedures, cruise
1
Note that the adoption of a lower minimum flight height requires the assumption of additional conditions and
hypothesis on the vehicle equipment, the air traffic control and the urban design.
8
Maria Nadia Postorino et al. 2–14
Table 1
TTA results for the tested networks of 3 x 3 and 4 x 4 modules
Scenario 3x3 4x4
𝑆0 (𝑂/𝐷 baseline) 0.38 0.35
𝑆1 (10% 𝑂/𝐷 increase) 0.45 0.39
𝑆2 (20% 𝑂/𝐷 increase) 0.66 0.57
𝑆3 (30% 𝑂/𝐷 increase) 0.73 0.65
speed and the time spent until a free slot is available, which depends on the current number
of agent on that route.
The structure of the transportation test network is coherent with conventional city organiza-
tion where only few areas could be available for transition processes, mainly for safety reasons
and urban obstacles. Moreover, we assumed that the aerial network is considered virtually not
congested because on the same route there is the opportunity of using more lanes, separated
from each other by 5 𝑚 in height (see Section 3). Note that, for short trips the travel time of
only-ground paths could be less than the one of combined ground + flying paths.
Agent moves on the transportation links according to a minimum travel time path crite-
rion [27]. The link travel times are continuously updated by considering the number of agents
that are on the links (see Section 3, point b). At transition areas, the maximum acceleration and
speed in ground modality have been set respectively to 2.5 𝑚/𝑠𝑒𝑐2 and 100 𝑘𝑚/ℎ [28].
The reference (i.e., baseline) transportation UAM scenario is 𝑆0 , with baseline 𝑂/𝐷 trip
demand level and only-ground mode. For the other scenarios, the 𝑂/𝐷 trip demand has been
increased by 10%, 20% and 30% with respect to 𝑆0 . For the 𝑆0 scenario, the value of 𝑇 𝑇 𝐴 is
1, while enabling also the flying modality the obtained results are shown in Table 1. As it can
be seen, the higher the level of demand, the more the link traffic flows increase that, in turn,
causes travel times increase according to a congested network approach2 . Finally, given that
not all individual trip origins and destinations can be reached in a ground mode, and not all
the trips are suitable for flying legs, flying and ground modes have to co-exist. However, when
ground traffic increases then travel times generally increase and the times to reach transition
areas to travel in aerial mode could not be more convenient than using only ground links.
5. Related Work
Decision processes underlying planning and management activities require the knowledge of
the state of a system under different conditions and constraints, which can be obtained by using
simulation tools to test hypotheses and architectures [3]. To this aim, the agent technology
is widely adopted for its advantages, particularly the opportunity of providing agents with
different degrees of intelligence, autonomy, learning, adaptive, time-persistent and pro-active
capabilities [4, 6]. In the transportation field, agent-based simulations are mainly carried out at
2
Agent’s path choices change according to link travel times, which in turn depend on agents on the link, thus
producing a traffic flow distribution on the network [29, 30].
9
Maria Nadia Postorino et al. 2–14
a microscopic level [31], but there exist also a significant amount of both macroscopic (usually
less competitive in terms of design and use of computational/storage resources) and mesoscopic
(combining micro and macro aspects) agent-based tools for simulations [32, 33].
Agents have been exploited to study almost all the different aspects involved in usual trans-
portation systems like, among the others, network management [34], transit [35], car-sharing
and car-pooling [36, 37], vehicle emissions [38, 39], pedestrian mobility [40], flight recommender
[41]. However, given the overwhelming body of researches presented in the literature and the
impossibility to provide the interested readers with a comprehensive summary, they could refer
to the many existing survey as [4, 42, 43, 44]
In the latter years, an increasing number of research dealt with different aspects involved in
UAM and, also in this case, agent-based simulation have been widely exploited to study the
opportunities offered by this new promising type of mobility [45]. For instance, high-dense
traffic UAM scenarios have been considered in [46, 47] by adopting several scheduling horizons,
in [48] airspace integration approaches have been investigated on air vehicle separation issues
and in [49] autonomous vehicles, driven by an algorithm with collision avoidance capability,
have been simulated on three free-flight scenarios. Other studies have simulated an UAM service
on the Sioux Falls area to evaluate several parameter sets and contexts in [50] or by analyzing
three case studies to identify possible constraints for UAM services on the basis of mission types
or environments in [51].
Finally, communications play an important role for automated/autonomous vehicles and
software agents are frequently adopted to simulate communication architecture, routing pro-
tocols and the coverage range of the ground infrastructure in complex urban environments.
For ground and flying vehicles, Vehicular and Flying Ad hoc Networks (i.e., VANET [52] and
FANET [53]) have been respectively proposed to improve the safety of vehicles and prevent
collision accidents. In particular, [54] highlights as usual Air Traffic Control (ATC) systems, in
presence of high UAM traffic levels and complex urban environments, might fail in monitoring
and supporting the vehicle safety and this requires that vehicles should be provided with high
levels of autonomous driving.
6. Conclusions
This paper presented an agent-based simulator designed to simulate UAM by considering vehicle
interactions (when they are in ground and aerial modality), transition processes, security and
air traffic control issues. It allows to evaluate the benefits deriving from UAM, with the desired
level of detail, on simulated transportation networks, by means of the value of TTA measure.
Forthcoming researches will test this simulator on different UAM contexts represented by
transportation networks of different size and with different demand levels also to evaluate the
potential advantage given by UAM with respect to the demand level, flight distance and location
of transition nodes. However, note that current regulations do not admit private flights over the
city at low altitudes, except some specific, authorized cases and, therefore, before UAM becomes
a reality the whole regulatory framework should be changed/adapted to meet some specific
requirements.
Finally, further advancements will include the simulation of aerial congestion phenomenon,
10
Maria Nadia Postorino et al. 2–14
the optimization of taking-off and landing processes under specific conditions and the effects
due to the location of transition nodes.
Acknowledgments
This study has been supported by the Network and Complex Systems (NeCS) Laboratory at
the University Mediterranea of Reggio Calabria, Department of Civil, Energy and Materials
Engineering (DICEAM).
References
[1] Uber, https://www.uber.com, 2020.
[2] Uber, https://www.uber.com/elevate.pdf, 2020.
[3] J. Barceló, et al., Fundamentals of traffic simulation, volume 145, Springer, 2010.
[4] B. Chen, H. H. Cheng, A review of the applications of agent technology in traffic and
transportation systems, Intelligent Transportation Systems, IEEE Transaction on 11 (2010)
485–497.
[5] L. Weng, F. Menczer, Computational analysis of collective behaviors via agent-based
modeling, in: Handbook of Human Computation, Springer, 2013, pp. 761–767.
[6] M. N. Postorino, G. M. L. Sarné, Agents meet traffic simulation, control and management:
A review of selected recent contributions, in: Proceedings of the 17th Workshop “from
Objects to Agents”, WOA 2016, volume 1664 of CEUR Work. Proceedings, 2016, pp. 112–117.
[7] S. Abar, G. K. Theodoropoulos, P. Lemarinier, G. M. P. O’Hare, Agent based modelling
and simulation tools: A review of the state-of-art software, Computer Science Review 24
(2017) 13–33.
[8] G. S. Bhamra, A. K. Verma, R. B. Patel, Intelligent software agent technology: an overview,
International Journal of Computer Applications 89 (2014).
[9] D. Ye, M. Zhang, A. V. Vasilakos, A survey of self-organization mechanisms in multiagent
systems, IEEE Transaction on Systems, Man, and Cybernetics: Systems 47 (2016) 441–461.
[10] N. Naciri, M. Tkiouat, Multi-agent systems: theory and applications survey, International
Journal of Intelligent Systems Technologies and Applications 14 (2015) 145–167.
[11] K. Rajashekara, Q. Wang, K. Matsuse, Flying cars: Challenges and propulsion strategies,
IEEE Electrification Magazine 4 (2016) 46–57.
[12] B. Saeed, G. B. Gratton, An evaluation of the historical issues associated with achieving
non-helicopter v/stol capability and the search for the flying car, The Aeronautical Journal
114 (2010) 91–102.
[13] C. Lan, J. Roskam, Airplane Aerodynamics and Performances, DARcorporation , US, Kansas,
1997.
[14] J. Seddon, S. Newman, Basic helicopter aerodynamics, American Institute of Aeronautics
and Astronautics, 2001.
[15] D. McLean, Understanding aerodynamics: arguing from the real physics, John Wiley &
Sons, 2012.
11
Maria Nadia Postorino et al. 2–14
[16] S. Corda, Introduction to aerospace engineering with a flight test perspective, John Wiley
& Sons, 2017.
[17] ICAO, Rules of the Air, Annex 2 to the Convention on International Civil Aviation, 10th
Edition, July 2005, ICAO, 2005.
[18] M. Consiglio, S. Conway, C. Adams, H. Syed, Sats hvo procedures for priority landings
and mixed vfr/ifr operations, in: 24th Digital Avionics Systems Conference, volume 2,
IEEE, 2005, pp. 8–pp.
[19] W. Payre, J. Cestac, P. Delhomme, Intention to use a fully automated car: Attitudes and a
priori acceptability, Transportation research part F: traffic psychology and behaviour 27
(2014) 252–263.
[20] E. Dogan, M.-C. Rahal, R. Deborne, P. Delhomme, A. Kemeny, J. Perrin, Transition of
control in a partially automated vehicle: effects of anticipation and non-driving-related
task involvement, Transportation research part F: traffic psychology and behaviour 46
(2017) 205–215.
[21] O. S. Oubbati, A. Lakas, F. Zhou, G. Mesut, M. B. Yagoubi, A survey on position-based
routing protocols for flying ad hoc networks (fanets), Vehicular Communications 10 (2017)
29–56.
[22] M. N. Postorino, V. Barrile, F. Cotroneo, Surface movement ground control by means of a
gps–gis system, Journal of Air Transport Management 12 (2006) 375–381.
[23] M. N. Postorino, G. Musolino, P. Velonà, Evaluation of o/d trip matrices by traffic counts in
transit systems, in: Schedule-Based Dynamic Transit Modeling: Theory and applications,
Springer, 2004, pp. 197–216.
[24] M. N. Postorino, G. M. L. Sarné, Reinventing mobility paradigms: Flying car scenarios and
challenges for urban mobility, Sustainability 12 (2020) 3581.
[25] P. De Meo, F. Messina, M. N. Postorino, D. Rosaci, G. M. L. Sarné, A reputation framework to
share resources into iot-based environments, in: 2017 IEEE 14th International Conference
on Networking, Sensing and Control (ICNSC), IEEE, 2017, pp. 513–518.
[26] M. N. Postorino, G. M. L. Sarné, A preliminary study for an agent blockchain-based
framework supporting dynamic car-pooling, in: Proc. of 20th Workshop “from Objects to
Agents”(WOA 2019), volume 2404, CEUR Workshop Proceedings, 2019, pp. 65–70.
[27] H. Ortega-Arranz, D. R. Llanos, A. Gonzalez-Escribano, The shortest-path problem: Anal-
ysis and comparison of methods, Synthesis Lectures on Theoretical Computer Science 1
(2014) 1–87.
[28] Mechanical engineering site, http://www.mechanicalengineeringsite.com/
want-a-flying-car-here-it-is-the-pal-v-flying-car/#Technical_details, 2020.
[29] E. Cascetta, Transportation systems analysis: models and applications, volume 29, Springer
Science & Business Media, 2009.
[30] A. Krylatov, V. Zakharov, T. Tuovinen, Optimization models and methods for equilibrium
traffic assignment, Springer.
[31] J. Du, H. A. Rakha, A. Elbery, M. Klenk, Microscopic simulation and calibration of a
large-scale metropolitan network: Issues and proposed solutions, Technical Report, 2018.
[32] T. Jeerangsuwan, A. Kandil, Agent-based model architecture for mesoscopic traffic simula-
tions, Computing in Civil and Building Engineering (2014) 1246–1253.
[33] I. Caldas, J. Moreira, J. Rebelo, R. J. F. Rossetti, Exploring visualization metaphors in
12
Maria Nadia Postorino et al. 2–14
macroscopic traffic simulation, in: 2018 IEEE International Smart Cities Conference (ISC2),
IEEE, 2018, pp. 1–6.
[34] H. Hamidi, A. Kamankesh, An approach to intelligent traffic management system using a
multi-agent system, International Journal of Intelligent Transportation Systems Research
16 (2018) 112–124.
[35] J. Liu, X. Zhou, Capacitated transit service network design with boundedly rational agents,
Transportation Research Part B: Methodological 93 (2016) 225–250.
[36] E. Picasso, M. N. Postorino, G. M. L. Sarné, A study to promote car-sharing by adopting a
reputation system in a multi-agent context., in: Proceedings of the 18th Workshop “from
Objects to Agents”, WOA 2017, volume 1867 of CEUR Workshop Proceedings, 2017, pp.
13–18.
[37] I. Hussain, L. Knapen, A. Yasar, T. Bellemans, D. Janssens, G. Wets, Negotiation and
coordination in carpooling: An agent-based simulation model (2016).
[38] S. F. Smith, G. J. Barlow, X. F. Xie, Z. B. Rubinstein, Surtrac: scalable urban traffic control
(2013).
[39] C. Hofer, G. Jager, M. Fullsack, Large scale simulation of co2 emissions caused by urban
car traffic: an agent-based network approach, Journal of Cleaner Production 183 (2018)
1–10.
[40] S. Liu, S. Lo, J. Ma, W. Wang, An agent-based microscopic pedestrian flow simulation model
for pedestrian traffic problems, Intelligent Transportation Systems, IEEE Transaction on
15 (2014) 992–1001.
[41] M. N. Postorino, G. M. L. Sarné, A neural network hybrid recommender system, in:
Proceedings of the 2011 Conference on Neural Nets WIRN10, 2011, pp. 180–187.
[42] M. N. Postorino, G. M. L. Sarné, An agent-based sensor grid to monitor urban traffic, in:
Proceedings of the 15th Workshop “from Objects to Agents”, WOA 2014, volume 1260 of
CEUR Workshop Proceedings, 2014, pp. 1–6.
[43] A. L. C. Bazzan, F. Klugl, A review on agent-based technology for traffic and transportation,
The Knowledge Engineering Review 29 (2014) 375–403.
[44] G. O. Kagho, M. Balac, K. W. Axhausen, Agent-based models in transport planning: Current
state, issues, and expectations, Procedia Computer Science 170 (2020) 726–732.
[45] Y. Mualla, W. Bai, S. Galland, C. Nicolle, Comparison of agent-based simulation frameworks
for unmanned aerial transportation applications, Procedia computer science 130 (2018)
791–796.
[46] C. Bosson, T. A. Lauderdale, Simulation evaluations of an autonomous urban air mobility
network management and separation service, in: 2018 Aviation Technology, Integration,
and Operations Conference, 2018, p. 3365.
[47] G. Zhu, P. Wei, Pre-departure planning for urban air mobility flights with dynamic airspace
reservation, in: AIAA Aviation 2019 Forum, 2019, p. 3519.
[48] D. P. Thipphavong, R. Apaza, B. Barmore, V. Battiste, B. Burian, Q. Dao, M. Feary, S. Go,
K. H. Goodrich, J. Homola, et al., Urban air mobility airspace integration concepts and
considerations, in: 2018 Aviation Technology, Integration, and Operations Conference,
2018, p. 3676.
[49] X. Yang, P. Wei, Autonomous on-demand free flight operations in urban air mobility using
monte carlo tree search, in: International Conference on Research in Air Transportation
13
Maria Nadia Postorino et al. 2–14
14
Applying inferential processes to partner selection in
large agents communities
Pasquale De Meoa , Rino Falconeb and Alessandro Sapienzab
a
Department of Ancient and Modern Civilizations (University of Messina), Messina, 98122, Italy
b
Institute of cognitive sciences and technologies (ISTC-CNR), Rome, 00185, Italy
Abstract
The current literature clearly highlighted the need to define a fast and efficient tool for trust assessment,
even in lack of direct information, as much as possessing mechanisms allowing a matching between
a selected task and a reliable agent able to carry it out. Direct experience plays a big part, yet it
requires a long time to offer a stable and accurate performance and this characteristics may represents a
strong drawback especially within huge agents’ communities. We support the idea that category-based
evaluations and inferential processes represent a useful resource for trust assessment. Within this work,
we exploit simulations to investigate how efficient this inferential strategy is, with respect to direct
experience, focusing on when and to what extent the first prevails on the latter. Our results suggest that
in some situations categories represent a valuable asset, providing even better results.
Keywords
trust, inference, multi-agent systems
WOA 2020: Workshop “From Objects to Agents”, September 14–16, 2020, Bologna, Italy
" [email protected] (P. D. Meo); [email protected] (R. Falcone); [email protected] (A. Sapienza)
0000-0001-7421-216X (P. D. Meo); 0000-0002-0300-458X (R. Falcone); 0000-0001-9360-779X (A. Sapienza)
© 2020 Copyright for this paper by its authors. Use permitted under Creative Commons License Attribution 4.0 International (CC BY 4.0).
CEUR
Workshop
Proceedings
http://ceur-ws.org
ISSN 1613-0073
CEUR Workshop Proceedings (CEUR-WS.org)
15
Pasquale De Meo et al. 15–27
the goal 𝑔 by executing a task 𝜏 , which affects the world. The most interesting case occurs if
the agent 𝑎𝑖 want/must delegate the execution of 𝜏 .
At an abstract level, each agent possesses some skills and resources, defined here as features
which determine its ability in carrying out the tasks it has to face. Nevertheless, not all the
features associated with an agent are crucial for the execution of 𝜏 and the majority of these
will not even be necessary. If I were to ask someone to cook for me, it would be interesting to
know how fast she/he is, how good is her/his culinary imagination or if she/he knows how to
cook specific dishes; however, knowing that she/he loves reading astrophysics books would not
be of any help.
It is therefore a fundamental precondition that an agent 𝑎𝑖 identifies which features are
necessary to carry out 𝜏 . Then, 𝑎𝑖 needs a mental representation of any other 𝑎𝑗 , which
comprises, at least, the subset of the features which are relevant to execute 𝜏 . It is also important
to underline that just the possession of these features is not enough, it is also very relevant 𝑎𝑗 ’s
willingness (following its motivations) to actually realize 𝜏 . Of course, two different tasks, say
𝜏1 and 𝜏2 , require different features to be efficiently addressed.
Thanks to its mental model, 𝑎𝑖 is able to estimate the likelihood 𝜑(𝑖, 𝑗) that 𝑎𝑗 will positively
bring to completion that specific agreed task, for each agent 𝑎𝑗 ∈ 𝒜. The function 𝜑(𝑖, 𝑗)
measures the degree of trust [6] that 𝑎𝑖 (hereafter, the trustor) puts in 𝑎𝑗 (hereafter the trustee),
i.e., quantifies to what extent 𝑎𝑖 is confident that 𝑎𝑗 is capable of successfully executing 𝜏 .
It is crucial to point out that the assessment of trust is not only task-dependent but also
context-dependent, because external causes may amplify or downsize the trust between the
trustor and trustee. For instance, assume that 𝑎𝑖 wants to get to the airport one hour before
the departure of her/his flight and suppose that 𝑎𝑖 is confident that 𝑎𝑗 is able to safely drive
and she/he is knowledgeable of obstacles to traffic flow (e.g., limited access roads), and thus, 𝑎𝑖
puts a high degree of trust in 𝑎𝑗 . However, unforeseen circumstances (e.g., 𝑎𝑗 stucks in a traffic
jam) may prevent 𝑎𝑖 from being at the airport at the scheduled time: such an event negatively
influence the trust from 𝑎𝑖 to 𝑎𝑗 , even if, of course, the liability of 𝑎𝑗 is limited.
The procedure to select the agent to which the task 𝜏 has to be delegated is thus entirely driven
from the calculation of the function 𝜑(𝑖, 𝑗): the trustor should select the agent 𝑎⋆𝑗 for which
𝜑(𝑖, 𝑗) achieves its largest value, i.e., 𝑗 ⋆ = arg max𝑗 𝜑(𝑖, 𝑗). Such a protocol is, unfortunately,
infeasible in real-life applications: in fact, 𝑎𝑖 is capable of estimating the trust of those agents –
in short 𝐸𝑖 – with which it interacted in the past and of which it knows features. In real-life
applications, we expect that the size of 𝒜 is much larger than that of 𝐸𝑖 and, thus, the search of
a successful partner is likely to end up in a failure.
An elegant solution to the problem of selecting partners in large agent communities is
described in [7, 8] and it relies on the concept of agent category or, in short, category.
Broadly speaking, a category is a subset of agents in 𝒜 such that each category member
possesses homogeneous features. Their unique nature makes categories very interesting and
particularly useful. Since the members of a category possess similar features, even their perfor-
mance concerning the same task will be similar. For sure, we have to consider a certain degree
of uncertainty, due to the specific peculiarities of the individuals.
The specific categories to take into consideration change with the context and with the task
of interest. For instance, suppose that 𝒜 correspond to a community of people working in food
service with different roles; chefs, waiters, and sommeliers are possible examples of categories
16
Pasquale De Meo et al. 15–27
in this context.
Because of the existence of categories, the set of agents that the trustor can evaluate signifi-
cantly expands in size and it consists of the following type of agents:
1. The aforementioned set 𝐸𝑖 , which consists of the agents with which 𝑎𝑖 has had a direct
experience.
2. The set 𝐶𝑖 of agents, such that each agent 𝑎𝑗 ∈ 𝐶𝑖 belongs to at least one of the categories
𝐶𝑆 = {𝐶1 , 𝐶2 , . . . , 𝐶𝑝 }; here we suppose that 𝑎𝑖 has had a direct experience with at
least one agent in each of the categories in 𝐶𝑆.
3. The set of agents 𝑅𝑖 with which 𝑎𝑖 had no direct experience but which have been
recommended to 𝑎𝑖 by other agents in 𝒜 (for instance, on the basis of their reputation).
4. The set of agents 𝑅𝐶𝑖 , such that each agent in 𝑅𝐶𝑖 belongs to a category which contain
at least one agent in 𝑅𝑖 .
Advantages arising from the introduction of categories have been extensively studied in past
literature [9, 8, 7]: the trustor, in fact, could be able to estimate the performance of any other
agent 𝑎𝑗 , even if it has never met this agent (and, as observed in [7] without even suspecting its
existence), through an inferential mechanism.
As the authors of [9] say, it is possible to take advantage of categories just if a few conditions
are met. First of all, 𝒜 must be partitioned into the categories 𝒞 = {𝐶1 , 𝐶2 , . . . 𝐶𝑚 }, classifying
the agents according to their features. We assume that this classification is given and accepted
by all the agents in 𝒜. It must be possible to clearly and unequivocally link 𝑎𝑗 to a category 𝑐𝑙 .
Finally, we must somehow identify the average performance of the category 𝐶𝑙 with respect
to the task 𝜏 : we will discuss in detail in Section 3 a procedure to estimate the performance –
called true quality – 𝜃𝑙 (𝜏 ) of the category 𝐶𝑙 for task 𝜏 .
When all three of these conditions are met, then the category 𝐶𝑙 ’s evaluation can be used for
the agent 𝑎𝑗 , concerning the task 𝜏 since, by definition of category, all agents in 𝐶𝑙 will share
the same features of 𝑎𝑗 and, thus, if the other agents in 𝐶𝑙 are able to successfully execute the
task 𝜏 (or not), we can reasonably assume that even 𝑎𝑗 can do it (or not).
Of course, only some of the categories 𝐶1 , . . . , 𝐶𝑚 possess the qualities to successfully
execute the task 𝜏 while others do not. As a consequence, the first step to perform is to match
the task 𝜏 with a set of categories capable of executing 𝜏 .
At a basic level, such a matching could be implemented through a a function 𝜓(𝐶𝑙 , 𝜏 ) which
takes a category 𝐶𝑙 and a task 𝜏 and returns True if agents in 𝐶𝑙 are capable of executing
𝜏 , False vice versa. The computation of the function 𝜓 requires an analytical and explicit
specification of: (a) the chain of actions to perform to execute 𝜏 and (b) for each action mentioned
in (a), the features an agent should possess to perform such an action.
The protocol above easily generalizes to the case in which the trustor has a limited experience
(or, in the worst case it has no previous experience): in this case, in fact, the trustor 𝑎𝑖 could
leverage the sets of agents 𝑅𝑖 and 𝑅𝐶𝑖 .
2. Related Work
The growing need to deal with bigger and bigger agents’ networks makes it difficult to find
reliable partners to delegate tasks. It becomes clear that, in such situations, direct experience
17
Pasquale De Meo et al. 15–27
[10] is not enough to allow us facing this problem. Going beyond this dimension becomes
essential, on the light of the knowledge we already have, identifying models and methodologies
able to evaluate our interlocutors and possibly to select adequate partners for the collaborative
goals we want to pursue.
Several authors proposed trust propagation as a solution to this topic. Trust propagation
[11][12] starts from the assumption that if 𝑎𝑖 trusts 𝑎𝑗 and 𝑎𝑗 trusts 𝑎𝑘 , then it is reasonable
to assume that 𝑎𝑖 can trust 𝑎𝑘 to some extent. Exploiting this and other assumptions, this
technique allows propagating a trust value from an agent to another one, without requiring a
direct interaction. The confusion in the reasoning process here is due to the consideration of a
generic trust value for an individual, leaving aside the reason why we trust it: the task we want
to delegate to it.
Many articles have discussed the use of categories/stereotypes in trust evaluations [13][14].
This is a very useful instrument, allowing to generalize an individual’s evaluation, concerning
a specific task to other agents owning similar characteristics. It represents a useful proxy
for individuating knowledge about specific trustees [15], elicited in particular in all those
circumstances precluding the development of person-based trust [16]. Here the intuition is that,
given a specific task 𝜏 , the performance of the agent we are evaluating are related to the values
of the features it needs to carry out the task itself. Along these lines, it is natural to assume
that other individual owning similar values, i.e. belonging to the same category, have the same
potential to solve 𝜏 .
Pursuant to these considerations, our contribution within this work concerns the investigation
of how efficient this inferential strategy is, with respect to direct experience, focusing on when
and to what extent the first prevails on the latter.
18
Pasquale De Meo et al. 15–27
Based on these premises, the procedure to estimate 𝜃𝑙 (𝜏 ) is iterative and, at the 𝑘-th iteration
it works as follows:
a) We select, uniformly at random, an agent, say 𝑎𝑗 from 𝐶𝑙
b) We sample the performance 𝑓^ 𝑗 (𝑘) ∼ 𝑓𝑗 (𝜏 ) of 𝑎𝑗
Steps a) and b) are repeated 𝑁 times, being 𝑁 the number of agents we need to sample
before making a decision. In addition, in Step a), agents are sampled with replacement, i.e., an
agent could be selected more than once. The algorithm outputs the average value of sampled
performances, i.e.:
𝑁
∑︁
^𝜃𝑙 (𝜏 ) = 1 𝑓^ 𝑗 (𝑘) (1)
𝑁
𝑘=1
Our algorithm actually converges to the true value 𝜃𝑙 (𝜏 ) as stated in the following theorem:
Let 𝑁 be the number of agents queried by our algorithm and let ^𝜃𝑙 (𝜏 ) be the estimation of
the true quality 𝜃𝑙 (𝜏 ) the algorithm returns after 𝑁 rounds. We have that in both the fixed
variance and random variance models ^𝜃𝑙 (𝜏 ) converges to 𝜃𝑙 (𝜏 ) at a rate of convergence of √1𝑁 .
Let us first analyze the individual agent performances 𝑓𝑗 (𝜏 ) and we are interested in com-
puting the mean and variance of 𝑓𝑗 (𝜏 ). If we opt for the Fixed Variance Model, then 𝑓𝑗 (𝜏 ) is a
Gaussian random variable with mean 𝜃𝑙 (𝜏 ) and the variance is equal to a constant value 𝜎 2 .
In contrast, if we are in the Random Variance Model, then the estimation of the mean and the
variance of 𝑓𝑗 (𝜏 ) can be obtained by law of total mean and the law of total variance [17], which
state that for two arbitrary random variables 𝑋 and 𝑌 , the following identities hold true:
19
Pasquale De Meo et al. 15–27
𝛼+𝛽
E(Var(𝑓𝑗 (𝜏 ) | 𝜎 = 𝜎)) = E(𝜎) =
2
and
Var(E(𝑓𝑗 (𝜏 ) | 𝜎 = 𝜎)) = Var(E(𝜃𝑙 (𝜏 ))) = Var(𝜃𝑙 (𝜏 )) = 0
which jointly imply
𝛼+𝛽
Var(𝑓𝑗 (𝜏 )) =
2
As a consequence, independently of the agent 𝑎𝑗 , we have that the agent performances 𝑓𝑗 (𝜏 )
have the same distribution which we denote as 𝑓 (𝜏 ). Therefore, in both the Fixed Variance Model
and Random Variance Model, the algorithm selects a random sample of agents 𝑍1 , 𝑍2 , . . . , 𝑍𝑁
of size 𝑁 in which, for each 𝑘 such that 1 ≤ 𝑘 ≤ 𝑁 , 𝑍𝑘 is the average performance of the agent
selected at the 𝑘-th iteration and it is distributed as 𝑓 (𝜏 ). The algorithm calculates:
𝑍1 + 𝑍2 + . . . + 𝑍𝑛
𝑆𝑁 = (4)
𝑁
Because of the Central Limit Theorem [17], the distribution of 𝑆𝑁 gets closer and closer to a
Gaussian distribution with mean 𝜃𝑙 (𝜏 ) as 𝑁 → +∞ with a rate of convergence in the order of
√1 and this end the proof.
𝑁
4. Experimental Analysis
We designed our experiments to answer two main research questions, namely:
RQ1 What are the benefits arising from the introduction of categories in the selection of a
trustee against, for instance, a pure random search or a direct-experience based strategy?
RQ2 How quickly our algorithm to estimate 𝜃𝑙 (𝜏 ) converges?
In what follows, we first describe a reference scenario in which our task consists of recruiting
a chef from a database of applicants (see Section 4.1). Then, in Sections 4.2 and 4.3, we provide
an answer to RQ1 and RQ2 .
20
Pasquale De Meo et al. 15–27
Table 1
Some tasks associated with the recruitment of a professional chef and their requirements
Task Culinary Expertise Language Culture Creativity
Education Skills
𝜏1 150 5 2 6 7
𝜏2 200 4 2 6 6
𝜏3 300 4 2 7 6
Table 2
Some features associated with categories 𝐶1 - 𝐶5
Category ID. Culinary Expertise Language Culture Creativity
Education Skills
𝐶1 250 5 2 8 7
𝐶2 250 3 2 6 5
𝐶3 300 3 1 4 5
𝐶4 100 6 1 4 5
𝐶5 400 3 1 4 5
a scale from 0 (worse) to 10 (best) and which is understood as the ability of preparing different
kind dishes (e.g. fish, meat, vegetarian and so on) in different styles (e.g. Indian, Thai or Italian)
and (v) Creativity, measured on a scale from 0 (worse) to 10 (best). The list of features is, of
course, non-exhaustive. We suppose that each feature is associated with a plausible range: for
instance, in Table 1, we consider three potential tasks and the corresponding requirements.
In the following, due to space limitations, we concentrate only on the task 𝜏1 and we suppose
that five categories exist, namely: Professional Chefs - 𝐶1 , who are trained to master culinary art.
Members in 𝐶1 are able to provide creative innovation in menu, preparation and presentation,
Vegan Chefs - 𝐶2 , specialized in the preparation of plant-based dishes, Pastry Chefs - 𝐶3 , who are
capable of creating chocolates and pastries, Roast Chefs - 𝐶4 , who have expertise in preparing
roasted/braised meats and Fish Chefs - 𝐶5 , who are mainly specialized in the preparation of dish
fishes. Each category consists of 100 agents and, thus, the overall number of agents involved in
our experiments is 500. Features associated with categories 𝐶1 -𝐶5 are reported in Table 2.
In our scenario, only agents in 𝐶1 are able to fulfill 𝜏1 ; agents in other categories are, for
different reasons, unable to execute 𝜏1 : for instance, the expertise of agents in categories 𝐶2 , 𝐶3
and 𝐶5 is not sufficient while agents forming categories 𝐶3 -𝐶5 correspond to applicants with a
high level of specialization in the preparation of some specific kind of dishes (e.g., fish-based
dishes) but they are not sufficiently skilled in the preparation of other type of foods and, thus,
agents in these categories showcase an insufficient level of culture.
To simplify discussion we suppose that, through a proper normalization, the performance
𝑓 (𝜏1 ) (see Section 3) of an individual agent as well as the true quality 𝜃𝑙 (𝜏1 ) of a category 𝐶𝑙
(for l = 1 . . . 5) range from 0 to 1. Here, the best performance of an agent can provide (resp., the
highest true quality of a category) is 1.
21
Pasquale De Meo et al. 15–27
Figure 1: Feedback 𝑓 (𝜏 ) provided by the trustee. Fixed Variance Model with 𝜎 = 0.05
22
Pasquale De Meo et al. 15–27
Figure 2: Feedback 𝑓 (𝜏 ) provided by the trustee. Fixed Variance Model with 𝜎 = 0.15
23
Pasquale De Meo et al. 15–27
Figure 3: Probability Density Function of the Warm-up length (ℓ) in the Mixed-Search strategy. Fixed
Variance Model with 𝜎 = 0.05
Figure 4: Probability Density Function of the Warm-up length (ℓ) in the Mixed-Search strategy. Fixed
Variance Model with 𝜎 = 0.15
Here, the variance 𝜎 has a minor impact and we notice that, the pdf achieves its largest value
at ℓ ≃ 10, i.e., 10 iterations are generally sufficient to identify the best performing category.
24
Pasquale De Meo et al. 15–27
1. Individual agent variability (modelled through the parameter 𝜎) greatly affects the rate at
which ^𝜃𝑙 (𝜏 ) converges to 𝜃𝑙 (𝜏 ). Specifically, Figure 5 suggests that less than 5 iterations
are enough to guarantee that |𝜃^𝑙 (𝜏 ) − 𝜃𝑙 (𝜏 )| < 10−2 if 𝜎 = 0.05. In addition, as 𝜎
gets larger and larger, we highlight more and more fluctuations in ^𝜃𝑙 (𝜏 ): as an example,
if 𝜎 = 0.15 (green line), we highlight the largest fluctuation in ^𝜃𝑙 (𝜏 ) and, at a visual
inspection, at least 𝑁 = 30 queries are needed to achieve a significant reduction in
|𝜃^𝑙 (𝜏 ) − 𝜃𝑙 (𝜏 )|.
2. An interesting case occurs in the Random Variance Model: in some iterations of the
algorithm, agents with a small variability are selected (i.e., we would sample agents with
𝜎 ≃ 0.01) while in other cases agent with a larger variability are selected (here 𝜎 ≃ 0.3).
Overall, agents with small variability fully balance agents with high variability and, thus,
the algorithm converges to 𝜃𝑙 (𝜏 ) (red line) generally faster than the case 𝜎 = 0.1 (orange
line) and 𝜎 = 0.15 (green line).
5. Conclusions
Although highly populated networks are a particularly useful environment for agents’ collabo-
ration, the very nature of these networks may represent a drawback for trust formation, given
the lack of data for evaluating the huge number of possible partners. Many contributions in the
literature [8, 18] showed that category-based evaluations and inferential processes represent a
remarkable solution for trust assessment, since they allow agents to generalize from trust in
individuals to trust in their category and vice versa, basing on their observable features. On that
note, we cared about stressing the tight relationship between trust and the specific task, target
of the trust itself. With the purpose of investigating the role of agents’ categories, we considered
a simulated scenario, testing in particular the performance of a category-based evaluation, with
respect to a random-based search - which it is easily outperformed - and a direct-experience
one, showing that, in case of little direct experience, categories grant a better result. Moreover,
we proved that, if not available, it is possible to estimate the category’s true quality 𝜃𝑙 (𝜏 ) in a
25
Pasquale De Meo et al. 15–27
reasonably short amount of time. Future research will attempt to test these findings on a real
data set.
References
[1] J. Yan, D. Wu, S. Sanyal, R. Wang, Trust-oriented partner selection in d2d cooperative
communications, IEEE Access 5 (2017) 3444–3453.
[2] F. Messina, G. Pappalardo, C. Santoro, D. Rosaci, G. M. Sarné, A multi-agent protocol for
service level agreement negotiation in cloud federations, International Journal of Grid
and Utility Computing 7 (2016) 101–112.
[3] F. Messina, G. Pappalardo, D. Rosaci, G. M. Sarné, A trust-based, multi-agent architecture
supporting inter-cloud vm migration in iaas federations, in: International Conference on
Internet and Distributed Computing Systems, Springer, 2014, pp. 74–83.
[4] A. Sapienza, R. Falcone, Evaluating agents’ trustworthiness within virtual societies in case
of no direct experience, Cognitive Systems Research 64 (2020) 164–173.
[5] S. Abar, G. K. Theodoropoulos, P. Lemarinier, G. M. O’Hare, Agent based modelling and
simulation tools: A review of the state-of-art software, Computer Science Review 24 (2017)
13–33.
[6] C. Castelfranchi, R. Falcone, Trust theory: A socio-cognitive and computational model,
volume 18, John Wiley & Sons, 2010.
[7] R. Falcone, A. Sapienza, Selecting trustworthy partners by the means of untrustworthy
recommenders in digitally empowered societies, in: Proc. of the International Conference
on Practical Applications of Agents and Multi-Agent Systems, Springer, Avila, Spain, 2019,
pp. 55–65.
[8] R. Falcone, A. Sapienza, C. Castelfranchi, The relevance of categories for trusting informa-
tion sources, ACM Transactions on Internet Technology (TOIT) 15 (2015) 13.
[9] R. Falcone, M. Piunti, M. Venanzi, C. Castelfranchi, From manifesta to krypta: The
relevance of categories for trusting others, ACM Transactions on Intelligent Systems and
Technology (TIST) 4 (2013) 27.
[10] C.-W. Hang, Y. Wang, M. P. Singh, Operators for propagating trust and their evaluation in
social networks, Technical Report, North Carolina State University. Dept. of Computer
Science, 2008.
[11] R. Guha, R. Kumar, P. Raghavan, A. Tomkins, Propagation of trust and distrust, in:
Proceedings of the 13th international conference on World Wide Web, 2004, pp. 403–412.
[12] M. Jamali, M. Ester, A matrix factorization technique with trust propagation for recommen-
dation in social networks, in: Proceedings of the fourth ACM conference on Recommender
systems, 2010, pp. 135–142.
[13] W. L. Teacy, M. Luck, A. Rogers, N. R. Jennings, An efficient and versatile approach to trust
and reputation using hierarchical bayesian modelling, Artificial Intelligence 193 (2012)
149–185.
[14] H. Fang, J. Zhang, M. Sensoy, N. M. Thalmann, A generalized stereotypical trust model,
in: 2012 IEEE 11th International Conference on Trust, Security and Privacy in Computing
and Communications, IEEE, 2012, pp. 698–705.
26
Pasquale De Meo et al. 15–27
[15] R. M. Kramer, Collective trust within organizations: Conceptual foundations and empirical
insights, Corporate Reputation Review 13 (2010) 82–97.
[16] B. D. Adams, R. D. Webb, Trust in small military teams, in: 7th international command
and control technology symposium, 2002, pp. 1–20.
[17] D. Bertsekas, J. Tsitsiklis, Introduction to probability, Athena Scientific, 2008.
[18] R. Falcone, A. Sapienza, C. Castelfranchi, Trusting information sources through their
categories, in: International Conference on Practical Applications of Agents and Multi-
Agent Systems, Springer, 2015, pp. 80–92.
27
A preliminary experimentation for large scale
epidemic forecasting simulations
Gianfranco Lombardo, Agostino Poggi
Dipartimento di Ingegneria e Architettura, Università di Parma - Parma, Italy
Abstract
Agent-based modeling and simulation are some powerful techniques that are widely used with success
for analyzing complex and emergent phenomena in many research and application areas. Many different
reasons are behind the success of such techniques, among which an important mention goes to the
availability of a great variety of software tools, that ease the development of models, as well as the
execution of simulations and the analysis of results. This paper presents an actor software library, called
ActoDeS, for the development of concurrent and distributed systems, and shows how it can be a suitable
mean for building flexible and scalable epidemic forecasting simulations. In particular, the paper presents
the first results of the experimentation of ActoDeS for defining a COVID-19 epidemic diffusion model
and for supporting the simulation in large populations.
Keywords
actor model, epidemic diffusion model, COVID-19, distributed simulation, HPC
1. Introduction
Agent-based modeling and simulation (ABMS) has been and is widely used with success for
studying complex and emergent phenomena in many research and application areas, including
agriculture, biomedical analysis, ecology, engineering, sociology, market analysis, artificial
life, social studies, and others fields. Such studies are possible thanks to the availability of
several tools and libraries that support the development of ABMS applications. Moreover, the
availability of large-scale, dynamic, and heterogeneous networks of computational resources
and the advent of multi-cores computers allow the development of high performance and
scalable computationally intensive ABMS applications. As a matter of fact, such applications
are able to manage very large and dynamic models, whose computational needs (in space and
time) can be difficult to satisfy by a single machine.
The success and the diffusion of ABMS techniques is also due to the availability of software
tools that ease the development of models, the execution of simulations and the analysis of
results (see, for example, Mason [1], NetLogo [2], and Repast [3]). However, all the most known
and used ABMS tools have been initially designed for the execution of simulations on a single
machine and, only in a second step, they were extended for supporting distributed simulations
(see, for example, D-Mason [4] and HLA_ACTOR_REPAST [5]). It is worth noting that such
WOA 2020: Workshop “From Objects to Agents”, September 14–16, 2020, Bologna, Italy
" [email protected] (G. Lombardo); [email protected] (A. Poggi)
0000-0003-1808-4487 (G. Lombardo); 0000-0003-3528-0260 (A. Poggi)
© 2020 Copyright for this paper by its authors. Use permitted under Creative Commons License Attribution 4.0 International (CC BY 4.0).
CEUR
Workshop
Proceedings
http://ceur-ws.org
ISSN 1613-0073
CEUR Workshop Proceedings (CEUR-WS.org)
28
Gianfranco Lombardo et al. 28–36
extensions show a limitation in terms of reusability. In fact, the code of agents defined for a
standalone execution must be modified in order to gain suitable implementations to be used in
a distributed simulation.
In this paper we present an actor based software library, called ActoDeS, that provides the
suitable features for simplifying the development of scalable and efficient agent based models and
simulations. The next section introduces the actor model and discusses the advantages of using
actors in ABMS applications. Section 3 introduces ActoDeS. Section 4 shows the advantages of
using this software library for ABMS applications. Section 5 presents the COVID-19 diffusion
model that is used in the simulations. Section 6 presents the results of the experimentation on
the population of Bergamo province. Section 7 introduces the work necessary to extend the
simulation to all the population of Lombardia region. Finally, section 8 concludes the paper by
discussing its main features and the directions for future work.
29
Gianfranco Lombardo et al. 28–36
3. ActoDeS
ActoDeS is an actor-based software framework that has the goal of both simplifying the devel-
opment of concurrent and distributed complex systems and guarantying an efficient execution
of applications [10]. ActoDeS is implemented by using the Java language and is an evolution
of CoDE [11] that simplifies the definition of actor behaviors and provides more scalable and
performant implementations. Moreover, it takes advantages of some implementation solutions
used in JADE [12],[13],[14] for the definition of some internal components. In particular, it has
been used for the development of data analysis tools [15] and their use for the analysis of social
networks data [16],[17],[18],[19].
ActoDeS has a layered architecture composed of an application and a runtime layer. The
application layer provides the software components that an application developer needs to
extend or directly use for implementing the specific actors of an application. The runtime layer
provides the software components that implement the ActoDeS middleware infrastructures to
support the development of standalone and distributed applications.
In ActoDeS an application is based on a set of interacting actors that perform tasks concur-
rently and interact with each other by exchanging asynchronous messages. Moreover, it can
create new actors, update its local state, change its behavior and kill itself.
Depending on the complexity of the application and on the availability of computing and
communication resources, one or more actor spaces can manage the actors of the application.
An actor space acts as “container” for a set of actors and provides them the services necessary
for their execution. An actor space contains a set of actors (application actors) that perform
the specific tasks of the current application and two actors (runtime actors) that support the
execution of the application actors. These two last actors are called executor and the service
provider. The executor manages the concurrent execution of the actors of the actor space. The
service provider enables the actors of an application to perform new kinds of action (e.g., to
broadcast a message or to move from an actor space to another one).
Communication between actors is buffered: incoming messages are stored in a mailbox until
the actor is ready to process them; moreover, an actor can set a timeout for waiting for a new
message and then can execute some actions if the timeout fires. Each actor has a system-wide
unique identifier called reference that allows it to be reached in a location transparent way
independently of the location of the sender (i.e., their location can be the same or different). An
actor can send messages only to the actors of which it knows the reference, that is, the actors it
created and of which it received the references from other actors. After its creation, an actor
can change several times its behavior until it kills itself. Each behavior has the main duty of
processing a set of specific messages through a set of message handlers called cases. Therefore,
if an unexpected message arrives, then the actor mailbox maintains it until a next behavior will
be able to process it.
30
Gianfranco Lombardo et al. 28–36
An actor can be viewed as a logical thread that implements an event loop [20],[21]. This
event loop perpetually processes incoming messages. In fact, when an actor receives a message,
then it looks for the suitable message handler for its processing and, if it exists, it processes
the message. The execution of the message handler is also the means for changing its way of
acting. In fact, the actor uses the return value of its message handlers for deciding to remain in
the current behavior, to move to a new behavior or to kill itself. Moreover, an actor can set a
timeout within receiving a new message and set a message handler for managing the firing of
the timeout. This message handler is bound to the reception of the message notifying the firing
of the timeout, and so the management of the timeout firing is automatically performed at the
reception of such notification message.
ActoDeS supports the configuration of applications with different actor, scheduler ad service
provider implementations. The type of the implementation of an actor is one of the factors
that mainly influence the attributes of the execution of an application. In particular, actor
implementations can be divided in two classes that allow to an actor either to have its own
thread (from here named active actors) or to share a single thread with the other actors of the
actor space (from here named passive actors). Moreover, the duties of a scheduler depend on
the type of the actor implementation. Of course, a scheduler for passive actors is different from
a scheduler for active actors, but for the same kind of actor can be useful to have different
scheduler implementations. For example, it can allow the implementation of “cooperative”
schedulers in which actors can cyclically perform tasks whose duties vary from the processing
of the first message in the buffer to the processing of all the messages in it.
The most important decision that influences the quality of the execution of an application is
the choice of the actor and scheduler implementations. In fact, the use of one or another couple
of actor and scheduler causes large differences in the performance and in the scalability of the
applications [22].
31
Gianfranco Lombardo et al. 28–36
4.1. Distribution
The modeling and simulation of complex problems can require the use of large number of agents
that may determinate unacceptable simulation times, or the impossibility to run the simulation
on a single computational node. In such cases, the availability of distributed algorithms and,
of course, of an adequate number of computational nodes can help to perform simulations,
partitioning the agents among the available computational nodes. Moreover, depending of kind
of application, agents may need to communicate with some agents running on different compu-
tational nodes. In this case, the execution of the computational nodes must be synchronized to
guaranty the processing of the messages in the correct order.
Therefore, a distributed simulation involves a set of computational nodes whose execution is
driven by a set of schedulers and managers. In particular, each manager has the duty of creating
the subset of agents of its computational node and synchronize the execution of the simulation
with the execution of the other computational nodes. Moreover, one of such managers assumes
the role of “master” and has the duties of partitioning the agents involved in the simulation and
sends the information necessary for the creation of the agents to the other managers.
In particular, the execution of a distributed simulation can be described by the following
steps:
1. Master manager partitions the agents and sends the information for creating a subset of
agents to each scheduler (including itself).
2. Managers create all the actors of its subset.
3. Repeat until the end of the simulation:
• Managers send a synchronization message to the other managers and wait for the
corresponding messages from them.
• Schedulers perform an execution step of all their actors.
• Scheduler send a “end step” message to all their actors and managers.
4.2. Communication
As introduced above, in different kinds of simulations the agents need to exchange data and often
such an interaction is not localized, therefore, the partition of agents on several computational
nodes may add an important communication cost. An important solution to reduce the cost
of communication is to reduce the frequency of interactions, merging multiple interactions to
one. In a conservative distributed simulation system, that synchronizes the simulation step of
all the computational nodes involved in the simulation, a possible solution is to group all the
messages directed to the agents of a specific computational node into the message that identifies
the successive synchronization message.
32
Gianfranco Lombardo et al. 28–36
aim of our work is the definition of a model that allows to identify exactly how many people had
actually contracted the COVID-19 virus at the beginning of the pandemic and try to simulate
the real evolutionary trend of the spread of the virus that has produced such a large number of
people positive for the virus. The first experimentation involved the Bergamo province, but our
final goal is to simulate the propagation in the Lombardia region.
The basic idea was to model people based on their social interactions, which can vary from
person to person, estimated interactions with a particular rate. In our first model, people were
identified on the basis of an interaction rate (high, medium and low) and in a random way these
people came into contact, creating a network of interactions.
At the beginning, all the people are in a susceptible phase, in this phase each person can be
infected by an infected person. When a person is infected, she/he passes from a susceptibility
phase to an incubation phase; here she/he remains there for a certain period of time and then
passes to another phase in which he is infectious. When a person is in this phase he could
infect other people. Once this last phase is over, the infected changes to be positive. After a
certain period of time, the person changes phase: heals or dies. When a person heals, she/he
can no longer be infected. Moreover, the incubation phase is made to last from 7 to 14 days,
that infectious from 3 to 7 and that of positivity from 14 to 30.
In our model, each person is defined by the following attributes:
• Id of the person
• Province of belonging
• Degree of interaction
• Number of people met
• Current phase
• Id of the people met
This model was used for simulating the COVID-19 propagation from January 30, 2020 to
March 31, 2020. Of course, the interaction frequency varies for all the people during the
simulation because some people become positive at the end of the phase in which they are
infectious; therefore, their interactions should collapse enough sudden because they should
stay in quarantine. Moreover, from March 8, 2020, people reduced their interaction frequency
because of the lockdown rules.
33
Gianfranco Lombardo et al. 28–36
Table 1
Positives numbers for different infection parameters.
March 8,2020
Infection value 0.3 0.4 0.5 0.7 1 Real positives
Positives number 563 674 715 906 1297 997
March 31,2020
Infection value 0.3 0.4 0.5 0.7 1 Real positives
Positives number 8307 15127 22025 43304 89274 8803
such parameter value is not good for the lookdown period and so a quite good number of
positives was obtained fixing the infection parameter at 0.3. In this case, average number of
positives obtained by ten simulations was 8370. Table 1 shows the positives number in the
two “key” dates for different infection parameters and compares them with the real number of
positives.
34
Gianfranco Lombardo et al. 28–36
8. Conclusions
This paper presented ActoDeS, an actor software library for the development of concurrent
and distributed systems, and shows how it can be a suitable mean for building flexible and
scalable epidemic forecasting simulations. In particular, the paper presented the first results of
the experimentation of ActoDeS for forecasting COVID-19 epidemic diffusion in the Bergamo
province and introduced the first work for defining a scalable distributed system able to forecast
COVID-19 epidemic diffusion for all the population of Lombardia region. Our current and future
work will be dedicated to complete the design and the implementation of such a distributed
system, to experiment different communication solutions for the updating of the contacts of
each person, and finally, the definition of more accurate person model that replaces the use of
the simple interaction frequency to create new contacts, with the use of the person age and the
work sector.
References
[1] S. Luke, C. Cioffi-Revilla, L. Panait, K. Sullivan, G. Balan, Mason: A multiagent simulation
environment, Simulation 81 (2005) 517–527.
[2] S. Tisue, U. Wilensky, Netlogo: A simple environment for modeling complexity, in:
International conference on complex systems, volume 21, Boston, MA, 2004, pp. 16–21.
[3] M. J. North, N. T. Collier, J. R. Vos, Experiences creating three implementations of the
repast agent modeling toolkit, ACM Transactions on Modeling and Computer Simulation
(TOMACS) 16 (2006) 1–25.
[4] G. Cordasco, R. De Chiara, A. Mancuso, D. Mazzeo, V. Scarano, C. Spagnuolo, Bringing
together efficiency and effectiveness in distributed simulations: the experience with d-
mason, Simulation 89 (2013) 1236–1253.
[5] F. Cicirelli, A. Furfaro, A. Giordano, L. Nigro, Hla_actor_repast: An approach to distributing
repast models for high-performance simulations, Simulation Modelling Practice and
Theory 19 (2011) 283–300.
[6] G. A. Agha, Actors: A model of concurrent computation in distributed systems., Technical
Report, Massachusetts Inst of Tech Cambridge Artificial Intelligence Lab, 1985.
[7] D. Kafura, J.-P. Briot, Actors and agents, IEEE concurrency (1998) 24–28.
[8] M.-W. Jang, G. Agha, Agent framework services to reduce agent communication overhead
in large-scale agent-based simulations, Simulation Modelling Practice and Theory 14
(2006) 679–694.
[9] J. de Berardinis, G. Forcina, A. Jafari, M. Sirjani, Actor-based macroscopic modeling
and simulation for smart urban planning, Science of Computer Programming 168 (2018)
142–164.
[10] F. Bergenti, E. Iotti, A. Poggi, M. Tomaiuolo, Concurrent and distributed applications with
actodes, in: MATEC Web of Conferences, volume 76, EDP Sciences, 2016, p. 04043.
[11] F. Bergenti, A. Poggi, M. Tomaiuolo, An actor based software framework for scalable
applications, in: International Conference on Internet and Distributed Computing Systems,
Springer, 2014, pp. 26–35.
35
Gianfranco Lombardo et al. 28–36
[12] A. Negri, A. Poggi, M. Tomaiuolo, P. Turci, Dynamic grid tasks composition and distribution
through agents, Concurrency and Computation: Practice and Experience 18 (2006) 875–885.
[13] G. Adorni, F. Bergenti, A. Poggi, G. Rimassa, Enabling fipa agents on small devices, in:
International Workshop on Cooperative Information Agents, Springer, 2001, pp. 248–257.
[14] A. Poggi, M. Tomaiuolo, G. Vitaglione, A security infrastructure for trust management in
multi-agent systems, in: Trusting Agents for Trusting Electronic Societies, Springer, 2004,
pp. 162–179.
[15] G. Lombardo, P. Fornacciari, M. Mordonini, M. Tomaiuolo, A. Poggi, A multi-agent
architecture for data analysis, Future Internet 11 (2019) 49.
[16] F. Bergenti, E. Franchi, A. Poggi, Agent-based social networks for enterprise collaboration,
in: 2011 IEEE 20th International Workshops on Enabling Technologies: Infrastructure for
Collaborative Enterprises, IEEE, 2011, pp. 25–28.
[17] G. Lombardo, P. Fornacciari, M. Mordonini, L. Sani, M. Tomaiuolo, A combined approach for
the analysis of support groups on facebook-the case of patients of hidradenitis suppurativa,
Multimedia Tools and Applications 78 (2019) 3321–3339.
[18] G. Lombardo, A. Ferrari, P. Fornacciari, M. Mordonini, L. Sani, M. Tomaiuolo, Dynamics
of emotions and relations in a facebook group of patients with hidradenitis suppurativa,
in: International Conference on Smart Objects and Technologies for Social Good, Springer,
2017, pp. 269–278.
[19] M. Tomaiuolo, G. Lombardo, M. Mordonini, S. Cagnoni, A. Poggi, A survey on troll
detection, Future Internet 12 (2020) 31.
[20] J. Dedecker, T. Van Cutsem, S. Mostinckx, T. D’Hondt, W. De Meuter, Ambient-oriented
programming in ambienttalk, in: European Conference on Object-Oriented Programming,
Springer, 2006, pp. 230–254.
[21] M. S. Miller, E. D. Tribble, J. Shapiro, Concurrency among strangers, in: International
Symposium on Trustworthy Global Computing, Springer, 2005, pp. 195–229.
[22] A. Poggi, Agent based modeling and simulation with actomos., in: WOA, 2015, pp. 91–96.
[23] P. Mathieu, Y. Secq, et al., Environment updating and agent scheduling policies in agent-
based simulators., in: ICAART (2), 2012, pp. 170–175.
[24] M. Ajelli, B. Gonçalves, D. Balcan, V. Colizza, H. Hu, J. J. Ramasco, S. Merler, A. Vespignani,
Comparing large-scale computational approaches to epidemic modeling: agent-based
versus structured metapopulation models, BMC infectious diseases 10 (2010) 190.
[25] D. Chumachenko, V. Dobriak, M. Mazorchuk, I. Meniailov, K. Bazilevych, On agent-based
approach to influenza and acute respiratory virus infection simulation, in: 2018 14th
International Conference on Advanced Trends in Radioelecrtronics, Telecommunications
and Computer Engineering (TCSET), IEEE, 2018, pp. 192–195.
[26] M. Gatto, E. Bertuzzo, L. Mari, S. Miccoli, L. Carraro, R. Casagrandi, A. Rinaldo, Spread and
dynamics of the covid-19 epidemic in italy: Effects of emergency containment measures,
Proceedings of the National Academy of Sciences 117 (2020) 10484–10491.
36
Session 2
Organisations, Norms & Argumentation
A Multiagent Framework for Coordinating Industrial
Symbiotic Networks
Vahid Yazdanpanaha , Devrim M. Yazanb and W. Henk M. Zijmb
a
Agents, Interaction and Complexity (AIC) Research Group, School of Electronics and Computer Science, University of
Southampton, Southampton, SO17 1BJ, United Kingdom
b
Department Industrial Engineering and Business Information Systems, Faculty of Behavioural, Management and Social
Sciences, University of Twente, Enschede, 7500 AE, The Netherlands
Abstract
We present a formal multiagent framework for coordinating a class of collaborative industrial practices
called “Industrial Symbiotic Networks (ISNs)” as cooperative games. The game-theoretic formulation of
ISNs enables systematic reasoning about what we call the ISN implementation problem. Specifically,
the characteristics of ISNs may lead to the inapplicability of standard fair and stable benefit allocation
methods. Inspired by realistic ISN scenarios and following the literature on normative multiagent
systems, we consider regulations and normative socio-economic policies as coordination instruments that
in combination with ISN games resolve the situation. In this multiagent system, employing Marginal
Contribution Nets (MC-Nets) as rule-based cooperative game representations foster the combination
of regulations and ISN games with no loss in expressiveness. We develop algorithmic methods for
generating regulations that ensure the implementability of ISNs and as a policy support, present the
policy requirements that guarantee the implementability of desired ISNs in a balanced-budget way.
Keywords
Multiagent Systems, Agent-Oriented Coordination, Normative Methods, Industrial Symbiosis
1. Introduction
Industrial Symbiotic Networks (ISNs) are circular economic networks of industries with the
aim to reduce the use of virgin material by circulating reusable resources (e.g., physical waste
material and energy) among the network members [1, 2, 3]. In such networks, symbiosis leads
to socio-economic and environmental benefits for involved industrial agents and the society
(see [4, 5]). One barrier against stable ISN implementations is the lack of frameworks able
to secure such networks against unfair and unstable allocation of obtainable benefits among
the involved industrial firms. In other words, although in general ISNs result in the reduction
of the total cost, a remaining challenge for operationalization of ISNs is to tailor reasonable
mechanisms for allocating the total obtainable cost reductions—in a fair and stable manner—
among the contributing firms. Otherwise, even if economic benefits are foreseeable, lack of
WOA 2020: Workshop “From Objects to Agents”, September 14–16, 2020, Bologna, Italy
" [email protected] (V. Yazdanpanah); [email protected] (D. M. Yazan); [email protected]
(W. H. M. Zijm)
~ https://www.ecs.soton.ac.uk/people/vy1y20 (V. Yazdanpanah); https://people.utwente.nl/d.m.yazan
(D. M. Yazan); https://www.utwente.nl/en/bms/iebis/staff/former/zijm (W. H. M. Zijm)
0000-0002-4468-6193 (V. Yazdanpanah); 0000-0002-4341-2529 (D. M. Yazan); 0000-0002-4227-2624 (W. H. M. Zijm)
© 2020 Copyright for this paper by its authors.
Use permitted under Creative Commons License Attribution 4.0 International (CC BY 4.0).
CEUR
Workshop
Proceedings
http://ceur-ws.org
ISSN 1613-0073
CEUR Workshop Proceedings (CEUR-WS.org)
38
Vahid Yazdanpanah et al. 38–53
stability and/or fairness may lead to non-cooperative decisions. This will be the main focus of
what we call the industrial symbiosis implementation problem. Reviewing recent contributions
in the field of industrial symbiosis research, we encounter studies focusing on the necessity to
consider interrelations between industrial enterprises [6, 2] and the role of contract settings
in the process of ISN implementation [7, 8]. We believe that a missed element for shifting
from theoretical ISN design to practical ISN implementation is to model, reason about, and
support ISN decision processes in a dynamic way (and not by using case-specific snapshot-based
modeling frameworks).
For such a multiagent setting, the mature field of cooperative game theory provides rigorous
methodologies and established solution concepts, e.g. the core of the game and the Shapley
allocation [9]. However, for ISNs modeled as a cooperative game, these established solution
concepts may be either non-feasible (due to properties of the game, e.g. being unbalanced) or
non-applicable (due to properties that the industrial domain asks for but solution concepts cannot
ensure, e.g. individual as well as collective rationality). This calls for contextualized multiagent
solutions that take into account both the complexities of ISNs and the characteristics of the
employable game-theoretical solution concepts. Accordingly, inspired by realistic ISN scenarios
and following the literature on normative multiagent systems [10, 11, 12], we consider regulative
rules and normative socio-economic policies as two elements that in combination with ISN
games result in the introduction of the novel concept of Coordinated ISNs (𝒞−ISNs). We formally
present regulations as monetary incentive rules to enforce desired industrial collaborations with
respect to an established policy. Regarding our representational approach, we use Marginal
Contribution Nets (MC-Nets) as rule-based cooperative game representations. This simply
fosters the combination of regulative rules and ISN games with no loss in expressiveness.
Accordingly, applying regulatory rules to ISNs enables ISN policy-makers to transform ISN
games and ensure the implementability of desired ones in a fair and stable manner.
For the first time, this work provides a multiagent framework—using MC-net cooperative
games—for the implementation phase of ISNs.1 We develop algorithmic methods for generating
regulations that ensure the implementability of ISNs (methodological contribution) and as a
policy support, present the ISN policy requirements (practical contribution) that guarantee the
implementability of all the desired industrial collaborations in a balanced-budget way.
39
Vahid Yazdanpanah et al. 38–53
purchasing cost (on the resource receiver side). On the other hand, the implementation of such
an industrial network involves transportation, treatment, and transaction costs. In principle,
aggregating resource treatment processes using refineries, combining transaction costs, and
coordinating joint transportation may lead to significant cost reductions at the collective level.
What we call the industrial symbiosis implementation problem focuses on challenges—and
accordingly seeks solutions—for sharing this collectively obtainable benefit among the involved
firms. Simply stated, the applied method for distributing the total obtainable benefit among
involved agents is crucial while reasoning about implementing an ISN. Imagine a scenario
in which symbiotic relations 𝑖𝑗, 𝑖𝑘, and 𝑗𝑘, respectively result in 4, 5, and 4 utility units of
benefit, the symbiotic network 𝑖𝑗𝑘 leads to 6 units of benefit, and each agent can be involved
in at most one symbiotic relation. To implement the 𝑖𝑗𝑘 ISN, one main question is about the
method for distributing the benefit value 6 among the three agents such that they all be induced
to implement this ISN. For instance, as 𝑖 and 𝑘 can obtain 5 utils together, they will defect
the ISN 𝑖𝑗𝑘 if we divide the 6 units of util equally (2 utils to each agent). Note that allocating
benefit values lower than their “traditional" benefits—that is obtainable in case firms defect
the collaboration—results in unstable ISNs. Moreover, unfair mechanisms that disregard the
contribution of firms may cause the firms to move to other ISNs that do so. In brief, even
if an ISN results in sufficient cost reductions (at the collective level), its implementation and
applied allocation methods determine whether it will be realized and maintained. Our main
objective in this work is to provide a multiagent implementation framework for ISNs that enables
fair and stable allocation of obtainable benefits. In further sections, we review two standard
allocation methods, discuss their applicability for benefit-sharing in ISNs, and introduce our
normatively-coordinated multiagent system to guarantee stability and fairness in ISNs.
Regulations as Socio-Economic Norms: In real cases, ISNs take place under regulations
that concern environmental as well as societal policies. Hence, industrial agents have to comply
to a set of rules. For instance, avoiding waste discharge may be encouraged (i.e., normatively
promoted) by the local authority or transporting a specific type of hazardous waste may be
forbidden (i.e., normatively prohibited) in a region. Accordingly, to nudge the collective behavior,
monetary incentives in the form of subsidies and taxes are well-established solutions. This shows
that the ISN implementation problem is not only about decision processes among strategic
utility-maximizing industry representatives (at a microeconomic level) but in addition involves
regulatory dimensions—such as presence of binding/encouraging monetary incentives (at a
macroeconomic level). To capture the regulatory dimension of ISNs, we apply a normative policy
that respects the socio-economic as well as environmental desirabilities and categorizes possible
coalitions of industries in three classes of: promoted, permitted, and prohibited. Accordingly,
the regulatory agent respects this classification and allocates incentives such that industrial
agents will be induced to: implement promoted ISNs and avoid prohibited ones (while permitted
ISNs are neutral from the policy-maker’s point of view). For instance, in our ISN scenario,
allocating 10 units of incentive to 𝑖𝑗𝑘 and 0 to other possible ISNs induces all the rational
agents to form the grand coalition and implement 𝑖𝑗𝑘—as they cannot benefit more in case they
defect. We call the ISNs that take place under regulations, Coordinated ISNs (𝒞−ISNs). Note
that the term “coordination” in this context refers to the application and efficacy of monetary
40
Vahid Yazdanpanah et al. 38–53
incentive mechanisms in the ISN implementation phase, and should not be confused with ISN
administration (i.e., managing the evolution of relations).
Dealing with firms that perform in a complex multiagent industrial context calls for implemen-
tation platforms that can be tuned to specific settings, can be scaled for implementing various
ISN topologies, do not require industries to sacrifice financially, and allow industries to practice
their freedom in the market. We deem that the quality of an ISN implementation framework
should be evaluated by (1) Generality as the level of flexibility in the sense of independence from
agents’ internal reasoning processes (i.e., how much the framework adheres to the principle of
separation of concerns), (2) Expressivity as the level of scalability in the sense of independence
from size and topology of the network, (3) Rationality as the level that the employed allocation
mechanisms comply to the collective as well as individual rationality axiom (i.e., the framework
should assume that no agent (group) participates in a cooperative practice if they expect higher
utility otherwise), and (4) Autonomy as the level of allowance (i.e., non-restrictiveness) of the
employed coordination mechanisms. Then an ideal framework for implementing ISNs should
be general—i.e., it should allow for manipulation in the sense that the network designer does
not face any re-engineering/calibration burden—sufficiently expressive, rationally acceptable
for all firms, and respect their autonomy. The goal of this paper is to develop a multiagent
framework with properties close to the ideal one.
Past Work: The idea of employing cooperative game theory for analysis and implementation
of industrial symbiosis have been sparsely explored [15, 16, 17]. In [15], Grimes-Casey et al.
used both cooperative and non-cooperative games for analyzing the behavior of firms engaged
in a case-specific industrial ecology. While the analysis is expressive, the implemented relations
are specific to refillable/disposable bottle life-cycles. In [16], Chew et al. tailored a mechanism
for allocating costs among participating agents that expects an involved industry to “bear the
extra cost”. Although such an approach results in collective benefits, it is not in-line with
the individual rationality axiom. In [17], Yazdanpanah and Yazan model bilateral industrial
symbiotic relations as cooperative games and show that in such a specific class of symbiotic
relations, the total operational costs can be allocated fairly and stably. Our work relaxes the
limitation on the number of involved industries and—using the concept of Marginal Contribution
Nets (MC-Nets)—enables a representation that is sufficiently expressive to capture the regulatory
aspect of ISNs.
3. Game-Theoretic Notions
In this work, we build on the transferable utility assumption in game-theoretic multiagent
settings. This is to assume that the payoff to a group of agents involved in an ISN (as a
cooperative practice) can be freely distributed among the group members, e.g., using monetary
transactions.2
2
The presented material on basics in cooperative games is based on [9] while for the MC-Net notations, we
build on [18, 19].
41
Vahid Yazdanpanah et al. 38–53
Cooperative Games: Multiagent cooperative games with transferable utility are often mod-
eled by the tuple (𝑁, 𝑣), where 𝑁 is the finite set of agents and 𝑣 : 2𝑁 ↦→ R is the characteristic
function that maps each possible agent group 𝑆 ⊆ 𝑁 to a real-valued payoff 𝑣(𝑆). In such
games, the so-called allocation problem focuses on methods to distribute 𝑣(𝑆) among all the
agents (in 𝑆) in a reasonable manner. That is, 𝑣(𝑆) is the result of a potential cooperative
practice, hence ought to be distributed among agents in 𝑆 such that they all be induced to
cooperate (or remain in the cooperation). Various solution concepts specify the utility each
agent receives by taking into account properties like fairness and stability. The two standard
solution concepts that characterize fair and stable allocation of benefits are the Shapley value
and the Core, respectively.
Shapley Value and Fairness: The Shapley value prescribes a notion of fairness. It says
that assuming the formation of the grand coalition 𝑁 = {1, . . . , 𝑛}, each agent 𝑖 ∈ 𝑁
should receive its average marginal contribution over all possible permutations of the agent
groups. Let 𝑠 and 𝑛, represent the cardinality of 𝑆 and 𝑁 , respectively. Then, the Shap-
ley value of 𝑖 under characteristic function 𝑣, denoted by Φ𝑖 (𝑣), is formally specified as
∑︀ 𝑠!(𝑛−𝑠−1)!
Φ𝑖 (𝑣) = 𝑆⊆𝑁 ∖{𝑖} 𝑛! (𝑣(𝑆 ∪ {𝑖}) − 𝑣(𝑆)). For a game (𝑁, 𝑣), the unique list of
real-valued payoffs 𝑥 = (Φ1 (𝑣), · · · , Φ𝑛 (𝑣)) ∈ R𝑛 is called the Shapley allocation for the game.
The Shapley allocation have been extensively studied in the game theory literature and satisfies
various desired properties in multiagent practices. Moreover, it can be axiomatized using the
following properties:
• Efficiency
∑︀ (EFF): the overall available utility 𝑣(𝑁 ) is allocated to the agents in 𝑁 , i.e.,
𝑖∈𝑁 Φ𝑖 (𝑣) = 𝑣(𝑁 );
• Symmetry (SYM): any arbitrary agents 𝑖 and 𝑗 that make the same contribution receive
the same payoff, i.e., Φ𝑖 (𝑣) = Φ𝑗 (𝑣);
• Dummy Player (DUM): any arbitrary agent 𝑖 of which its marginal contribution to each
group 𝑆 is the same, receives the payoff that it can earn on its own, i.e., Φ𝑖 (𝑣) = 𝑣({𝑖});
• Additivity (ADD): for any two cooperative games (𝑁, 𝑣) and (𝑁, 𝑤), Φ𝑖 (𝑢 + 𝑤) =
Φ𝑖 (𝑣) + Φ𝑖 (𝑤) for all 𝑖 ∈ 𝑁 , where for all 𝑆 ⊆ 𝑁 , the characteristic function 𝑣 + 𝑤 is
defined as (𝑣 + 𝑤)(𝑆) = 𝑣(𝑆) + 𝑤(𝑆).
In the following, we refer to an allocation that satisfies these properties as a fair allocation.
Core and Stability: In core allocations, the focus is on the notion of stability. In brief, an
allocation is stable if no agent (group) benefits by defecting the cooperation. Formally, for a
game (𝑁, 𝑣), any list of real-valued payoffs 𝑥 ∈ R𝑛 that satisfies the following conditions is a
core allocation for the game:
∑︀
• Rationality (RAT): ∀𝑆 ⊆ 𝑁 : 𝑖∈𝑆 𝑥𝑖 ≥ 𝑣(𝑆);
∑︀
• Efficiency (EFF): 𝑖∈𝑁 𝑥𝑖 = 𝑣(𝑁 ).
One main question is whether for a given game, the core is non-empty (i.e., that there exists
a stable allocation for the game). A game for which there exist a non-empty set of stable
allocations should satisfy the balancedness property, defined as follows. Let 1𝑆 ∈ R𝑛 be the
42
Vahid Yazdanpanah et al. 38–53
4. ISN Games
As discussed in [7, 17], the total obtainable cost reduction—as the economic benefit—and its
allocation among involved firms are key drivers behind the stability of ISNs. For any set of
industrial agents 𝑆, this total value can be computed based on the total traditional cost, denoted
by 𝑇 (𝑆), and the total ISN operational cost, denoted by 𝑂(𝑆). In brief, 𝑇 (𝑆) is the summation
of all the costs that firms have to pay in case the ISN does not occur (i.e., to discharge wastes and
to purchase traditional primary inputs). On the other hand, 𝑂(𝑆) is the summation of costs that
firms have to pay collectively in case the ISN is realized (i.e., the costs for recycling and treatment,
for transporting resources among firms, and finally the transaction costs). Accordingly, for
a non-empty finite set of industrial agents 𝑆 the obtainable symbiotic value 𝑣(𝑆) is equal to
𝑇 (𝑆) − 𝑂(𝑆). In this work, we assume a potential ISN, with a positive total obtainable value,
and aim for tailoring game-theoretic value allocation and accordingly coordination mechanisms
that guarantee a fair and stable implementation of the symbiosis.
Our 𝑖𝑗𝑘 ISN scenario can be modeled as a cooperative game in which 𝑣(𝑆) for any
empty/singleton 𝑆 is 0 and agent groups 𝑖𝑗, 𝑖𝑘, 𝑗𝑘, and 𝑖𝑗𝑘 have the values 4, 5, 4, and 6,
respectively. Note that as the focus of ISNs are on the benefit values obtainable due to po-
tential cost reductions, all the empty and singleton agent groups have a zero value because
cost reduction is meaningless in such cases. In the game theory language, the payoffs in ISN
games are normalized. Moreover, the game is superadditive in nature.3 So, given the traditional
3
Superadditivity implies that forming a symbiotic coalition of industrial agents either results in no value or in a
positive value. Implicitly, growth of a group can never result in decrease of the value.
43
Vahid Yazdanpanah et al. 38–53
and operational cost values for all the possible agent groups 𝑆 (i.e., 𝑇 (𝑆) and 𝑂(𝑆)) in the
non-empty finite set of industrial agents 𝑁 , the ISN among agents in 𝑁 can be formally modeled
as follows.
Definition 1 (ISN Games). Let 𝑁 be a non-empty finite set of industrial agents. Moreover,
for any agent group 𝑆 ⊆ 𝑁 , let 𝑇 (𝑆) and 𝑂(𝑆) respectively denote the total traditional and
operational costs for 𝑆. We say the ISN among industrial agents in 𝑁 is a normalized superadditive
cooperative game (𝑁, 𝑣) where 𝑣(𝑆) is 0 if |𝑆| ≤ 1 and equal to 𝑇 (𝑆) − 𝑂(𝑆) otherwise.
According to the following proposition, basic MC-Nets can be used to represent ISNs. MC-Net
representations aid combining ISN games with normative coordination rules.
Proof. To prove, we do not rely on the expressivity of MC-Nets but provide a constructive proof
that respects the context of industrial symbiosis. See [14] for the complete proof. □
Example 1. Our running example can be represented by the basic MC-Net4 {𝜌1 : (𝑖𝑗, 𝑘) ↦→
4, 𝜌2 : (𝑖𝑘, 𝑗) ↦→ 5, 𝜌3 : (𝑗𝑘, 𝑖) ↦→ 4, 𝜌4 : (𝑖𝑗𝑘, ∅) ↦→ 6}.
As discussed earlier, how firms share the obtainable ISN benefits plays a key role in the
process of ISN implementation, mainly due to stability and fairness concerns. Industrial firms
are economically rational entities that defect non-beneficial relations (instability) and mostly
tend to reject ISN proposals in which benefits are not shared with respect to their contribution
(unfairness). In this work, we focus on Core and Shapley allocation mechanisms as two standard
methods that characterize stability and fairness in cooperative games, receptively. We show
that these concepts are applicable in a specific class of ISNs but are not generally scalable for
value allocation in the implementation phase of ISNs. This motivates introducing incentive
mechanisms to guarantee the implementability of “desired” ISNs.
Two-Person Industrial Symbiosis Games: When the game is between two industrial firms
(i.e., a bilateral relation between a resource receiver/provider couple), it has additional properties
that result in applicability of both Core and Shapley allocations. We denote the class of such
ISN games by ISNΛ . This is, ISNΛ = {(𝑁, 𝑣) : (𝑁, 𝑣) is an ISN game and |𝑁 | = 2}. Moreover,
the ISN games in which three or more agents are involved will form ISNΔ . The class of ISNΛ
games corresponds to the so called ISR games in [17]. The difference is on the value allocation
perspective as in [17], they assume the elimination of traditional costs (thanks to implementation
of the symbiotic relation) and focus on the allocation of operational costs; while we focus on
the allocation of the total benefit, obtainable due to potential cost reductions.
Lemma 1 (ISNΛ Balancedness). Let (𝑁, 𝑣) be an arbitrary ISNΛ game. It always holds that
(𝑁, 𝑣) is balanced.
44
Vahid Yazdanpanah et al. 38–53
Relying on Lemma 1, we have the following result that focuses on the class of ISNΛ relations
and shows the applicability of two standard game-theoretic solution concepts for implementing
fair and stable industrial symbiotic networks.
Theorem 1. Let (𝑁, 𝑣) be an arbitrary ISNΛ game. The symbiotic relation among industrial
agents in 𝑁 is implementable in a unique stable and fair manner.
ISN Games: Here, we focus on ISNΔ games as the class of ISN games with three or more
participants and discuss the applicability of the two above mentioned allocation mechanisms
for implementing such industrial games.
Example 2. Recall the 𝑖𝑗𝑘 ISNΔ scenario from Section 2. To have a stable allocation (𝑥𝑖 , 𝑥𝑗 , 𝑥𝑘 )
in the core, the EFF condition implies 𝑥𝑖 + 𝑥𝑗 + 𝑥𝑘 = 6 while the RAT condition implies
𝑥𝑖 + 𝑥𝑗 ≥ 4 ∧ 𝑥𝑖 + 𝑥𝑘 ≥ 5 ∧ 𝑥𝑗 + 𝑥𝑘 ≥ 4. As these conditions cannot be satisfied simultaneously,
we can conclude that the core is empty and there exists no way to implement this ISN in a stable
manner. Moreover, although the Shapley allocation provides a fair allocation (13/6, 10/6, 13/6),
it is not rational for firms to implement the ISN. E.g., 𝑖 and 𝑘 obtain 30/6 in case they defect
while according to the Shapley allocation, they ought to sacrifice as they collectively have 26/6.
As illustrated in this example, the Core of ISNΔ games may be empty which implies the
inapplicability of this solution concept as a general method for implementing ISNs.
Theorem 2. Let (𝑁, 𝑣) be an arbitrary ISNΔ game. The symbiotic relation among industrial
agents in 𝑁 is not generally implementable in a stable manner.
Note that the fair implementation of ISNΔ games is not always in compliance with the
rationality condition. This theorem—in accordance with the intuition presented in example 2—
shows that we lack general methods that guarantee stability and fairness of ISN implementations.
So, even if an industrial symbiotic practice could result in collective economic and environmental
benefits, it may not last due to instable or unfair implementations. One natural response which is
in-line with realistic ISN practices is to employ monetary incentives as a means of coordination.
5. Coordinated ISN
In realistic ISNs, the symbiotic practice takes place in the presence of economic, social, and
environmental policies and under regulations that aim to enforce the policies by nudging the
behavior of agents towards desired ones. In other words, while the policies generally indicate
whether an ISN is “good (bad, or neutral)", the regulations are a set of norms that—in case of
agents’ compliance—result in a spectrum of acceptable (collective) behaviors. Note that the
acceptability, i.e., goodness, is evaluated and ought to be verified from the point of view of the
policy-makers as community representatives. In this section, we follow this normative approach
45
Vahid Yazdanpanah et al. 38–53
and aim at using normative coordination to guarantee the implementability of desirable ISNs in
a stable and fair manner5 .
Normative Coordination of ISNs: Following [10, 11], we see that during the process of
ISN implementation as a game, norms can be employed as game transformations, i.e., as “ways
of transforming existing games in order to bring about outcomes that are more desirable from a
welfaristic point of view"[11]. For this account, given the economic, environmental, and social
dimensions and with respect to potential socio-economic consequences, industrial symbiotic
networks can be partitioned in three classes, namely promoted, permitted, and prohibited ISNs.
Such a classification can be modeled by a normative socio-economic policy function ℘ : 2𝑁 ↦→
{𝑝+ , 𝑝∘ , 𝑝− }, where 𝑁 is the finite set of industrial firms. Moreover, 𝑝+ , 𝑝∘ , and 𝑝− are labels—
assigned by a third-party authority—indicating that the ISN among any given agent group
is either promoted, permitted, or prohibited, respectively. The three sets 𝑃℘+ , 𝑃℘∘ , and 𝑃℘−
consist of all the ℘-promoted, -permitted, and -prohibited agent groups, respectively. Formally
𝑃℘+ = {𝑆 ⊆ 𝑁 : ℘(𝑆) = 𝑝+ } (𝑃℘∘ and 𝑃℘− can be formulated analogously). Note that ℘ is
independent of the ISN game among agents in 𝑆, its economic figures, and corresponding cost
values—in general, it is independent of the value function of the game. E.g., a symbiotic relation
may be labeled with 𝑝− by policy ℘—as it is focused on exchanging a hazardous waste—even if
it results in a high level of obtainable benefit.
Example 3. In our 𝑖𝑗𝑘 ISN scenario, imagine a policy ℘1 that assigns 𝑝− to all the singleton
and two-member groups (e.g., because they discharge hazardous wastes in case they operate in
one- or two-member groups) and 𝑝+ to the grand coalition (e.g., because in that case they have
zero waste discharge). So, according to ℘1 , the ISN among all the three agents is “desirable"
while other possible coalitions lead to “undesirable” ISNs.
As illustrated in Example 3, any socio-economic policy function merely indicates the desir-
ability of a potential ISN among a given group of agents and is silent with respect to methods
for enforcing the implementability of promoted or unimplementability of prohibited ISNs. Note
that ISNΛ games are always implementable. So, ISNs’ implementability refers to the general
class of ISN games including ISNΔ games.
The rationale behind introducing socio-economic policies for ISNs is to make sure that pro-
moted ISNs are implementable in a fair and stable manner while prohibited ones are instable.
In real ISN practices, the regulatory agent (i.e., the regional or national government) introduces
regulations—to support the policy—in the form of monetary incentives6 . This is to ascribe
subsidies to promoted and taxes to prohibited collaborations (see [24] for an implementation
theory approach on mechanisms that employ monetary incentives to achieve desirable resource
allocations). We follow this practice and employ a set of rules to ensure/avoid the implementabil-
ity of desired/undesired ISNs among industrial agents in 𝑁 via allocating incentives. Incentive
rules can be represented by an MC-Net ℜ = {𝜌𝑖 : (𝒫𝑖 , 𝒩𝑖 ) ↦→ 𝜄𝑖 }𝑖∈𝐾 in which 𝐾 is the set of
rule indices. Let ℑ(𝑆) denote the set of rule indices∑︀ that are applicable to 𝑆 ⊆ 𝑁 . Then, the
incentive value for 𝑆, denoted by 𝜄(𝑆), is defined as 𝑖∈ℑ(𝑆) 𝜄𝑖 . This is, a set of incentive rules
5
In the following, we simply say implementability of ISNs instead of implementability in a fair and stable manner.
6
See [22, 23] for similar approaches on incentivizing cooperative agent systems.
46
Vahid Yazdanpanah et al. 38–53
can be represented also as a cooperative game ℜ = (𝑁, 𝜄) among agents in 𝑁 . In the following
proposition, we show that for any ISN game there exists a set of incentive rules to guarantee
the implementability of the ISN in question.
By allocating −𝑣𝑖 to rules that are not applicable to 𝑁 , any coalition other than the grand
coalition will be faced with a tax value. As the original game is superadditive, the agents will
have a rational incentive to cooperate in 𝑁 and the ISN is implementable in a stable manner
thanks to the provided incentive rules. □
Till now, we introduced socio-economic policies and regulations as required (but not yet
integrated) elements for modeling coordinated ISNs. In the following section, we combine
the idea behind incentive regulations and normative socio-economic policies to introduce the
concept of Coordinated ISNs (𝒞−ISNs) as a multiagent system for implementing industrial
symbiosis.
Coordinated ISNs: As discussed above, ISN games can be combined with a set of regulatory
rules that allocate incentives to agent groups (in the form of subsidies and taxes). We call this
class of games, ISNs in presence of coordination mechanisms, or Coordinated ISNs (𝒞−ISNs) in
brief.
Definition 2 (Coordinated ISN Games (𝒞−ISN)). Let 𝐺 be an ISN and ℜ be a set of regula-
tory incentive rules, both as MC-Nets among industrial agents in 𝑁 . Moreover, for each agent group
𝑆 ⊆ 𝑁 , let 𝑣(𝑆) and 𝜄(𝑆) denote the value of 𝑆 in 𝐺 and the incentive value of 𝑆 in ℜ, respectively.
We say the Coordinated ISN Game (𝒞−ISN) among industrial agents in 𝑁 is a cooperative game
(𝑁, 𝑐) where for each agent group 𝑆, we have that 𝑐(𝑆) = 𝑣(𝑆) + 𝜄(𝑆).
47
Vahid Yazdanpanah et al. 38–53
Note that as both the ISN game 𝐺 and the set of regulatory incentive rules ℜ are MC-
Nets among industrial agents in 𝑁 , then for each agent group 𝑆 ⊆ 𝑁 we have that 𝑐(𝑆) is
equal to the summation
∑︀ ∑︀ of all the applicable rules to 𝑆 in both 𝐺 and ℜ. Formally, 𝑐(𝑆) =
𝑣
𝑖∈Π(𝑆) 𝑖 + 𝑗∈ℑ(𝑆) 𝑗 where Π(𝑆) and ℑ(𝑆) denote the set of applicable rules to 𝑆 in 𝐺
𝜄
and ℜ, respectively. Moreover, 𝑣𝑖 and 𝜄𝑗 denote the value of applicable rules 𝑖 and 𝑗 in Π(𝑆) and
ℑ(𝑆), respectively. We sometime use 𝐺+ℜ to denote the game 𝐶 as the result of incentivizing 𝐺
with ℜ. The next result shows the role of regulatory rules in the enforcement of socio-economic
policies.
Proposition 3 (Policy Enforcing Rules). For any promoted ISN game 𝐺 under policy ℘, there
exist an implementable 𝒞−ISN game 𝐶.
Proof. See [14] for the complete proof. □
Analogously, similar properties hold for avoiding prohibited ISNs or allowing permitted ones.
Avoiding prohibited ISNs can be achieved by making the 𝒞−ISN (that results from introducing
regulatory incentives) unimplementable. On the other hand, allowing permitted ISNs would
be simply the result of adding an empty set of regulatory rules. The presented approach for
incentivizing ISNs, is advisable when the policy-maker is aiming to ensure the implementability
of a promoted ISN in an ad-hoc way. In other words, an ℜ that ensures the implementability of a
promoted ISN 𝐺1 may ruin the implementability of another promoted ISN 𝐺2 . This highlights
the importance of some structural properties for socio-economic policies that aim to foster the
implementability of desired ISNs. As we discussed in Section 2, we aim for implementing ISNs
such that the rationality axiom will be respected. In the following, we focus on the subtleties
of socio-economic policies that are enforced by regulatory rules. The question is, what are
the requirements of a policy that can ensure the rationality of staying in desired ISNs? We
first show that to respect the rationality axiom, promoted agent groups should be disjoint. We
illustrate that in case the policy-maker takes this condition into account, industrial agents have
no economic incentive to defect an implementable promoted ISN.
Proposition 4. Let 𝐺1 and 𝐺2 be arbitrary ISNs, respectively among promoted (nonempty) agent
groups 𝑆1 and 𝑆2 under policy ℘ (i.e., 𝑆1 , 𝑆2 ∈ 𝑃℘+ ). Moreover, let ℜ1 and ℜ2 be rule sets that
ensure the implementability of 𝐺1 and 𝐺2 , respectively. For 𝑖 ∈ {1, 2}, defecting from 𝒞−ISN
𝐶𝑖 = 𝐺𝑖 + ℜ𝑖 is not economically rational for any agent 𝑎 ∈ 𝑆𝑖 iff 𝑆1 ∩ 𝑆2 = ∅.
Proof. See [14] for the complete proof. □
Accordingly, given a set of industrial agents in 𝑁 and a socio-economic policy ℘ we directly
have that:
⋂︀
Proposition 5. For 𝑛 = |𝑃℘+ | if 𝑛𝑖=1 𝑆𝑖 ∈ 𝑃℘+ = ∅ then any arbitrary 𝑆𝑖 ∈ 𝑃℘+ is minimal
(i.e., 𝑆𝑖′ ̸∈ 𝑃℘+ for any 𝑆𝑖′ ⊂ 𝑆𝑖 ).
Roughly speaking, the exclusivity condition for promoted agent groups entails that any agent
is in at most one promoted group. Hence, deviation of agents does not lead to a larger promoted
group as no promoted group is part of a promoted super-group, or contains a promoted sub-
group. In the following, we show that the mutual exclusivity condition is sufficient for ensuring
the implementability of all the ISNs that take place among promoted groups of firms.
48
Vahid Yazdanpanah et al. 38–53
such that all the promoted symbiotic networks are implementable in the coordinated ISN defined by
𝐶 = 𝐺 + ℜ. Moreover, any ISN among prohibited agent groups in 𝑃℘− will be unimplementable.
Example 4. Recalling the ISN scenario in Example 3, the only promoted group is the grand
coalition while other possible agent groups are prohibited. To ensure the implementability of
the unique promoted group and to avoid the implementability of other groups, the result of
executing our algorithm is ℜ = {𝜌1 : (𝑖𝑗, 𝑘) ↦→ −4, 𝜌2 : (𝑖𝑘, 𝑗) ↦→ −5, 𝜌3 : (𝑗𝑘, 𝑖) ↦→ −4}. In
the 𝒞−ISN that results from adding ℜ to the original ISN, industrial symbiosis among firms
in the promoted group is implementable while all the prohibited groups cannot implement a
stable symbiosis.
Given an ISN under a policy, we introduced a set of regulatory rules to ensure that all the
promoted ISNs will be implementable. However, although providing incentives makes them
implementable, the autonomy of industrial agents may result in situations that not all the
promoted agent groups implement their ISN. So, although we can ensure the implementability
of all the promoted ISNs, the real behavior may deviate from a desired one. As our introduced
method for guaranteeing the implementability of ISNs among promoted agent groups is mainly
tax-based, if a 𝒞−ISN violates the policy, we end up with collectible tax values. In such cases, our
tax-based method can become a balanced-budget monetary incentive mechanism (as discussed
in [25, 26, 27]) by employing a form of “Robin-Hood” principle and redistributing the collected
amount among promoted agent groups that implemented their ISN. In the following, we provide
49
Vahid Yazdanpanah et al. 38–53
Note that the redistribution phase takes place after the implementation of the ISNs and with
respect to the evidence set 𝐸. Otherwise, there will be cases in which the redistribution process
provides incentives for agent groups to defect the set of promoted collaborations. Moreover, we
highlight that the use of an MC-net enables calculating the Shapley value in a scalable manner
(see [18] for complexity results).
50
Vahid Yazdanpanah et al. 38–53
Acknowledgments
The authors would like to thank the anonymous referees and the conference participants for
their valuable comments and helpful suggestions.
SHAREBOX [37], the project leading to this work, has received funding from the European
Union’s Horizon 2020 research and innovation programme under grant agreement No. 680843.
References
[1] M. R. Chertow, Industrial symbiosis: literature and taxonomy, Annual review of energy
and the environment 25 (2000) 313–337.
[2] V. Yazdanpanah, D. M. Yazan, W. H. M. Zijm, FISOF: A formal industrial symbiosis
opportunity filtering method, Engineering Applications of Artificial Intelligence 81 (2019)
247–259.
[3] J. Kirchherr, D. Reike, M. Hekkert, Conceptualizing the circular economy: An analysis of
114 definitions, Resources, conservation and recycling 127 (2017) 221–232.
[4] G. D’Inverno, L. Carosi, G. Romano, Environmental sustainability and service quality
beyond economic and financial indicators: A performance evaluation of italian water
utilities, Socio-Economic Planning Sciences (2020) 100852.
[5] N. Shen, H. Peng, Can industrial agglomeration achieve the emission-reduction effect?,
Socio-Economic Planning Sciences (2020) 100867.
[6] D. M. Yazan, V. A. Romano, V. Albino, The design of industrial symbiosis: An input–output
approach, Journal of cleaner production 129 (2016) 537–547.
[7] V. Albino, L. Fraccascia, I. Giannoccaro, Exploring the role of contracts to support the
emergence of self-organized industrial symbiosis networks: an agent-based simulation
study, Journal of Cleaner Production 112 (2016) 4353–4366.
[8] D. M. Yazan, V. Yazdanpanah, L. Fraccascia, Learning strategic cooperative behavior in
industrial symbiosis: A game-theoretic approach integrated with agent-based simulation,
Business Strategy and the Environment 29 (2020) 2078–2091.
[9] A. Mas-Colell, M. D. Whinston, J. R. Green, et al., Microeconomic theory, volume 1, Oxford
university press New York, 1995.
51
Vahid Yazdanpanah et al. 38–53
[10] Y. Shoham, M. Tennenholtz, On social laws for artificial agent societies: off-line design,
Artificial intelligence 73 (1995) 231–252.
[11] D. Grossi, L. Tummolini, P. Turrini, Norms in game theory, in: Agreement Technologies,
Springer, 2013, pp. 191–197.
[12] G. Andrighetto, G. Governatori, P. Noriega, L. W. van der Torre, Normative multi-agent
systems, volume 4, Schloss Dagstuhl-Leibniz-Zentrum fuer Informatik, 2013.
[13] V. Yazdanpanah, D. M. Yazan, H. Zijm, Industrial symbiotic networks as coordinated
games, in: Proceedings of the 17th International Conference on Autonomous Agents and
MultiAgent Systems, AAMAS ’18, IFAAMAS, 2018, pp. 2145–2147.
[14] V. Yazdanpanah, D. M. Yazan, W. H. Zijm, Coordinating multiagent industrial symbiosis,
CoRR abs/2006.01784 (2020).
[15] H. G. Grimes-Casey, T. P. Seager, T. L. Theis, S. E. Powers, A game theory framework for
cooperative management of refillable and disposable bottle lifecycles, Journal of Cleaner
Production 15 (2007) 1618–1627.
[16] I. M. L. Chew, R. R. Tan, D. C. Y. Foo, A. S. F. Chiu, Game theory approach to the analysis
of inter-plant water integration in an eco-industrial park, Journal of Cleaner Production
17 (2009) 1611–1619.
[17] V. Yazdanpanah, D. M. Yazan, Industrial symbiotic relations as cooperative games, in: In-
ternational Conference on Industrial Engineering and Systems Management, International
Institute for Innovation, Industrial Engineering and Entrepreneurship, 2017, pp. 455–460.
[18] S. Ieong, Y. Shoham, Marginal contribution nets: a compact representation scheme for
coalitional games, in: Proceedings of the 6th ACM conference on Electronic commerce,
ACM, 2005, pp. 193–202.
[19] J. Lesca, P. Perny, M. Yokoo, Coalition structure generation and cs-core: Results on
the tractability frontier for games represented by mc-nets, in: Proceedings of the 16th
Conference on Autonomous Agents and MultiAgent Systems, IFAAMAS, 2017, pp. 308–316.
[20] L. S. Shapley, On balanced sets and cores, Naval research logistics quarterly 14 (1967)
453–460.
[21] O. N. Bondareva, Some applications of linear programming methods to the theory of
cooperative games, Problemy kibernetiki 10 (1963) 119–139.
[22] R. Meir, J. S. Rosenschein, E. Malizia, Subsidies, stability, and restricted cooperation in
coalitional games, in: IJCAI 2011, Proceedings of the 22nd International Joint Conference
on Artificial Intelligence, 2011, pp. 301–306.
[23] Y. Zick, M. Polukarov, N. R. Jennings, Taxation and stability in cooperative games, in:
International conference on Autonomous Agents and Multi-Agent Systems, 2013, pp.
523–530.
[24] A. Kakhbod, Resource allocation in decentralized systems with strategic agents: an imple-
mentation theory approach, Springer Science & Business Media, 2013.
[25] M. Guo, V. Conitzer, Optimal-in-expectation redistribution mechanisms, in: Proceedings
of the 7th international joint conference on Autonomous agents and multiagent systems-
Volume 2, IFAAMAS, 2008, pp. 1047–1054.
[26] C. Li, U. Rajan, S. Chawla, K. Sycara, Mechanisms for coalition formation and cost sharing
in an electronic marketplace, in: international conference on Electronic commerce, ACM,
2003, pp. 68–77.
52
Vahid Yazdanpanah et al. 38–53
53
Computable Law as Argumentation-based MAS
Roberta Calegaria , Andrea Omicinib and Giovanni Sartora
a
Alma AI – Alma Mater Research Institute for Human-Centered Artificial Intelligence , Alma Mater
Studiorum—Università di Bologna, Italy
b
Dipartimento di Informatica – Scienza e Ingegneria (DISI), Alma Mater Studiorum—Università di Bologna, Italy
Abstract
In this paper we sketch a vision of computable law as argumentation-based MAS, i.e., human-centred
intelligent systems densely populated by agents (software or human) capable of understanding, arguing,
and reporting, via factual assertions and arguments, about what is happening and what they can make
possibly happen. A multi-agent system based on argumentation, dialogue, and conversation is, in this
vision, the basis for making the law computable: through argumentation, dialogue, and adherence
to social judgment, the behaviour of the intelligent system can be reached, shaped, and controlled
with respect to the law. In such a scenario, computable law – and related intelligent behaviour – is
likely to become associated with the capability of arguing about state and situation, by reaching a
consensus on what is happening around and what is needed, and by triggering and orchestrating proper
decentralised semantic conversations to decide how to collectively act in order to reach a future desirable
state. Interpretability and explainability become important features for that sort of systems, based on the
integration of logic-based and sub-symbolic techniques. Within this novel setting, MAS methodologies
and technologies become the starting point to achieve computable law, even if they need to be adapted
and extended for dealing with new challenges.
Accordingly, in this paper we discuss how this novel vision can build upon some readily-available
technologies, and the research challenges it poses. We analyse a number of approaches and technologies
that should be involved in the engineering of systems and services, and become core expertise for
distributed systems engineers. Among the others, these include knowledge representation, machine
learning, and logic argumentation.
Keywords
computable law, multi-agent system, argumentation, logic, hybrid approaches
1. Introduction
The research field of computable law studies the engineering of the law – i.e., the design of
appropriate formal models and the development of the corresponding technology – to allow
norms, terms and conditions to be represented in a machine-understandable way [1]. The aim
is to enable machine and software agents to process, and reason about, legal abstractions with a
certain degree of accuracy, and to take autonomous decisions based on this. In the context of
computable law, two key factors have to be considered. The first is that a single or unique way
WOA 2020: Workshop “From Objects to Agents”, September 14–16, 2020, Bologna, Italy
" [email protected] (R. Calegari); [email protected] (A. Omicini); [email protected]
(G. Sartor)
~ http://robertacalegari.apice.unibo.it (R. Calegari); http://andreaomicini.apice.unibo.it (A. Omicini);
https://giovannisartor.net/ (G. Sartor)
0000-0003-3794-2942 (R. Calegari); 0000-0002-6655-3869 (A. Omicini); 0000-0003-2210-0398 (G. Sartor)
© 2020 Copyright for this paper by its authors. Use permitted under Creative Commons License Attribution 4.0 International (CC BY 4.0).
CEUR
Workshop
Proceedings
http://ceur-ws.org
ISSN 1613-0073 CEUR Workshop Proceedings (CEUR-WS.org)
54
Roberta Calegari et al. 54–68
of modelling legal knowledge cannot be taken for granted—namely, there are multiple ways of
identifying and circumscribing the “law” to be modelled, and multiple ways of representing
legal contents into automatically processable information structures. Therefore, the computable
law model should be able to deal with heterogeneous “legal ontologies”.
The second factor is that nowadays application scenarios for computable law are strongly
characterised by the same “symbolic vs sub-symbolic” dichotomy that also informs the most
promising techniques in artificial intelligence today. Indeed, if, on the one hand, legal intelligence
has historically been bound to logic and argumentation (i.e., symbolic approaches), on the other
hand, the applications of machine learning algorithms (i.e., sub-symbolic approaches) are
increasing today, especially in the field of data analysis and predictive justice. The use of the
latter techniques raises ethical and fairness issues linked to the lack of transparency and the
possibility of hidden biases. Therefore, models aimed at making the law computable must
somehow consider that dichotomy and should try a reconciliation – possibly via a blended
integration – so to take advantage of each approach: benefiting from the strengths of each
method, and smoothing the corresponding limits.
Along this line, in this paper we sketch a vision of computable law as an argumentation-based
multi-agent system. As widely recognised, agent architecture is today the reference for the
design of intelligent systems [2, 3, 4], it allows dealing with heterogeneous entities and models,
and fits perfectly with the pervasive and distributed scenarios that the computable law aims at
addressing. The vision we propose relies on the multi-agent system (MAS) abstractions and
architecture [5] expanding them both from the point of view of norms and argumentation (as
in existing works on normative MAS, see for instance [6, 7]), and of the integration between
symbolic and sub-symbolic techniques.
In this scenario, the very nature of the system actors – intended as agents, but also as
surrounding environments – embodies the concepts of computable law implementing and
coordinating the activities of distributed processes in order to achieve either individual or
common goals. In fact, computable law is likely to become associated with the capability of
debating about situations and about the current context, by reaching a consensus on what is
happening around and what is needed, and by triggering and directing proper decentralised
semantic conversations to decide how to collectively act in order to reach the future desirable
state of the affairs. Within this novel setting, interpretability and explainability become a
remarkable feature of the multi-agent system.
55
Roberta Calegari et al. 54–68
56
Roberta Calegari et al. 54–68
Looking in-depth at the expect behaviour of self-driving cars in an urban environment, it turns
out that autonomous cars need to undertake a complex decision-making process, in compliance
with norms and social rules, in almost the whole journey, which seamlessly integrates actions
(and perceptions) at different levels.
The first action is the trip planning which must be done by considering the global knowledge—
for instance, local laws, regulations, policies, and average traffic conditions of the intersections
and roads along the path toward the destination, influenced by factors such as the day of the
week, the hour of the day, the weather, and the like.
Planning is then modulated by considering all contingencies arising during the journey –
such as, for instance, a car crash forcing a change path, a protest causing delays in our preferred
path, etc. As a consequence, the original plan has to be adapted to the local knowledge (and
perceptions) cars gather while enacting it; once again, the decision is closely related to legal
issues: for instance, what is the best action to perform in order to avoid fines? Or, again, if an
accident cannot be avoided, how to choose the ethically-preferable option?
Moreover, there are strict rules on safety we would like self-driving cars to automatically
enforce, such as slowing down when passing nearby a school, breaking and setting aside the
vehicle as soon as the horn of an ambulance is heard, etc. In other words, regardless of what
the global and local knowledge may suggest, we abide by a set of general commonsense rules
orthogonally considered valid.
Generally speaking, compliance with the legal rules by the autonomous cars – including also
global, national, state, and local laws, regulations, and policies – must be guaranteed, unless
contingent priority situations occur (such as when a norm has to be violated in order to save
the life of a passenger/pedestrian).
The analysis carried out so far highlights some key requirements that engineering approaches
and techniques have to fulfil. First of all, the envisioned scenario seamlessly integrates percep-
tions (and actions) at two different scales—namely, the macro and the micro.
The macro level of the system includes global knowledge and generally-valid rules, like uni-
versal norms and legal conventions, possibly modulated by commonsense reasoning. Moreover,
with respect to the surrounding environment, the macro level deals with a mid / long term
horizon and focus on the issue of traffic flow management–including, for instance, traffic flow
forecasting and urban planning possibly learned from historical data analysis. On the other
hand, the micro level, deals with the short term horizon, and mostly focuses on intersection
management, including a few highly intertwined sub-problems—e.g. collision avoidance, min-
imisation of average delay, and congestion resolution. The macro-level and the micro-level act
synergistically, exploiting some sort of integration in order to achieve individual and social
goals.
As the last step, a suitable infrastructure for V2I (vehicle-to-infrastructure) and V2V (vehicle-to-
vehicle) communication should be considered, for instance through the deployment of Road-side
Units (RSU). This infrastructure should make it possible to convey information from the vehicle
to the infrastructure and vice-versa. For instance, it should provide information about the road
on which the vehicle is travelling and its specific rules, environmental conditions around the
vehicle, traffic in the vicinity of the vehicle, and construction in the vicinity of the vehicle.
All the abovementioned ingredients should be mixed consistently in order to achieve the goal
of the cars and therefore of the user, respecting current rules and convention. Therefore, the
57
Roberta Calegari et al. 54–68
system knowledge base needs to be built by taking into account both macro and micro scales,
and agents have to be able to reason and argue over it in order to achieve their goals.
In the following, we show that computable law naturally is an essential ingredient in a
distributed multi-party conversation, or dialogue, based on distributed intelligence. It cannot
be easily tackled with traditional approaches to distributed computing: instead, different ap-
proaches and techniques needs to be put in place and to be fruitfully integrated in order to meet
the aforementioned requirements.
3.1. e-Institution
In the vision sketched above, particular attention has been given to normative concepts since
norms and laws are the basic bricks upon which to build the concept of computable law, since
individual and collective behaviours are both affected by norms. In particular, we leverage
on the well-known concepts of electronic-institution (e-institution) – as in normative MAS
[6] – and deliberative agents [12], setting up e-institutions via suitable coordination artefacts
exploited as normative abstractions.
Loosely speaking, e-institutions are computational realisations of traditional institutions:
i.e., coordination artefacts providing an environment where agents can interact according to
stated laws – norms or conventions – in such a way that interactions within the e-institution
58
Roberta Calegari et al. 54–68
reproduce norm-based interactions in the actual world. With the term deliberative agents, we
emphasise the agents’ autonomy stressed both by e-institutions and normative systems. Indeed,
in such systems individuals possess the property of normative autonomy—i.e., can decide to
violate a norm to achieve their goals, or to change their goals so that they match the existing
norms. E-instutions can provide for real-time detection of violations, and norm-enforcement
can be envisaged via different enforcement technique. For instance, a simple local blocking rule
[13] can be applied (specific actions may be disallowed), or the application of the laws can be
prioritised according to the contingent situation (some actions may be discouraged), or norms
can be modelled in a game theory framework, where sanctions and rewards are provided for
agents [14], or where agents are expected to cooperate according to norms that maximise the
society’s utility.
From an agent’s point of view, two major benefits stem from modeling environments as
e-institutions. On the one hand, e-institutions establish conventions – on behaviour, language,
and protocols – that inform agents about the law and possibly induce them to comply. In a
sense, the environment is given structure, so that the agents have an easy comprehension of its
working laws. On the other hand, norm enforcer agents endowed with capabilities for acquiring
norms dynamically and enforcing them in uncertain environments can be envisioned and spread
all over the system. Recalling our motivating scenario: drivers or traffic wardens know when
they can talk, what consequences their acts will have, and what actions are possible at each
moment in time. These restrictions contains the set of actions that agents have to consider at
each moment in time by limiting the set of options that agents have to think about.
From the systems properties’ point of view, e-institution promote a clear embodiment of the
laws that govern the system, thus making it observable and more explainable in its autonomous
actions—i.e., the explicit role of institution allow to enforce a set of norms whose violation can
be perfectly observed. With respect to the case study, e-institution incarnates global system
knowledge as global, national, state, and local laws, regulations, and policies.
3.2. Micro-intelligence
In order to ensure different levels of knowledge – and intelligence – as highlighted in Section 2,
the MAS model is extended with the concept of micro-intelligence. Micro-intelligence is exploited
to manage precisely the micro-level of the system intelligence – i.e., local intelligence, as the
intelligence of objects, things, but also of the environment – to be integrated with the macro-
level intelligence. We recall the micro-intelligence definition from [15, 16] as the externalised
rationality of cognitive agents, complementing their own in the sense of Clark and Chambers’
active externalism [17], and under the perspective of Hutchins’ distributed cognition [18], as
depicted in Figure 1. In short, micro-intelligence is external because it does not strictly belong
to agents, as it is a process independently executed by another entity – namely, an artefact – to
whom the agent is (possibly, temporarily) coupled—in the sense of the distributed cognition’s
“extended mind”. Moreover, it is rational because it is supposed to convey a sound inference
and argumentation process in order to provide an explanation on the decision process. Micro-
intelligence complements agents’ own cognitive processes because it augments the cognitive
capabilities of agents, by embodying situated knowledge about the local environment along
with the relative inference and argumentation processes. Agents may even be unaware of the
59
Roberta Calegari et al. 54–68
Figure 1: Micro-intelligence under the A&A perspective: distributed cognition is enabled by the active
externalism of artefacts acting as cognitive delegates for the agent (extended) mind.
60
Roberta Calegari et al. 54–68
Figure 2: Main architecture components and techniques for realising the vision (left) and an exemplary
deployment (right).
agents.
61
Roberta Calegari et al. 54–68
to situated knowledge over which agents can reason and discuss in order to achieve goals.
The multi-agent system, also thanks to its rational reasoning and argumentation capabilities,
can provide outcomes to the users as well as explanations for their behaviours. On the other
side, humans can insert input into the system – like desires, preferences, or goal to achieve –
and these are transposed into agents’ goal, corresponding activity planning, and lower-level
commands for actuators.
The law, in this vision, become an internal component of the computational processes: legal
norms, values, and principles are mapped and translated into, a computable representation of
legal information – i.e., into the system knowledge – that is directly processed by computational
entities. Agents become artificial legal agents able to comply with legal requirements and to
reason over them.
Computable law assumes a vision of compliance/law by design in this architecture combining
top-down compliance with predefined rules and bottom-up learning from cases and experience
with capability to address regulatory conflicts according to legal values and principles.
4. Enabling technologies
The above considerations translate into different engineering approaches and therefore different
nature of algorithms and techniques that can and must be considered when building the system.
In the following, we encapsulate the main technologies involved as well as research challenges
and opportunities.
62
Roberta Calegari et al. 54–68
Data processing & rule learning. At the most straightforward level, machine learning tech-
niques are clearly involved in raw input data elaboration, coming from sensors and/or documents,
into more complex, high-level, structured information. Moreover, agents should be able to learn
policies from past experience, by adapting both to the changing environment, and to the con-
tinuous progress of the society. Data aggregation, feature extraction, clustering, classification,
data and pattern mining techniques are typically employed today to reach these objectives.
We believe that hybrid approach could provide promising solutions to these tasks, by merging
logic with probabilistic models and statistical learning, so to efficiently handle advantages of
both symbolic and sub-symbolic approaches and moving towards explainable systems [22]. As
highlighted above, the ML knowledge should somehow be translated into logical knowledge
and properly merged with logical knowledge coming from ontologies or domain-expert norm
translation or similar.
63
Roberta Calegari et al. 54–68
• provide many external authorities sharing the load of negotiating argumentations among
a limited number of participants to enforce shared normative rules, possibly exploiting
some notion of proximity;
• base the agreement on temporary agreement valid only for the duration of a conversation,
defining somehow the concept of temporal locality;
• dually to the previous one, spatial locality may be the criterion to enforce partial consis-
tency of normative and behavioural rules—according to the concept of “argumentation
neighbourhood” where different distributed mediators act to enforce an agreement re-
specting the law.
In any case, we think that the concept of locality is crucial and should be considered along with
distributed argumentation—coherently with the notion of micro-intelligence. In addition, it could
be interesting to envision a framework where the specific argumentation and inference process
can be swapped at runtime, making consideration on the specific situation, and introducing,
for instance, abductive reasoning, or probabilistic argumentation or the algorithm deemed best
and necessary for such a situation. The dialogue, therefore, becomes possible by following
different rationales that can guide the decision-making process, possibly comparing different
perspectives and visions.
64
Roberta Calegari et al. 54–68
– become essential components of our vision for humans interaction. The challenge in the
envisioned scenario is always related to the distributed issues, i.e., making commands possibly
understandable to a multitude of agents and vice-versa. Existing algorithms should, therefore,
be adapted for dealing with distributed and pervasive environments.
4.6. Simulation
Validation through simulation is of paramount importance when dealing with MAS, and even
more when dealing on the integration of many different technologies—as in our vision. Simula-
tion is concerned with the truthfulness of a model with respect to its problem domain and the
correctness of its construction. In other words, simulation calls for verification, i.e., “building
the system right" and validation, i.e., “building the right system" [28]. So, our vision leverages
on consolidated simulation techniques that must become a core technology to validate and
verify the final model and its properties.
In the traffic management scenario, for instance, by simulating car-following in continuous
traffic flow and comparing simulation data with the data collected from the actual road, the
reliability of the model and the architecture. Many simulation models have been proposed on
the topic [29, 30, 31].
Also in this field, the simulation models must be able to mix ingredients from the techniques
above discussed (symbolic and sub-symbolic) and should be adapted to meet the software
engineering requirements these techniques refer to.
5. Conclusions
The heterogeneous nature of intelligence required by pervasive AI systems along with fears
related to sub-symbolic techniques more and more exploited in such systems require for models
and technologies guaranteeing explainability as one of the main requirement.
Within this context, we believe that argumentation can play a major role, as it allows debates
to be studied and analysed, reasoning and persuasion to be exploited in dialogues, with a
well-grounded theoretical framework.
In this paper, we show how different dialogues can occur in such pervasive contexts, highlight-
ing the advantages of employing argumentation. Interpretability of decision making, tolerance
to uncertainty, adaptiveness, robustness of the system, and improved trust by end-users and
amongst interacting components, are the most notable benefits of the proposed approach.
The main limit of the argumentation approach is the typical assumption to have an external
judge or authority that has to control the whole argumentation process, but this is very unlikely
in a dynamic, distributed scenario like the one we propose. This aspect will certainly be the
subject of future work.
However, model and techniques that should play a key role in the engineering of intelligent
systems – even if with enhancements and extensions – have been discussed and constitute a
starting point for further researches.
65
Roberta Calegari et al. 54–68
Acknowledgments
Roberta Calegari and Giovanni Sartor have been supported by the H2020 ERC Project “Compu-
Law” (G.A. 833647). Andrea Omicini has been supported by the H2020 Project “AI4EU” (G.A.
825619).
References
[1] G. Sartor, P. Casanovas, N. Casellas, R. Rubino, Computable models of the law and ICT:
State of the art and trends in european research, in: Computable Models of the Law,
Springer, 2008, pp. 1–20. doi:10.1007/978-3-540-85569-9_1.
[2] M. J. Wooldridge, N. R. Jennings, Intelligent agents: Theory and practice, The Knowledge
Engineering Review 10 (1995) 115–152. doi:10.1017/S0269888900008122.
[3] R. Calegari, G. Ciatto, E. Denti, A. Omicini, Logic-based technologies for intelligent
systems: State of the art and perspectives, Information 11 (2020) 1–29. doi:10.3390/
info11030167, Special Issue “10th Anniversary of Information—Emerging Research
Challenges”.
[4] F. Xhafa, S. Patnaik, M. Tavana, Advances in Intelligent Systems and Interactive
Applications, volume 1084, Springer International Publishing, 2020. doi:10.1007/
978-3-030-34387-3.
[5] C. Savaglio, M. Ganzha, M. Paprzycki, C. Bădică, M. Ivanović, G. Fortino, Agent-based
internet of things: State-of-the-art and research challenges, Future Generation Computer
Systems 102 (2020) 1038–1053. doi:10.1016/j.future.2019.09.016.
[6] G. Andrighetto, G. Governatori, P. Noriega, L. W. van der Torre, Normative multi-agent sys-
tems, volume 4 of Dagstuhl Follow-Ups, Schloss Dagstuhl-Leibniz-Zentrum fuer Informatik,
2013. URL: https://drops.dagstuhl.de/opus/volltexte/dfu-complete/dfu-vol4-complete.pdf.
[7] W. W. Vasconcelos, J. Sabater, C. Sierra, J. Querol, Skeleton-based agent development for
electronic institutions, in: 1st International Joint Conference on Autonomous Agents and
Multiagent Systems: Part 2 (AAMAS ’02), ACM, New York, NY, USA, 2002, pp. 696–703.
doi:10.1145/544862.544911.
[8] J. Rios-Torres, A. A. Malikopoulos, A survey on the coordination of connected and
automated vehicles at intersections and merging at highway on-ramps, IEEE Transactions
on Intelligent Transportation Systems 18 (2017) 1066–1077. doi:10.1109/TITS.2016.
2600504.
[9] V. Gradinescu, C. Gorgorin, R. Diaconescu, V. Cristea, L. Iftode, Adaptive traffic lights using
car-to-car communication, in: IEEE 65th Vehicular Technology Conference (VTC2007),
2007, pp. 21–25. doi:10.1109/VETECS.2007.17.
[10] A. Omicini, SODA: Societies and infrastructures in the analysis and design of agent-based
systems, in: P. Ciancarini, M. J. Wooldridge (Eds.), Agent-Oriented Software Engineering,
volume 1957 of Lecture Notes in Computer Science, Springer-Verlag, 2001, pp. 185–193.
doi:10.1007/3-540-44564-1_12.
[11] A. Omicini, A. Ricci, M. Viroli, Artifacts in the A&A meta-model for multi-agent sys-
tems, Autonomous Agents and Multi-Agent Systems 17 (2008) 432–456. doi:10.1007/
66
Roberta Calegari et al. 54–68
67
Roberta Calegari et al. 54–68
ture Notes in Computer Science, Springer International Publishing, 2014, pp. 99–110.
doi:10.1007/978-3-319-11692-1_9.
[25] J. Hulstijn, L. W. van der Torre, Combining goal generation and planning in an argumen-
tation framework, in: International Workshop on Non-monotonic Reasoning (NMR’04),
2004, pp. 212–218.
[26] S. Modgil, M. Caminada, Proof theories and algorithms for abstract argumentation
frameworks, in: Argumentation in Artificial Intelligence, Springer, 2009, pp. 105–129.
doi:10.1007/978-0-387-98197-0_6.
[27] R. Calegari, G. Contissa, F. Lagioia, A. Omicini, G. Sartor, Defeasible systems in legal
reasoning: A comparative assessment, in: M. Araszkiewicz, V. Rodríguez-Doncel (Eds.),
Legal Knowledge and Information Systems. JURIX 2019: The Thirty-second Annual Con-
ference, volume 322 of Frontiers in Artificial Intelligence and Applications, IOS Press, 2019,
pp. 169–174. doi:10.3233/FAIA190320.
[28] D. Calvaresi, G. Albanese, J.-P. Calbimonte, M. Schumacher, SEAMLESS: Simulation
and analysis for multi-agent system in time-constrained environments, in: Advances in
Practical Applications of Agents, Multi-Agent Systems, and Trustworthiness. The PAAMS
Collection, Springer International Publishing, Cham, 2020, pp. 392–397. doi:10.1007/
978-3-030-49778-1_30.
[29] M. Mashayekhi, H. Du, G. F. List, M. P. Singh, Silk: A simulation study of regulating
open normative multiagent systems., in: 25th International Joint Conference on Artificial
Intelligence (IJCAI-16), 2016, pp. 373–379. URL: https://www.ijcai.org/Proceedings/16/
Papers/060.pdf.
[30] J. Dai, X. Li, Multi-agent systems for simulating traffic behaviors, Chinese Science Bulletin
55 (2010) 293–300. doi:10.1007/s11434-009-0230-3.
[31] F. Zhang, J. Li, Q. Zhao, Single-lane traffic simulation with multi-agent system, in: 2005
IEEE Intelligent Transportation Systems, IEEE, 2005, pp. 56–60. doi:10.1109/ITSC.2005.
1520219.
68
A Tool for the Automatic Generation of MOISE
Organisations From BPMN
Massimo Cossentino, Salvatore Lopes and Luca Sabatucci
ICAR-CNR, 153, Via La Malfa, 90146 Palermo, Italy
Abstract
Multi-agent systems proved successful in enacting business processes because of their inner properties
(distribution of tasks, collaboration and coordination among agents). MAS adoption in enacting processes
becomes even more interesting if they exhibit adaptation capabilities. The proposed approach consists in
the automatic generation of a MOISE organisation from the BPMN specification of a business process.
This organisation is conceived to support adaptation because of the possibility to adapt its configuration
at runtime according to emerging needs. Here, we focus on the tool for processing BPMN specification
and generating MOISE organization code.
Keywords
Multi-Agent Systems, Business Process, BPMN, Adaptation
1. Introduction
Traditionally, business processes are designed as static, rigid procedures, but in real production
environment there are many events and/or exceptions that can not be foreseen at design time
and can lead to the failure of the whole process. For instance, some web service could be not
reachable, the network could be extremely busy with heavy delay in response etc. . . However,
increasing the agility and the flexibility of business process is not trivial being in contrast to the
current trend of over-specifying workflow details with the objective to detail every possible
execution branches.
Multi-Agent Systems own many interesting features as autonomy, distribution of tasks, and
collaboration/coordination, that proved successfully in a range of application fields. Historically,
MASs have good records in implementing workflows because all those features perfectly match
with enterprises’ needs [1, 2, 3]. Moreover, the Belief Desire Intention (BDI) paradigm[4] allows
developers to design applications with practical reasoning, facilitating the definition of business
logic.
Most of the agent-based approaches to workflow design are based on services and semantic
web description (i.e. DAML-S [5]) for defining the external behaviours of proactive agents, and
social and communication abilities of agents to coordinate the flow of tasks. It remains open
the issue of coordinating heterogeneous, autonomous agents, whose internal designs is not
partially or full known a-priori.
WOA 2020: Workshop “From Objects to Agents”, September 14–16, 2020, Bologna, Italy
" [email protected] (M. Cossentino); [email protected] (S. Lopes); [email protected]
(L. Sabatucci)
© 2020 Copyright for this paper by its authors. Use permitted under Creative Commons License Attribution 4.0 International (CC BY 4.0).
CEUR
Workshop
Proceedings
http://ceur-ws.org
ISSN 1613-0073 CEUR Workshop Proceedings (CEUR-WS.org)
69
Massimo Cossentino et al. 69–82
An important improvement in MAS design and implementation comes out with the JaCaMo
platform [6]. It represents an interesting solution because it handle various aspects of agent
programming. JaCaMo integrates in an unique platform three multi-agent programming dimen-
sions (agent, environment, and organization levels) and provides Jason [7] for developing BDI
agents [4], CArtAgO for defining artifacts [8], and MOISE [9] for specifying agent organizations.
In this paper we propose a tool able to automatically generate organizations of agents to
implement a given workflow expressed in Business Process Modeling Notation (BPMN) [10]. A
structured organization adds robustness to the MAS system without losing the nice properties
of agents like reasoning, communication and coordination abilities. The aim is to produce a
MAS implementation of the business process able to adapt itself to various internal/external
unexpected conditions (unavailability of services, failure in reaching the expected end-condition,
network problem and so on).
The BPMN is a high-level language that allows developer to model all the phases of a planned
business process. It focuses on analysis activity and there is not any bounding between tasks and
services at design time. A recent result has been that a business process, opportunely designed,
may be automatically translated into goals [11]. This translation has the advantage that goals
allow for breaking the rigid constraints of a BPMN: whereas sequence flows specify the precise
order in which services are invoked, goals can relax the order of task execution, widening the
space for adaptation [12]. This goes into the direction of defining several possibilities to attain
the desired result.
Having a BPMN as a set of goals, it is possible to conceive a multi agent system able of
addressing them [13]. The idea is that, given a set of goals, and a set of available services,
it is possible to automatically generate one or more social organizations corresponding to
the workflow enactment. Clearly, the number of organizations depends on the availability of
services. A redundant service repository allows for different plans to pursue the same set of
goals. However, when several organizations can be produced (each one targeted to the same
desired result), it is possible to enable run-time adaptation strategies for continuing goal pursuit
in case of failure.
The tool we propose uses a three steps procedure:
1. goal extraction from a BPMN definition [11],
2. exploiting a planner for composing available services (stored in a yellow pages service)
and obtaining different wokflow solutions to the same set of goals, and
3. employment of each different solution for generating multi-faceted agent organizations
voted to achieve the business goal.
The paper is structured as follows: Section 2 presents the theoretical background, providing a
brief description of BPMN, MOISE and JaCaMo. Section 3 describes the automatic generation of
MOISE organizations; in particular, Section 3.1 presents a running example; Section 3.2 briefly
reports the approach by discussing the mapping between BPMN elements and MOISE metamodel
elements; Section 3.3 enters into the details, by explaining the algorithm of conversion. Finally,
some conclusion is drawn in Section 4.
70
Massimo Cossentino et al. 69–82
2. Theoretical Background
In this section we provide a brief description of the main background concepts used along
the paper; namely the BPMN notation for the design of business processes and the MOISE
framework for multi-agent systems organisations definition.
71
Massimo Cossentino et al. 69–82
Role a role represents a placeholder for an agent that takes in charge to perform some activity.
The number of agents that can play a role is constrained by a minimum and maximum
number.
Group a group is composed by roles. A group is well formed when all its roles are played by
agents.
Link A link specifies the type of relationship between agents playing two roles. It is possible
to describe compatibilities between roles.
Functional Specification:
Goal semantic description of a result to obtain; MOISE goals may belong to two different types:
achieve and maintain.
Plan is an operator, used within a Scheme, in order to specify the goal decomposition type
(sequence, choice, parallel).
Normative Specification:
Norm there are two types of norms: obligation and permission. They establish the link
between the role and the mission. When an agent plays a role, it should or would commit
to missions’ goals.
The MOISE organisation (provided as a XML file) is not operational in itself. A set of
CArtAgO Artifacts allows all necessary constructs and data structures to make a MAS operative,
i.e. allowing agents to adopt ad play a role, to participate to a group, and to commit a mission [6].
For instance, the GroupBoard stores information about the MOISE elements the organization is
made of. Once an agent adopt a role, it is subject to the constraints the organization imposes.
Depending on the norm, an agent can commit or to be obliged to perform a mission.
72
Massimo Cossentino et al. 69–82
BPMN
BPMN2
GOAL GOAL
ID
trigger_cond
State final_state
extractor
Wi
SOLUTION
Ontology
extractor Ontology
ID SOL2
PMR WI
items MOISE
flows
ABSTRACT
CAPABILITY
GROUNDING
ID
CAPABILITY
params
abstract
pre
param_mapping
post
effects
MOISE-SPEC
YELLOW
<agent,service>
PAGES
Figure 2: An overview of the main elements involved in the process to generate MOISE organizations
from BPMN
committee discuss an issue list, and express a vote: if the majority is not reached, a new iteration
of discussion/voting is performed.
The process description reports some events (emails) connecting the reported activities with
the external voting members, represented as a swimlane shading the behaviour of the voting
members that is of low interest for the current example. Data flow in the process is represented
by Data Objects (like the Issue_list) that can evolve their refinement during the process, and
that is represented by a state (initial, in_vote,. . . ).
Goal Extraction The first step consists in the extraction of goals from the BPMN process that
is depicted using some BPMN compliant tool (and exported using the XMI format). This becomes
the input of the BPMN2GOAL module1 . The tool generates a list of goals by inspecting BPMN
elements and their relationships. Indeed, single elements (activities, gateways,. . . ) contribute
to the advancement in the world state in a way that is dependent on both endogenous factors
(the result provided by the work done inside the element) and exogenous ones (the influence
that other process elements have on it by creating its input, and constraining its output for
compatibility with the remaining part of the process). In other words, a kind of balance of forces
is to be solved in order to represent the mutual influence of each BPMN element on the other,
1
Available online at: http://aose.pa.icar.cnr.it:8080/BPMN2Goal/
73
Massimo Cossentino et al. 69–82
Figure 3: The general structure of a goal extracted from the BPMN process
and the single element contribution to what becomes the collective outcome of the process
execution.
Details about the goals extraction procedure may be found on [11]. Briefly, the structure of a
goal is reported in Fig. 3. Usually the goal name is taken from the activity it refers to (GOAL
line), while the WHEN clause defines the trigger condition of the goal; this depends on the
elements before the activity under analysis. Let us consider the process fragment reported in
Fig. 4, an OR gateway merges the control flows of activities Act_A, Act_B that are placed before
Act_C: the input of Act_C may be provided by only one of the other two activities feeding
the OR gateway or even by both of them. This has to be reported in the WHEN condition by
connecting the two output conditions of Act_A, and Act_B with an OR logical operator. We
may also suppose Act_C requires some other condition to hold in order to be executed and that
is to be expressed in the WHEN specification as well. This may happen when the condition in
the original process was generated by other activities/tasks placed before Act_C. Finally, the
THEN clause defines the postcondition after the execution of Act_C. This could also depend on
the expected input of the following activities as well, in order to ensure the correct execution of
the workflow.
State of the World Extraction The current state of the world is of paramount importance for
the execution of a MAS solution. This is generated by the State Extractor module by processing
the input workflow. The method considers the event that is usually sent to the workflow in
order to trigger its execution together with any Data Input (an input Data Object for the whole
process) as specified in the XMI file.
Ontology Extraction Goal specifications naturally define a vocabulary of terms that may
be usefully employed to specify a part of the world where the agents live (predicates in the
74
Massimo Cossentino et al. 69–82
WHEN/THEN conditions of goals), and the actions that can be done in it (BPMN activities).
This generates a primordial ontology that is generated by the Ontology Extractor module. A
more accurate processing of some optional details of the BPMN notation greatly contributes
to this issue. As an example we could consider Data Objects (that could represent ontology
concepts), their states (that could generate predicates), Data type (items) that could contribute
to the generation of a IS-A tree. Despite the interesting implications, these features are not
relevant to the current work.
Solutions Calculations The possibility to execute the workflow with the available agents
in the MAS depends on the capabilities such agents register in the system’s Yellow Pages. We
suppose each agent, entering the system, registers its own capabilities in such register by using
a tuple <agent, service>. For each service, an Abstract Capability is automatically generated by
considering the service interface specifications like pre and post conditions. Of course, services
with the same specifications are considered as belonging to the same abstract capability thus
creating a redundancy in the capability instantiation that can profitably support some adaptation
degree (see [13]). Indeed, the instantiation of the capability also depends on some parameters
that are part of the solution and they contribute to the definition of the Grounding Capability. A
Grounding Capability is the concretization of an Abstract one, and many Grounding capabilities
may correspond to one Abstract Capability, according to the available agent-service tuples in
the Yellow Pages.
Solutions are computed by the Proactive Means-end Reasoning (PMR) algorithm [15]: each
solution is a workflow including capabilities, decision nodes, and so on.
The PMR algorithm, in each solution, defines a world transition system (WTS), like the one
shown in Fig. ?? from the input workflow of Fig. 1. The initial state corresponds to the initial
event of the workflow (the reception of the issue list in this example). The next state corresponds
to the availability of an issue list arranged for the discussion. The PMR identifies the capability
prepare as the one that could transform the state of the issue list from [received] to [initial].
This capability is the abstraction of a service registered in the Yellow Pages by one or more
agents. Actually this likely means the prepare capability proposes the received issue list to the
committee chair for editing. Once the chair completes her editing, the list moves to the [initial]
state and it is ready for discussion in the committee. Again the PMR algorithm identifies one
capability (discussion) for managing the debate and producing the expected output (the issue
list in the [ready] refinement state).
Now, if the voting achieves a majority consensus, the final state is reached, otherwise another
branch is activated with the possibility to iterate modifications and votes.
This WTS ma be used to deduce the workflow underpinned by the solution. That step is
easily done by looking at the capabilities listed in the WTS and reporting them as activities just
like it is shown in Fig. 6. Control flows are similarly found in order to complete the design.
It is worth to note that this workflow is equivalent to the input BPMN one in terms of the
results it produces but the type and number of services may not (and usually do not) exactly map
one-to-one to the initial process activities. This solution is specifically conceived to be executed
by the agents in the MAS and it has been designed to only use services that are possessed by
those agents.
75
Massimo Cossentino et al. 69–82
[received(issue_vote_list)]
prepare()
[initial(issue_list)]
discussion()
[ready(issue_list)]
voting()_disagree
[fnal(issue_list),sent(vote_announcement)]
[ready(issue_list),sent(vote_announcement)]
voting()_agree
[fnal(issue_list),agreement(issue_votes),sent(vote_announcement)]
Figure 5: The world transition statechart extracted by the PMR algorithm from the process reported in
Fig. 1
discussion voting
disagree agree
start prepare J0 S0 end
Figure 6: The workflow defined by the PMR algorithm to obtain the prescribed results using the services
in the Yellow Pages
Of course the proposed example is very simple and solutions could be easily found even by
hand but the approach works for large and complex input BPMN processes that would be very
hard to solve using a long list of not exactly one-to-one matching services.
Moreover, the PMR algorithm, if the Yellow Pages repository is huge enough, may produce
several different solutions by differently composing all the existing capabilities. This generates
an even larger number of concrete solutions (the realization of a solution in terms of concrete
capabilities).
MOISE Organization Definition The last step in the adopted process consists in the actual
definition of the MOISE organization. The main input for that is: 1) the set of goals, 2) the set of
solutions generated by the PMR algorithm and 3) the content of the yellow pages. These are
processed according to the algorithm detailed in the next subsection.
76
Massimo Cossentino et al. 69–82
organisational-specification
structural-specification
APPLY_RULE__ROLE_DEF
group-specification
subgroups
APPLY_RULE__GROUP_SPEC
formation-constraints
APPLY_RULE__ROLE_COMPATIBILITY
functional-specification
APPLY_RULE__SCHEME_DEF
normative-specification
APPLY_RULE__NORM_DEF
Figure 7: Abstract Representation of the XML output generated by the tool by applying specific rules.
The function receives a list of Capabilities (extracted from the system Yellow Pages) and returns
a ‘role-definitions’ tag where children are generated from the list of services (yp parameter).
Each service in yp generates (map method) a new ‘role’ xml element extending the ‘worker’
parent role.
77
Massimo Cossentino et al. 69–82
The following function contains the rule for generating the group specification corresponding
to a Solution as generated by the PMR algorithm.
def apply_rule__group_specification(sol: Solution): Elem = {
<group-specification id={get_group_id} min="0">
{apply_rule__group_roles(sol) ++ apply_rule__group_links(sol)}
</group-specification>
}
def apply_rule__group_roles(s: Solution): Elem = {
<roles>
<role id="manager" min="1" max="1"/>
{solution.wftasks.map(capability =>
<role id={capability.id + "_role"} min="1" max="1"/>
)}
</roles>
}
def apply_rule__group_links(s: Solution): Elem = {
<links>
<link from="manager" to="worker" type="authority"
extends-subgroups="false" bi-dir="false"
scope="intra-group"/>
<link from="worker" to="manager" type="acquaintance"
extends-subgroups="false" bi-dir="false"
scope="intra-group"/>
</links>
}
Briefly, the rule produces a ‘group-specification’ by applying two sub-rules: the first one is for
generating roles of the group; it is done by looking at the specific tasks of the input solution.
The PMR solution is an assembly of Capabilities which execution ensures full goal satisfaction.
Each of the involved Capabilities produces a new role into the group. Clearly, more agents of
the society could own the same Capability, being able of play that role. The second sub-rule is
to define structural links among these roles.
An interesting rule is that for generating the scheme, in the functional specification, corre-
sponding to a Solution.
def apply_rule__scheme(s: Solution): Elem = {
val sol_tree = new SolutionPattern(s)
val opt_tree: Option[WorkflowPattern] = sol_tree.get_tree
if (opt_tree.isDefined) {
val tree : WorkflowPattern = opt_tree.get
val capabilities = get_solution_capabilities(s)
val scheme_id = get_scheme_id
<scheme id={scheme_id}>
{
apply_rule__plan(tree)++
apply_rule__management_mission(scheme_id)++
capabilities.map(c=>apply_rule__mission(c))
}
</scheme>
} else {
<scheme id={get_scheme_id}>
</scheme>
}
}
The function uses the SolutionPattern class, responsible of identifying basic workflow patterns[16]
in the Solution. Figure 8 shows an example of translation applied to Figure 6. The translation
78
Massimo Cossentino et al. 69–82
workfow
Seq_1
1 2
prepare Loop_1
before check
Seq_2
1 2
discussion voting
Figure 8: Result of Solution Pattern transformation. This algorithm identifies some of the Workflow
Patterns [16] into a Solution, and it renders the workflow as a structured tree.
algorithm exploits the control-flow perspective of the solution in order to identify some basic
constructs: Sequence patterns, Choice patterns, Loop patterns.
Sequence Pattern. Description: a ‘sequence’ models consecutive steps in a workflow. Activities
A,B,C represent a sequence if the execution of B is enabled after the completion of A, and, the
execution of C is enabled after the completion of B.
Identification. The translation algorithm supposes the sequence is the default approach for
implementing a workflow.
Exclusive Choice Pattern. Description: a point in the workflow where the control may pass to
one among several branches, depending on the evaluation of a condition.
Identification. The translation algorithm supposes a split exclusive gateway starts an Exclusive
Choice pattern. Branches are identified as possible sequences that terminates either with the
same join exclusive gateway (Simple Merge pattern) or an end event.
Structured Cycle Pattern. Description: a point in the workflow where one or more activities
can be executed repeatedly.
Identification. The translation algorithm supposes a join exclusive gateway possibly begins a
loop, whereas it contains a ’before check’ sequence of activities until a split exclusive gateway
that provides at least one exit condition, and a loop condition that begins one or more ’after
check’ sequences that rolling back to the first split gateway.
Once the SolutionTree has been built (as in Figure 8), the apply_rule_scheme function easily
converts the tree structure into a MOISE ‘scheme’ via goals and plans. This requires the function
below:
def apply_rule__plan(pattern: WorkflowPattern) : Elem = {
pattern match {
case SequencePattern(children) =>
79
Massimo Cossentino et al. 69–82
<goal id={get_goal_id}>
<plan operator="sequence">
{children.map(c => apply_rule__plan(c))}
</plan>
</goal>
...
case ActivityPattern(task) =>
val id = task.grounding.capability.id
<goal id={id}></goal>
}
}
It is a recursive rule, that browse the tree structure and incrementally builds the ‘goal/plan’
decomposition. A SequencePattern is translated into a sequence ‘plan’, a ChoicePattern is
translated into a choice ‘plan’, whereas the Structured Cycle Pattern is a bit more articulated
composition of sequences and choices. The exit condition for the recursion is the Activity (i.e.
the leaves of the tree): each activity is translated into a simple ‘goal’ element.
Just to provide and example, the output of the previous rule application is reported below:
<functional-specification>
<scheme id="scheme1">
<goal id="root_goal">
<plan operator="sequence">
<goal id="prepare"></goal>
<goal id="goal_1">
<plan operator="sequence" type="maintain">
<goal id="goal_2">
<plan operator="sequence">
<goal id="discussion"></goal>
<goal id="voting"></goal>
</plan>
</goal>
<goal id="check_exit_goal_3"></goal>
</plan>
</goal>
</plan>
</goal>
<mission id="management_scheme1" min="1" max="1">
<goal id="root_goal"></goal>
</mission>
[...]
</scheme>
</functional-specification>
80
Massimo Cossentino et al. 69–82
conceived to provide system adaptation because it includes several alternative plans (schemes)
for pursuing goals. The approach is complemented by a tool for processing BPMN (XMI) code
and generating the MOISE organization specification code. The approach is based on a few
fundamental steps: 1) the automatic extraction of goals by processing the BPMN activities
and their dependencies, 2) the identification of the initial state for agents execution (and
solutions computation), 3) the extraction of the ontological vocabulary from goal definitions,
4) the calculation of one or more solutions for the achievement of process objectives by using
agents’ capabilities, 5) the generation of a MOISE organization composed of several alternative
schemes, one for each computed solution. Alternative schemes in the agent organization can
be selected according to performance criteria or to overcome a failure thus achieving some
system adaptation. The generation of the organization is supported by a tool that uses well
known workflow patterns to process the input BPMN XMI code and to generate the MOISE
specification.
The availability of different organization’s schemes allows to select the scheme (goal decom-
position tree and set of missions) that provide the best performance, according to the quality
attributes registered in the yellow pages. The approach also allows to replace the scheme that
is in execution with another one, in case of agent/service failures thus obtaining a runtime
adaptation feature.
So far, the tool supports the whole BPMN 2.0 specification for defining the process, but the
Sub-Process element, that is going to be used to create hierarchical groups. The language for
specifying Capabilities is a proprietary format. Very soon, we will move towards open-access
action specification languages (PPDL for instance). Currently, the tool has some limitations:
1) parallel gateways are understood by the BPMN2Goal parser but not supported in phase
of Goal2MOISE generation; 2) timer/clock events are partially supported because they are
translated into first-logic predicates that require the agent society uses a specific internal
synchronization mechanism.
References
[1] P. A. Buhler, J. M. Vidal, Towards adaptive workflow enactment using multiagent systems,
Information technology and management 6 (2005) 61–87.
[2] M. P. Singh, M. N. Huhns, Multiagent systems for workflow, Intelligent Systems in
Accounting, Finance & Management 8 (1999) 105–117.
[3] S. Ceri, P. Grefen, G. Sanchez, Wide-a distributed architecture for workflow manage-
ment, in: Research Issues in Data Engineering, 1997. Proceedings. Seventh International
Workshop on, IEEE, 1997, pp. 76–79.
[4] A. S. Rao, M. P. Georgeff, et al., Bdi agents: from theory to practice., in: ICMAS, volume 95,
1995, pp. 312–319.
[5] D.-S. Coalition, A. Ankolekar, M. Burstein, J. R. Hobbs, O. Lassila, D. Martin, D. McDermott,
S. A. McIlraith, S. Narayanan, M. Paolucci, et al., Daml-s: Web service description for the
semantic web, in: The Semantic Web-ISWC, Springer, 2002, pp. 348–363.
[6] O. Boissier, R. H. Bordini, J. F. Hübner, A. Ricci, A. Santi, Multi-agent oriented programming
with jacamo, Science of Computer Programming 78 (2013) 747–761.
81
Massimo Cossentino et al. 69–82
82
Session 3
Features of MAS: Robustness, Trust, Explain-
ability
Reinforcement Learning for Autonomous Agents
Exploring Environments: an Experimental
Framework and Preliminary Results
Nassim Habbash, Federico Bottoni and Giuseppe Vizzari
Department of Informatics, Systems and Communication (DISCo), University of Milano-Bicocca, Milan, Italy
Abstract
Reinforcement Learning (RL) is being growingly investigated as an approach to achieve autonomous
agents, where the term autonomous has a stronger acceptation than the current most widespread one.
On a more pragmatic level, recent developments and results in the RL area suggest that this approach
might even be a promising alternative to current agent-based approaches to the modeling of complex
systems. This work presents an investigation of the level of readiness of a state-of-the-art model to
tackle issues of orientation and exploration of a randomly generated environment, as a toy problem to
evaluate the adequacy of the RL approach to provide support to modelers in the area of complex systems
simulation, and in particular pedestrian and crowd simulation. The paper presents the adopted approach,
the achieved results, and discusses future developments on this line of work.
Keywords
agent-based modeling and simulation, reinforcement learning, complex-systems
1. Introduction
Reinforcement Learning (RL) [1] is being growingly investigated as an approach to implement
autonomous agents, where the acceptation of the term “autonomous” is closer to Russell and
Norvig’s [2] than the most widely adopted ones in agent computing. Russell and Norvig state
that:
A system is autonomous to the extent that its behavior is determined by its own
experience
A certain amount of initial knowledge (in an analogy to built-in reflexes in animals and
humans) is reasonable, but it should be sided by the ability to learn. RL approaches, reinvigorated
by the energy, efforts, and promises brought by the deep learning revolution, seems one of the
most promising ways to investigate how to provide an agent this kind of autonomy. On a more
pragmatic level, recent developments and results in the RL area suggest that this approach might
even be a promising alternative to current agent-based approaches to the modeling of complex
WOA 2020: Workshop “From Objects to Agents”, September 14–16, 2020, Bologna, Italy
" [email protected] (N. Habbash); [email protected] (F. Bottoni);
[email protected] (G. Vizzari)
0000-0002-7916-6438 (G. Vizzari)
© 2020 Copyright for this paper by its authors. Use permitted under Creative Commons License Attribution 4.0 International (CC BY 4.0).
CEUR
Workshop
Proceedings
http://ceur-ws.org
ISSN 1613-0073
CEUR Workshop Proceedings (CEUR-WS.org)
84
Nassim Habbash et al. 84–100
systems [3]: whereas currently behavioral models for agents are carefully hand crafted, often
following a complicated interdisciplinary effort involving different roles and types of knowledge,
as well as validation processes based on the acquisition and analysis of data describing the
studied phenomenon, RL could simplify this work, focusing on the definition of an environment
representation, the definition of a model for agent perception and action, and defining a reward
function. The learning process could, in theory, be able to explore the potential space of the
policies (i.e. agent behavioral specifications) and converge to the desired decision making model.
While the definition of a model of the environment, as well as agent perception and action, and
the definition of a reward function are tasks requiring substantial knowledge about the studied
domain and phenomenon, the learning process could significantly simplify modeler’s work, and
at the same time it could solve issues related to model calibration.
The present work is set in this scenario: in particular, we want here to explore the level
of readiness of state-of-the-art models to tackle issues of orientation and exploration of an
environment [4] by an agent that does not own prior knowledge about its topology. The
environment is characterised by the presence of obstacles, generated randomly, and by a target
for agent’s movement, a goal that must be reached while, at the same time, avoiding obstacles.
This represents a toy problem allowing us to investigate the adequacy of the RL approach to
support modelers in the area of complex systems simulation, and in particular pedestrian and
crowd simulation [5]. We adopted Proximal Policy Optimization (PPO) [6] and trained agents in
the above introduced type of environment: the achieved decision making model was evaluated
in new environments analogous to the ones employed for training, but we also evaluated the
adequacy of the final model to guide agents in different types of environment, less random and
more similar to human built environments (i.e. including rooms, corridors, passages) to start
evaluating if agents for simulating typical pedestrians could be trained through a RL approach.
2. Problem Statement
The main focus of this paper is automatic exploration of environments without a-priori knowl-
edge of their topology. This is modeled through a single-agent system, where an agent is
encouraged to look out for a target placed randomly in a semi-randomly generated environment.
This environment presents an arbitrary number of obstacles placed randomly on its space. The
environment can be seen as a rough approximation of natural, mountainous terrain, or artificial,
post-disaster terrain, such as a wrecked room. The agent can observe the environment through
its front-mounted sensors and move on the XY Cartesian plane. In order to solve the problem
of automatic exploration in an ever changing obstacle-ridden environment, the main task is to
generalize the exploration procedure, to achieve an agent able to explore different environments
from the ones it was trained on.
In this paper we develop a framework around this task using Reinforcement Learning. Sec-
tion 3 provides a definition of the agent, the environment and their interactions. Section 4 goes
through Reinforcement Learning and the specific technique adopted for this work. Section 5
provides an architecture to the system, with some details on the tools used. Section 6 reports
the experimental results obtained, and Section 7 provides some considerations on the work and
possible future developments.
85
Nassim Habbash et al. 84–100
Where 𝑛 is the number of LIDARs on the agent, 𝑥𝑖 represents the distance from a certain LI-
DAR to a colliding object in range, and 𝑜𝑖 is the type of said object, with 𝑜𝑖 ∈ {𝑜𝑏𝑠𝑡𝑎𝑐𝑙𝑒, 𝑡𝑎𝑟𝑔𝑒𝑡, ∅}.
The observations (or state) space is hence defined as 𝑆, the set of all possible states 𝑠.
The agent can also combine the actions, for example going forward-right while rotating coun-
terclockwise.
More formally, we can define the action space as:
Where 𝐹 𝑜𝑟𝑤𝑎𝑟𝑑, 𝑆𝑖𝑑𝑒 and 𝑅𝑜𝑡𝑎𝑡𝑖𝑜𝑛 represent the movement on the associated axes, and
their value can be either {−1, 0, 1}, where 0 represents no movement, and -1 and 1 represent
movement towards one or the other reference point on the axis.
86
Nassim Habbash et al. 84–100
Figure 1: Environment: the blue cube is the agent, the checkerboard pattern cubes are the obstacles and
the orange cube is the target. The environment is generated considering the distance between agent and
target (white line connecting both) and the minimum spawn distance (the white sphere around objects)
to ensure a parametric distribution between objects in the environment. The agent collects observations
through its LIDAR array (white rays exiting the agent). On the top are present the episode’s cumulative
reward on the left and the current number of collisions on the right.
4. Reinforcement Learning
In the past couple of years Reinforcement Learning has seen many successful and remarkable
applications in the robot and locomotive field, such as [7] and [8]. This approach provides many
benefits: experimentation can be done in a safe, simulated environment, and it’s possible to
87
Nassim Habbash et al. 84–100
train models through millions of iterations of experience to learn an optimal behaviour. In some
fields - such as robot movement - the RL approach currently outperforms classic heuristic and
evolutionary methods [1].
Reinforcement Learning is a technique where an agent learns by interacting with the envi-
ronment. The agent ought to take actions that maximize a reward, selecting these from its past
experiences (Exploitation) and completely new choices (Exploration), making this essentially a
trial-and-error learning strategy. After sufficient training, an agent can generalize an optimal
strategy, allowing itself to actively adapt to the environment and maximize future rewards.
Generally, an RL algorithm is composed of the following components:
1. A policy function, which is a mapping between the state space and the action space of
the agent
2. A reward signal, which defines the goal of the problem, and is sent by the environment
to the agent at each time-step
3. A value function, which defines the expected future reward the agent can gain from the
current and all subsequent future states
4. A model, which defines the behaviour of the environment
At any time, an agent is in a given states of the overall environment 𝑠 ∈ 𝑆 (that it should
be able to perceive; from now on, we can consider the state the portion of the environment
that is perceivable by the agent), and it can choose to take one of many actions 𝑎 ∈ 𝐴, to cause
a change of state to another one with a given probability 𝑃 . Taken an action 𝑎 chosen by an
agent, the environment returns a reward signal 𝑟 ∈ 𝑅 as a feedback on the goodness of the
action. The behaviour of the agent is regulated by what’s called a policy function 𝜋, which can
be defined as
𝜋Θ (𝑎|𝑠) = 𝑃 (𝐴𝑡 = 𝑎|𝑆𝑡 = 𝑠) (3)
and represents a distribution over actions given states at time 𝑡 with parameters Θ - in this case
the policy function is stochastic, as it maps over probabilities. Following is a brief introduction
to the two main algorithms used in this work.
88
Nassim Habbash et al. 84–100
gradient ascent the probability of taking the correct action will increase, while decreasing the
probabilities of the actions associated to negative advantage, in the other case. The main issue
with this vanilla policy gradient approach is that gradient ascent might eventually lead out of
the range of states where the current experience data of the agent has been collected, changing
completely the policy. One way to solve this issue is to update the policy conservatively, so
as to not move too far in one single update. This is the solution applied by the Trust Region
Policy Optimization algorithm [9], which forms the basis of PPO. PPO implements this update
constraint in its objective function through what it calls Clipped Surrogate Objective. First,
it defines a probability ratio between new and old policy 𝑟𝑡 (Θ), which tells if an action for
a state is more likely or less likely to happen after the policy update, and it is defined as
𝑟𝑡 (Θ) = 𝜋𝜋Θ (𝑎𝑡 |𝑠𝑡 ) . PPO’s loss function, is then defined as:
Θ𝑜𝑙𝑑 (𝑎𝑡 |𝑠𝑡 )
4.2. Curiosity
Reward sparseness is one of the main issues with RL. If an environment is defined with a sparse
reward function, the agent won’t get any feedback about whether its actions at the current time
step are good or bad, but only at the end of the episode, where it either managed to succeed
in the task or fail. This means that the reward signal is 0 most of the time, and is positive in
only few states and actions. One simple example is the game of chess: the reward could be
obtained only at the end of the match, but at the beginning, when the reward might be 10, 50,
100 time steps away, if the agent can’t receive feedback for its current actions it can only move
randomly until, by sheer luck, it manages to get a positive reward; long range dependencies
must then be learned, leading to a complicated and potentially overly long learning process.
There are many ways to solve the problem of reward sparseness, such as reward shaping, which
requires domain-specific knowledge on the problem, or intrinsic reward signals, additional
reward signals to mitigate the sparseness of extrinsic reward signals.
89
Nassim Habbash et al. 84–100
Curiosity [10] falls into the second category, and its goal is to make the agent actively seek out
and explore states of the environment that it would not explore. This is done by supplying the
default reward signal with an additional intrinsic component which is computed by a curiosity
module. This module is comprised of a forward model, which takes in 𝑠𝑡 and 𝑎𝑡 , and tries to
predict the features of next state the agent will find itself in Φ̂(𝑠𝑡+1 ). The more different this
value compared to the features of the real next state Φ(𝑠𝑡+1 ), the higher the intrinsic reward.
To avoid getting stuck into unexpected states that are produced by random processes non
influenced by the agent, the module is comprised of an inverse model, which takes Φ(𝑠𝑡 ),
Φ(𝑠𝑡+1 ) and tries to predict the action 𝑎ˆ𝑡 that was taken to get from 𝑠𝑡 to 𝑠𝑡+1 . By training
the encoder (Φ) together with the inverse model, it s possible to make it so that the feature
extracted ignore those states and events that are impossible to influence, retaining only features
actually influenced by the agent’s actions.
5. System Architecture
The system has been developed using Unity3D as the main simulation platform and ML-Agents
for Reinforcement Learning1 .
Unity3D is a well-established open-source game engine. It provides a lot of out-of-the-box
functionalities including tools to assemble a scene, the 3D engine to render it, a physics engine
to physically simulate object interaction under physical laws, and many plugins and utilities.
In Unity an object is defined as a GameObject, and it can have attached different components
according to necessity, such as RigidBodies for physical computations, Controllers for movement,
decision-making and elements of the learning system (Agent, Academy and others). An object’s
life-cycle starts with an initialization and then a cyclic refresh of its state, while the engine
provides handler methods for these phases for customizing them through an event-driven
programming.
Unity keeps track of time and events on a stratified pipeline: physics, game logic and scene
rendering logic are each computed sequentially and asynchronously:
1. Objects initialization.
2. Physics cycle (triggers, collisions, etc). May happen more than once per frame if the fixed
time-step is less than the actual frame update time.
3. Input events
4. Game logic, co-routines
5. Scene rendering
6. Decommissioning (objects destruction)
One notable caveat is that physics updates may happen at a different rate than game logic.
This, in a game development scenario is sometimes treated by buffering either inputs or events,
to result in smoother physical handling, while for more simulations in which a precise correspon-
dence between simulated and simulation time is necessary this might pose a slight inconvenience.
1
The project’s source code is available on Github: https://github.com/nhabbash/autonomous-exploration-agent.
90
Nassim Habbash et al. 84–100
Figure 2: Schematized system architecture, shows the main interactions between the actors in the
system
However, for the goals of the present work, this consideration does not represent a crucial
problem.
ML-Agents is an open-source Unity3D plugin that enables games and simulations to serve as
environments for training intelligent agents. It provides different implementations of state-of-
the-art Reinforcement Learning algorithms implemented in TensorFlow, including PPO and
Curiosity. ML-Agents comes with an SDK that can be integrated seamlessly into Unity and
provides utilities for controlling the agent(s) and environment.
91
Nassim Habbash et al. 84–100
Figure 3: Learning system: the agent receives the actions from the Brain interface, which communicates
with the Academy to send and receive observations and actions. The Academy communicates through
an external communicator to the ML-Agents back-end, which wraps over Tensorflow and holds the
various RL models involved, receiving training/inference data and returning the models outputs
according to its parameters, while the Academy works in tandem with the Brain to regulate
the learning process, acting as a hub routing information - whether it’s observations from the
environment or inferences made by the models - between the system and the RL algorithms
under the hood.
Once the training phase ends, ML-Agents generates a model file which can be connected to
the brain and used directly for inference. Figure 3 explains how exactly the learning system is
structured between Unity and ML-Agents.
• Extrinsic signal: the standard reward produced by the environment according to the
goodness of the agent’s actions
• Intrinsic signal: the Curiosity of the agent
The extrinsic signal presents some reward shaping, and is defined as: 𝑟 = 5 * 𝑐𝑡 − 𝑝. The 𝑝 term
stands for penalty, and is a negative reward formulated as 𝑝 = 𝑐𝑜 * 0.1 + 𝑡𝑖𝑚𝑒 * 0.001. Every
time the agent reaches a target, indicated by 𝑐𝑡 (target collisions), the episode ends, and the
positive reward is 5, while if it hits an obstacle, indicated by 𝑐𝑜 (obstacle collisions), it receives a
penalty of 0.1 for each collision. The agent is also penalized as time passes, receiving a 0.001
negative reward for each timestep, to incentive the agent to solve the task faster.
92
Nassim Habbash et al. 84–100
The intrinsic signal is the Curiosity module, which as section 4.2 goes through, provides an
additional reward signal to encourage the exploration of unseen states.
6. Experiments
Different scenarios for the analysis of the effectiveness of the proposed system have been
investigated.
The main differences between scenarios consist in:
1. Curriculum environment parameters
2. Penalty function
3. Observation source (LIDAR or camera)
4. Knowledge transferability to structured environments
Comparison between the scenarios is conducted on two aspects: the firsts depends on the
canonical RL charts built in training-time in order to define the reward, their trends over times,
their balance and other information about the system; the other aspect is an environmental
performance comparison, conducted through three performance measures pertaining to the
investigated setting, these being CPM (collisions per minute), measuring the mean number of
collisions made by the agent on obstacles, TPM (targets per minute), measuring the mean number
of goal targets successfully reached by the agent and CPT (collisions per target), measuring
the mean number of collisions the agents does before getting to a target. As models between
scenarios have been trained with varying curricula and environments, these measures estimate
the performance of every model on a shared environment, making comparison between the
models happen on the same plane and circumstances. This environmental performances have
been measured in a parallel fashion in order to gather more accurate data.
An interactive demo of the system is also available to allow visual comparison of the different
scenarios2 .
6.1. Baseline
The first experiment acts as a baseline for other variations, and was conducted on the following
parameters:
1. Static parameters:
Number of obstacles 10
Min spawn distance 2
Target distance 45
2
Demo at https://nhabbash.github.io/autonomous-exploration-agent/
93
Nassim Habbash et al. 84–100
The parameters in this setting generate fairly open environments with at most 10 obstacles.
The minimum distance between obstacles is 2 units, while the target spawns at a distance of 45
units, which is more then half of the environment size.
Table 1 shows how the model collides roughly 5 times per minute and manages to reach a
target about 4 and times per minute, making roughly 1.25 obstacles per target reached.
6.2. Curriculum
The second experiment implemented curriculum learning into the training pipeline. The
curriculum was structured in seven lessons scaling along with the cumulative reward. Following
are its settings:
1. Dynamic parameters:
94
Nassim Habbash et al. 84–100
Figure 4: Penalty comparison: standard is the penalty used in most settings in the project, Offset1 and
Offset2 are the penalties from the third experiment at different stages of difficulty, and the Cumulative
Reward lower limit shows the number of collision before the episode aborts: Offset1 can get out with at
most 5 collisions, Offset2 has a maximum of 3
As for the previous situation, the parameters generate a harder environment as the cumulative
reward increase, but this time the penalty function too increases in difficulty. The rationale of
this experiment is that, as the agent learns how to move to reach the target, the agent should
learn to not collide frequently, but instead just search in the environment for the target smoothly.
Figure 4 shows how the different penalty relate to each other and the Cumulative Reward lower
limit without considering time decrease (same in all penalties).
Table 1 shows how the model collides roughly 4.5 times per minute and manages to reach
a target about 3.9 and times per minute, making roughly 1.18 obstacles per target reached.
This model obtains results similar to the baseline, while staying below the performances the
curriculum model obtained. This may be due to the harsher penalty that does not give the
model time to adapt to an optimal policy.
95
Nassim Habbash et al. 84–100
Table 1
Comparison of performance of the different experimented training approaches.
Training approach CPM TPM CPT
Baseline 4,984 3,96 1,25
Curriculum 10,568 9,616 1,09
Hardpenalty 4,592 3,896 1,18
Camera 7,264 3,048 2,38
did not let the algorithm converge to an optimal policy. We must add that the choice not to
investigate a longer training phase is due to the fact that the need to analyse this heavier form
of input, that nonetheless might not necessarily be more informative, made the training much
more expensive in terms of computation time, so whereas the steps are less than in the other
experiments, the overall computation time for learning is very similar. The model manages to
reach a target with roughly 2.5 obstacles hits each time, but taking roughly 3 times as much as
the optimal curriculum model.
96
Nassim Habbash et al. 84–100
Table 2
Summary of the performance of the curriculum based model (achieved by training in random scenarios)
applied to structured environments.
Environment CPM TPM CPT
Rooms 7,2 1,8 4
Corridor 4,8 14,2 0,34
Corridor tight 29,6 2,2 13,45
Turn 10,4 10,4 1
Crossroad 23,4 9,6 2,44
the model learned during training in the chaotic environments transfer to other structured
environments, which consist in:
1. "Rooms", two rooms are linked by a tight space in a wall, the agent has to pass through
the opening to reach the target;
2. "Corridor" is a long environment - literally a corridor - that the agent has to run across to
reach the target;
3. "Corridor tight" is similar to the previous environment but tighter
4. "Turn" is a corridor including a 90° left turn
5. "Crossroad" represents two ways cross and the agent has either to go straight on, to turn
left or to turn right.
These environments tested the capability of the agent to follow directions and to look for the
target in every space of the scene.
The model does not perform as well as in every environments. This seems to be due the
strategy that the model has learned to be optimal for the resolution of the task at hand, seems to
be random exploration, and will be addressed later on. The agent seems able to follow a linear
path, if the environment is wide enough to allow it to stay away from the borders, it is apparent
comparing Corridor and Corridor Tight outcomes: the second experiment has less targets and
more collisions per minute then the first one. The model’s performances in Crossroad and Turn
are similar but, in the first case the agent has to change path more often then in the second one,
so collisions happen more frequently. Rooms experiment has low both TPM and CPM because
the agent tends to stay in the spawn room, without attempting to pass from the door.
97
Nassim Habbash et al. 84–100
7. Conclusions
The empirical results show a certain decoupling between the environmental measures and the
classical performance measures. Measuring performance in reinforcement learning settings is
well-known to be tricky, as not always cumulative rewards, policy losses and other low-level
measures are able to capture the effectiveness of the behaviour of the agent in the setting.
98
Nassim Habbash et al. 84–100
In the proposed setting, the experiments showed how curriculum learning can be an effective
solution for improving the generalizing capabilities of the model, improving significantly how
the agent behaves.
The proposed learning system shows that the policy that most commonly is converged
to is essentially a random search strategy: the agent randomly explores the environment to
find the target. This is demonstrated by the behaviours of the different models - to different
levels of performances - which shows the agent randomly moving between obstacles, revisiting
previously seen areas until he manages to get the target in the range of its sensors. This
is probably due to the random nature of the environment generation, as no two episodes
present the same environment, and as such the agent isn’t able to memorize the layout of the
environment (or portions of it), but is only able to generally try to avoid obstacles until the
targets comes into sight.
This consideration represents a reasonable way to interpret results in environments whose
structure is closer to the human built environment: whenever looking around to see if the target
is finally in sight and moving towards it is possible without excessive risk of hitting an obstacles,
the process yields good results, otherwise it leads to a failure. While this does not represent
a negative result per se, it is a clear warning that the learning procedure, the environments
employed to shape the learning process, can lead to unforeseen and undesirable results. It
must be stressed that, whereas this is a sort of malicious exploitation of a behavioural model
that was trained on some types of environments and that is being tested in different situations,
other state of the art approaches specifically devised and trained to achieve proper pedestrian
dynamics still do not produce results that are competitive with hand crafted models [11].
Possible future developments on the RL model side are:
1. Implement memory: adding memory to the agent (in the form of a RNN module) might
allow it to form a sort of experience buffer for the current episode and allows it to explore
the environment in a non-random fashion.
2. Rework the reward and penalty functions: the proposed reward and penalty are
pretty simplistic, a possible enhancement to the penalty could be implementing soft-
collisions, that is, scaling the negative reward obtained by the agent in a collision according
to the velocity of the collision - safe, soft touches can be allowed.
3. Compare different RL algorithms: different reinforcement learning algorithms (A3C,
DQN) might show different insights on the optimal way to implement intelligent agents
in the proposed setting.
On the other hand, a different training procedure, including specific environments aimed at
representing a sort of grammar of the built environment, that could be used to define a sort of
curriculum for training specifically pedestrian agents, should be defined to more specifically
evaluate the plausibility of the application of this RL approach to pedestrian modeling and
simulation.
References
[1] R. S. Sutton, A. G. Barto, Reinforcement Learning: an Introduction, MIT press Cambridge,
2018.
99
Nassim Habbash et al. 84–100
[2] S. J. Russell, P. Norvig, Artificial Intelligence: A Modern Approach (4th ed.), Pearson, 2020.
[3] S. Bandini, S. Manzoni, G. Vizzari, Agent based modeling and simulation: An informatics
perspective, Journal of Artificial Societies and Social Simulation 12 (2009) 4.
[4] D. Weyns, A. Omicini, J. Odell, Environment as a first class abstraction in multiagent
systems, Autonomous Agents Multi-Agent Systems 14 (2007) 5–30.
[5] G. Vizzari, L. Crociani, S. Bandini, An agent-based model for plausible wayfinding in
pedestrian simulation, Eng. Appl. Artif. Intell. 87 (2020). URL: https://doi.org/10.1016/j.
engappai.2019.103241. doi:10.1016/j.engappai.2019.103241.
[6] J. Schulman, F. Wolski, P. Dhariwal, A. Radford, O. Klimov, Proximal policy opti-
mization algorithms, CoRR abs/1707.06347 (2017). URL: http://arxiv.org/abs/1707.06347.
arXiv:1707.06347.
[7] N. Heess, D. TB, S. Sriram, J. Lemmon, J. Merel, G. Wayne, Y. Tassa, T. Erez, Z. Wang,
S. M. A. Eslami, M. A. Riedmiller, D. Silver, Emergence of locomotion behaviours in
rich environments, CoRR abs/1707.02286 (2017). URL: http://arxiv.org/abs/1707.02286.
arXiv:1707.02286.
[8] W. Yu, G. Turk, C. K. Liu, Learning symmetric and low-energy locomotion, ACM
Trans. Graph. 37 (2018) 144:1–144:12. URL: https://doi.org/10.1145/3197517.3201397. doi:10.
1145/3197517.3201397.
[9] J. Schulman, S. Levine, P. Abbeel, M. I. Jordan, P. Moritz, Trust region policy optimization,
in: F. R. Bach, D. M. Blei (Eds.), Proceedings of the 32nd International Conference on
Machine Learning, ICML 2015, Lille, France, 6-11 July 2015, volume 37 of JMLR Workshop
and Conference Proceedings, JMLR.org, 2015, pp. 1889–1897. URL: http://proceedings.mlr.
press/v37/schulman15.html.
[10] D. Pathak, P. Agrawal, A. A. Efros, T. Darrell, Curiosity-driven exploration by self-
supervised prediction, in: D. Precup, Y. W. Teh (Eds.), Proceedings of the 34th International
Conference on Machine Learning, ICML 2017, Sydney, NSW, Australia, 6-11 August 2017,
volume 70 of Proceedings of Machine Learning Research, PMLR, 2017, pp. 2778–2787. URL:
http://proceedings.mlr.press/v70/pathak17a.html.
[11] F. Martinez-Gil, M. Lozano, F. Fernández-Rebollo, Emergent behaviors and scalability
for multi-agent reinforcement learning-based pedestrian models, Simul. Model. Pract.
Theory 74 (2017) 117–133. URL: https://doi.org/10.1016/j.simpat.2017.03.003. doi:10.1016/
j.simpat.2017.03.003.
100
Neuro-symbolic Computation for XAI:
Towards a Unified Model
Giuseppe Pisanoa , Giovanni Ciattob , Roberta Calegaria and Andrea Omicinib
a
Alma AI – Alma Mater Research Institute for Human-Centered Artificial Intelligence, Alma Mater
Studiorum—Università di Bologna, Italy
b
Dipartimento di Informatica – Scienza e Ingegneria (DISI), Alma Mater Studiorum—Università di Bologna, Italy
Abstract
The idea of integrating symbolic and sub-symbolic approaches to make intelligent systems (IS) under-
standable and explainable is at the core of new fields such as neuro-symbolic computing (NSC). This work
lays under the umbrella of NSC, and aims at a twofold objective. First, we present a set of guidelines
aimed at building explainable IS, which leverage on logic induction and constraints to integrate symbolic
and sub-symbolic approaches. Then, we reify the proposed guidelines into a case study to show their
effectiveness and potential, presenting a prototype built on the top of some NSC technologies.
Keywords
XAI, Hybrid Systems, Neural Networks, Logical Constraining
1. Introduction
In the last decade, we have witnessed an unprecedented spread of artificial intelligence (AI) and
its related technologies [1]. The fields involved are manifold, ranging from autonomous driving
systems and expert systems to computer vision and reasoning systems—just to mention a few.
In all the aforementioned fields, AI is enabling artificial systems to act in a more intelligent,
efficient, and effective way.
Besides the many impactful achievements, some factors have emerged that can slow down
the further diffusion of AI technologies. A primary concern is related to the trustability of
intelligent systems (IS) leveraging on sub-symbolic AI—i.e., exploiting approaches such as deep
learning. Indeed, the resulting IS suffers from well-known problems of opaqueness, since humans
typically find very difficult to understand how sub-symbolic systems work.
The need to overcome opaqueness is one of the main goal of the research in eXplainable AI
(XAI) [2], essentially aimed at making AI systems more understandable and explainable. Some
of the most interesting XAI techniques are deeply rooted in symbolic AI—as representatives of
21𝑠𝑡 Workshop “From Objects to Agents” (WOA), September 14–16, 2020, Bologna, Italy
" [email protected] (G. Pisano); [email protected] (G. Ciatto); [email protected] (R. Calegari);
[email protected] (A. Omicini)
~ https://about.me/gciatto (G. Ciatto); http://robertacalegari.apice.unibo.it (R. Calegari);
http://andreaomicini.apice.unibo.it (A. Omicini)
0000-0003-0230-8212 (G. Pisano); 0000-0002-1841-8996 (G. Ciatto); 0000-0003-3794-2942 (R. Calegari);
0000-0002-6655-3869 (A. Omicini)
© 2020 Copyright for this paper by its authors. Use permitted under Creative Commons License Attribution 4.0 International (CC BY 4.0).
CEUR
Workshop
Proceedings
http://ceur-ws.org
ISSN 1613-0073 CEUR Workshop Proceedings (CEUR-WS.org)
101
Giuseppe Pisano et al. 101–117
a natural choice for building human-intelligible IS [3]. In fact, symbolic systems offer a human-
understandable representation of their internal knowledge and processes: so, integrating them
into sub-symbolic models – to promote transparency of the resulting system – is the most
prominent stimulus for new research fields such as neuro-symbolic computing (NSC) [4].
Our work lays under the umbrella of NSC, and its contribution is twofold. On the one hand, we
present a set of guidelines aimed at building explainable IS, even when they exploit sub-symbolic
techniques. The guidelines leverage on logic induction and logic constraints as the two main
techniques integrating symbolic and sub-symbolic approaches. In particular, logic induction
makes it possible to extract the knowledge from black-box ML-based predictors – typically,
the sub-symbolic part of an IS – offering a corresponding symbolic, logical representation.
Conversely, logic constraints are exploited to inject some logic knowledge into the black box,
thus restricting the numerical underlying model.
On the other hand, we reify the proposed guidelines into a case study to show their effec-
tiveness and potential. In particular, we present a prototype built over some promising NSC
technologies. The resulting system is then assessed to verify its capability of being adjusted
(i.e., debugged and fixed) in case some unexpected behaviour in the sub-symbolic part of the
system is revealed. Accordingly, we show how the prototype is correctly performing w.r.t. the
proposed guidelines.
The paper is structured as follows. Section 2 provides a brief overview of the field of symbolic
and sub-symbolic integration. It also includes the main related works on the use of a hybrid
system as a mean for explainability. In Section 3, we first present the guidelines for building
explainable systems; then, in Section 4 we discuss a possible instantiation of the proposed
guidelines. In Section 5, we proceed with the assessment of our prototype and the discussion of
results. Finally, Section 6 concludes the work.
2. Background
In the last years, deep and machine (ML) learning methods have become largely popular and
successful in real-world intelligent systems. However, their use raises the issue of understanding
and explaining their behaviour to humans. Neural networks in particular – which are the most
hyped and widely adopted approach within sub-symbolic AI – mostly suffer from the problem of
opaqueness: the way they obtain their results and acquire experience from data is unintelligible
to humans.
One of the proposed approaches addressing the explainability problem [2] is the hybridisation
of symbolic and sub-symbolic techniques [3]. An increasing number of authors recognises that
formal logic is capable of significantly improving humans’ understanding of data [5]. In their
view, in principle, an opaque system, combined with a symbolic model, can provide a significant
result in terms of transparency. Many researches start from these assumptions.
Among the others, the neuro-symbolic computing (NSC) field is a very recent and promising
research area whose ultimate goal is to make symbolic and sub-symbolic AI techniques effort-
lessly work together. Due to the freshness of the topic, however, a well-established and coherent
theory of NSC is still missing. For this reason, a variety of methods have been proposed so far,
focusing on a multitude of aspects not always addressing interpretability and explainability
102
Giuseppe Pisano et al. 101–117
as their major concern. Nevertheless, some attempts to categorise XAI-related existing works
under the NSC umbrella exist [4, 3], which provide for a helpful overview of the topic.
Despite NSC does not explicitly include XAI among its primary goals, in this paper we
borrow some ideas from the NSC field to show how the explainability of modern IS may benefit
from the integration of symbolic and sub-symbolic AI. In particular, our work focuses on
two main NSC sub-fields: namely, the logic as a constraint, for the constraining module, and
differentiable programming for the induction module—since the proposed prototype exploits
logic induction via differentiable programming [6]. In short, the former line of research aims
at constraining the training process of a sub-symbolic predictor in such a way that it cannot
violate the superimposed constraint at runtime. About the latter, differentiable programming is
the combination of neural networks approaches with algorithmic modules in an end-to-end
differentiable model, often exploiting optimisation algorithms like gradient descent [7].
Within the scope of logic as a constraint, most approaches exploit some sort of logic formulæ
to constrain the behaviour of the sub-symbolic predictor—in most cases, a neural network.
This formula is then vectorised – i.e. translated into a continuous function over vectors of real
numbers – and exploited as a regularisation term in the loss function used for training the sub-
symbolic predictor [8, 9, 10]. Different strategies have been proposed to this end. For example,
in [11] the symbolic constraints are used to modify the network structure incorporating them
into the training process. In the general case, however, logic constraining can be used to fix bias
or bugs in the behaviour of a sub-symbolic system, or, it can mitigate the situation in which
poor training data is available to correctly train a black-box system on a specific aspect.
With respect to the second research area, some works laying under the umbrella of differ-
entiable programming fruitfully intertwine ML and inductive logic programming (ILP) [12] to
provide logic induction capabilities on top of sub-symbolic predictors. ILP is a well established
research area, laying at the intersection of ML and logic programming, which is strongly in-
terrelated with NSC. An ILP system is a tool able to induce (i.e., derive) – given an encoding
of some background knowledge and a set of positive and negative examples represented logic
facts –, a logic program that entails all the positive and none of the negative examples. While
traditionally these systems base their operation on the use of complex algorithms as their core
component [13] – deeply undermining their efficiency and usability – hybrid approaches exist
leveraging NSC to make the induction process more efficient [6]. Furthermore, as we show in
this paper, induced logic rules can be used as a means to inspect what a black-box predictor has
learned—as induction makes the predictor knowledge explicit in symbolic form.
103
Giuseppe Pisano et al. 101–117
only from the training data is not sufficient to acquire the knowledge required to explain the
entire network behaviour. That would lead to a system giving explanations according to the
network optimal functioning, not accounting for the training errors. Moreover, according to
these models, also the constraining part should be driven by the rules inferred from the training
data, hardly limiting the potential of those techniques. Indeed, the possibility for users to
impose their own rules would also give them the ability to mitigate the errors derived from an
incomplete or incorrect training set.
The work presented here aims at building a model overcoming both these limitations. As
for the explanations’ coherence problem, the use of the black box as a data source in the logic
induction process should guarantee the correct correlation between the black box itself and the
derived logic theory. Furthermore, logic can be leveraged so as to combine the IS with the user
experience and knowledge, thus exploiting all the advantages of the constraining techniques.
3.1. Desiderata
Regardless of the architectural and technological choices performed by designers and developers,
the IS adhering to our model are characterised by several common desiderata (Di ) w.r.t. their
overall functioning and behaviour. Generally speaking, these are aimed at making IS both
prediction-effective and explainable. Indeed, following this purpose, IS should
104
Giuseppe Pisano et al. 101–117
3.2. Modelling
Generally speaking, we model an explainable, hybrid IS as composed by a black box, a knowledge
base (KB) and an automatic logic reasoner, as depicted in Figure 1. Explainable recommendations
or suggestions are provided to the end-user via the logic reasoner – based on symbolic rules
and facts included in the KB by domain experts – and via black-box predictions—based on data.
Accordingly, the reasoner combines several sorts of inference mechanisms (e.g. deduction and
induction). Furthermore, to balance the knowledge coming from data with the domain experts
knowledge, the model exploits induction and constraining techniques to improve the black box
with the logical knowledge and vice-versa.
The black-box module is the core of the IS, making it capable of mining effective information
from data. Any sub-symbolic model providing high predictive performances – e.g. neural net-
works, SVM, generalised linear models, etc. – can be used for the module implementation. This,
however, may bring opaqueness-related issues. Thus, the black-box module is complemented
with the other two modules to provide explanation and debugging facilities.
The reasoner module is aimed at providing explainable outcomes to the end-users. In par-
ticular, explanations are given in terms of logic KB, capable of approximating the black box.
The construction of the logic KB relies on the induction capabilities offered by this module.
More precisely, the outcomes generated by the black box are exploited to build a logic theory,
mimicking the work of the black-box predictor with the highest possible fidelity. An inductive
105
Giuseppe Pisano et al. 101–117
process is then fed with the resulting extended theory. This leads to a theory containing a
number of general relations, which can be exploited to provide intelligible information to the
end-users. The described workflow supports explainability in two ways: (i) it provides a global
explanation of how the black box works in terms of general relations that must always hold;
(ii) it provides local explanations, justifying each black-box conclusion by enabling the use of
deductive reasoning on the connected logical knowledge. In other words, this mechanism is
what enables IS to be interpretable and debuggable by users. Finally, the KB module aims at
storing the logical knowledge approximating the black-box behaviour. The knowledge can be
modified by domain experts. When this is the case, it becomes of paramount importance to
keep the black-box module coherent with the human-proposed edits. To this end, constraining
is performed to align the black-box behaviour with the KB. This mechanism is what enables IS
to be fixed by users.
In the reminder of this section, we delve deeper into the details of these mechanisms.
106
Giuseppe Pisano et al. 101–117
framework presented in [16, 17], logic induction is a means for explaining the functioning
of a black-box predictor via symbolic rules. More precisely, induction is fundamental for the
debuggability of our model. For example, it enables the discovery of fallacies in the learning
process of a black box even for people not used to the specific domain.
In our model, the induction process is fed with both the raw data and the outcomes of the
black box. In the former case, induction leads to the unveiling of latent relations possibly buried
in the original data: we refer to the logic theory obtained as the reference theory. In the latter
case, induction leads to a symbolic approximation of the knowledge the black box has acquired
from data via ML: we refer to the logic theory obtained as explanation theory. Assuming the
soundness of the induction process, discrepancies between these two theories could reveal
some possible rules that have not been correctly learned by the sub-symbolic model. It is then
possible to fix it by enforcing the correct relations via logic constraining.
Finally, one last point is worth to be discussed. Unless the induction process possesses the
same learning capabilities of the black box, it is impossible to detect all its learning errors. In
this case, in fact, the reference theory would be the optimal solution itself, and the sub-symbolic
model would be useless. As the induction process aims at opening the box, its use on the raw
data aims at providing insights on the accuracy of the training phase. Thus, it does not aim at
providing an optimal solution.
3.3. Guidelines
In the following, we discuss the main aspects to be considered when designing a system
conforming to our model. As a first step in this direction, we first handle some important
aspects concerning data representation.
107
Giuseppe Pisano et al. 101–117
For our model to be effective, the selected logic formalism should provide high flexibility
in the description of the domain. At the same time, to keep a system as simple as possible, it
should be coherent in every part of it: from the constraining module to the induction one, every
part should share the same representation of the logical knowledge.
Of course, this procedure adds a whole range of new problems related to the accuracy of the
features extracted. In fact, the explanation process is mainly linked to the reliability of the
data used as the basis for the induction process. The exploitation of data generated through an
automatic process makes a discrepancy between the data extrapolated by the inductive process
and the behaviour of the black box more likely.
108
Giuseppe Pisano et al. 101–117
4. Technological architecture
This subsection provides a technological description of an IS prototype adhering to our model.
It is based on the concrete architecture detailed in Figure 2, which specialises the abstract model
from Figure 1 through a number of technological commitments.
First, we present our choices in relation to the points examined in Subsection 3.3. As for the
type of logic, within the scope of this paper, we adopt first-order logic (FOL) as our formalism
of choice, and Prolog as our reference concrete language. FOL is likely to offer the best trade-off
between flexibility and expressiveness of the representation language. Furthermore, the choice
of FOL enables the exploitation of many existing approaches supporting both conditioning and
induction. Finally, the choice of the Prolog syntax enables the direct exploitation of the induced
theories within existing automatic reasoners—e.g. tuProlog, SWI-Prolog, etc.
As far as the sort of the data is concerned, in this paper we only describe a prototype based
on structured data. In fact, the feature extraction module can be omitted without hindering
the generality of our approach. Moreover, the greater simplicity in the data helps to avoid the
109
Giuseppe Pisano et al. 101–117
problems related to the possible information loss due to their transformation. In the future,
however, we plan to extend our prototype to support arbitrary datasets including any sort of
data. This requires the creation of a module for feature extraction.
In terms of the sort of the black-box used, we focus on a prototype based on neural networks,
being them the most critical from the opacity perspective. The remaining technological choices
derive consequently.
The prototype exploits two main technologies: DL2 [9] for the conditioning part, and
NTP [6][20] for the induction part. DL2 is one of those models leveraging on symbolic rules
vectorisation as means to constrain the target neural network. We choose DL2 as the most
mature and user-friendly technology supporting neural-network constraining through logic
rules.
The choice of NTP as the induction engine is more straightforward. Indeed, NTP is among
the few ready-to-use technologies offering both deductive and inductive logic capabilities
in a differentiable way. On the one hand, differentiability is what makes induction more
computationally efficient w.r.t. similar technologies—and this is why we choose it. On the other
hand, NTP deductive capabilities are not mature enough. In fact, training a model correctly
approximating a logic theory in a reasonable amount of time is very challenging—especially
when the complexity of the theory grows. While this could be acceptable for the induction
process, it is still very limiting for deductive reasoning. Moreover, traditional logic engines
combine a very large ecosystem of supporting tools – IDEs, debuggers, libraries – that have
potential to hugely improve the effectiveness of the reasoning phase. For this reason, we adopt
tuProlog (2P) [21] – a Java-based logic engine built for use in ubiquitous contexts – as the main
tool for the manipulation of logic theories, as well for automated reasoning. This choice is
motivated by its reliability, modularity, and flexibility.
While the entire system is built around the aforementioned technologies, Python is used as the
glue language to keep modules together. In particular, the sub-symbolic module is implemented
via the PyTorch learning framework [22], thus ensuring an easy integration with DL2—which
is natively built to work with this framework. The modules responsible for the extraction of the
Prolog theory from the input dataset (i.e. the Translator block in Figure 2) are created using
Python as well. The NTP integration takes place through the Prolog logic language. In fact,
NTP easily allows the use of Prolog theories as input for the induction process. The result of
the induction phase is also delivered in a logical form, allowing for an easy consultation and
analysis through the 2P technology.
5. Assessment
In this section we assess our model from the explainability perspective leveraging on the
prototype implementation described in Section 4. Particularly, we train the sub-symbolic module
through a real-world ML problem, and we test whether and to what extent our architecture
actually provides (i) the capability of building a logical representation of sub-symbolic knowledge
acquired from data via induction, (ii) the capability of altering or fixing the system behaviour
via conditioning, and, ultimately, (iii) the inspectability and debuggability of the system as a
whole. In the following subsections we set up an ad-hoc experiment aimed at performing these
110
Giuseppe Pisano et al. 101–117
(a) Network default training (b) Decision tree built on test data
Figure 3: Network default training (a) and decision tree built on test data (b).
1. a neural network is trained until reaching maximum validation-set accuracy for the
classification task;
2. by combining the training data and the predictions of the network, a coherent Prolog
theory is extracted;
3. the induction module is used to extract the latent relations from the theory, until at least
one relation which properly divides the data is found;
4. through constraining, we inject an error in the network, in such a way that it misclassify
some instances;
5. by repeating Item 2 and Item 3, we show that the approximated logic theory reveals the
injected error.
This workflow lets us verify the behaviour of our prototype and of all its components. In
particular, Item 3 and Item 5 aim at demonstrating that a logic theory that optimally approximates
a neural network is actually attainable. In terms of the ability of debugging and correcting a
network, the whole procedure aims at demonstrating their feasibility. The extraction of the
correct theory in the initial part of the experiment is comparable to the one extracted from
111
Giuseppe Pisano et al. 101–117
a malfunctioning classifier. The inclusion of the fake constraint, as well as its recognition in
the theory extracted at the conclusion of the experiment, shows the feasibility of the network
correction process.
Two fundamental points are worth to be taken into account for the experiment to be mean-
ingful. The first point is the ability to accurately evaluate the accuracy of the logic theory
recovered. In fact, in order to verify that the theory extracted from the neural network is
actually the correct one, it is either necessary (i) to have an optimal knowledge of the domain,
or (ii) to use easily analysable and verifiable datasets. As for the first case – being an expert of
the analysed domain – it turns out to be very easy, by verifying the correctness of the logical
relations. The only alternative comes from the usage of an easily verifiable dataset as the base
for the experiment. Indeed, it should be possible also for a domain novice to understand the
ratio behind the data. For instance, a simple way to verify the correctness of the rules is to use
an alternative ML tool – one that can guarantee a high level of transparency – to analyse the
data. In the case of a classifier, the best choice could be a decision tree (DT). In fact, DTs training
produces a symbolic model that can be efficiently verified by the user. Hence, DT output can be
used as a reference in the evaluation of the induction results.
The second point is the exploitation of constraining as a means to inject bugs into a network
in a controlled way. In fact, in order to verify the prototype capability of revealing and correcting
bugs in the black-box module, it is first necessary to construct a buggy network. However, in
case of a poorly training, as in that case, it can not be clear where the bug is. Hence, to evaluate
the actual capabilities of the prototype, the bugs to be spotted must be a priori known in order
to have a reference.
1
https://archive.ics.uci.edu/ml/datasets/Congressional+Voting+Records
2
https://github.com/Gilbocc/NSC4ExplainableAI
112
Giuseppe Pisano et al. 101–117
5.3. Results
The training of the aforementioned neural network is performed via ordinary stochastic gradient
descent until reaching a 95% accuracy score on the validation set (containing a randomly selected
20% of whole data). The training process is depicted in Figure 3a.
Through the induction process on the data generated by the network it was possible to recover
the following relationships:
𝑑𝑒𝑚𝑜𝑐𝑟𝑎𝑡(𝑋1 , . . . , 𝑋𝑁 ) :-
𝑜𝑝𝑝𝑜𝑠𝑒𝑃 ℎ𝑦𝑠𝑖𝑐𝑖𝑎𝑛𝐹 𝑒𝑒𝐹 𝑟𝑒𝑒𝑧𝑒(𝑋1 , . . . , 𝑋𝑁 ),
𝑠𝑢𝑝𝑝𝑜𝑟𝑡𝑀 𝑥𝑀 𝑖𝑠𝑠𝑖𝑙𝑒(𝑋1 , . . . , 𝑋𝑁 ),
𝑠𝑢𝑝𝑝𝑜𝑟𝑡𝐵𝑢𝑑𝑔𝑒𝑡𝑅𝑒𝑠𝑜𝑙𝑢𝑡𝑖𝑜𝑛(𝑋1 , . . . , 𝑋𝑁 ).
𝑑𝑒𝑚𝑜𝑐𝑟𝑎𝑡(𝑋1 , . . . , 𝑋𝑁 ) :-
𝑜𝑝𝑝𝑜𝑠𝑒𝑃 ℎ𝑦𝑠𝑖𝑐𝑖𝑎𝑛𝐹 𝑒𝑒𝐹 𝑟𝑒𝑒𝑧𝑒(𝑋1 , . . . , 𝑋𝑁 ),
𝑠𝑢𝑝𝑝𝑜𝑟𝑡𝐵𝑢𝑑𝑔𝑒𝑡𝑅𝑒𝑠𝑜𝑙𝑢𝑡𝑖𝑜𝑛(𝑋1 , . . . , 𝑋𝑁 ).
𝑟𝑒𝑝𝑢𝑏𝑙𝑖𝑐𝑎𝑛(𝑋1 , . . . , 𝑋𝑁 ) :-
𝑠𝑢𝑝𝑝𝑜𝑟𝑡𝑃 ℎ𝑦𝑠𝑖𝑐𝑖𝑎𝑛𝐹 𝑒𝑒𝐹 𝑟𝑒𝑒𝑧𝑒(𝑋1 , . . . , 𝑋𝑁 ),
𝑜𝑝𝑝𝑜𝑠𝑒𝐴𝑛𝑡𝑖𝑆𝑎𝑡𝑒𝑙𝑙𝑖𝑡𝑒𝑇 𝑒𝑠𝑡𝐵𝑎𝑛(𝑋1 , . . . , 𝑋𝑁 ).
𝑟𝑒𝑝𝑢𝑏𝑙𝑖𝑐𝑎𝑛(𝑋1 , . . . , 𝑋𝑁 ) :-
𝑠𝑢𝑝𝑝𝑜𝑟𝑡𝑃 ℎ𝑦𝑠𝑖𝑐𝑖𝑎𝑛𝐹 𝑒𝑒𝐹 𝑟𝑒𝑒𝑧𝑒(𝑋1 , . . . , 𝑋𝑁 ),
𝑜𝑝𝑝𝑜𝑠𝑒𝐴𝑛𝑡𝑖𝑆𝑎𝑡𝑒𝑙𝑙𝑖𝑡𝑒𝑇 𝑒𝑠𝑡𝐵𝑎𝑛(𝑋1 , . . . , 𝑋𝑁 ),
𝑜𝑝𝑝𝑜𝑠𝑒𝐵𝑢𝑑𝑔𝑒𝑡𝑅𝑒𝑠𝑜𝑙𝑢𝑡𝑖𝑜𝑛(𝑋1 , . . . , 𝑋𝑁 ),
𝑜𝑝𝑝𝑜𝑠𝑒𝑆𝑦𝑛𝑓 𝑢𝑒𝑙𝑠𝐶𝑢𝑡𝑏𝑎𝑐𝑘(𝑋1 , . . . , 𝑋𝑁 ).
To verify their validity we can examine the DT generated using the original data as source
(Figure 3b)—the C4.5 algorithm has been used. As expected, the inductive process managed
to recover the relationship that most discriminates between Democrats and Republicans: the
tendency of the Democrats to be against the freezing of the cost of medical expenses.
The verification of the correction process is based on the reversal of the relationship retrieved
above. Formally, the conditioning of the network occurred on this rule:
𝑟𝑒𝑝𝑢𝑏𝑙𝑖𝑐𝑎𝑛(𝑋1 , . . . , 𝑋𝑁 ) :-
𝑜𝑝𝑝𝑜𝑠𝑒𝑃 ℎ𝑦𝑠𝑖𝑐𝑖𝑎𝑛𝐹 𝑒𝑒𝑠𝐹 𝑟𝑒𝑒𝑧𝑒(𝑋1 , . . . , 𝑋𝑁 ).
In natural language, this Prolog rule expresses that, given a set of votes (𝑋1 , . . . , 𝑋𝑁 ), if these
share the opposition to the freezing of medical expenses, then the voter is likely from the
Republican Party. This constraint translates into a very simple result: all the votes should
belong to Republicans. Indeed, if initially only the Democrats were against the freezing, by
forcing the network to consider them as Republicans, we reach a situation where the whole set
of voters is Republican.
More in detail, constraining rules are codified through the DSL offered by the D2L implemen-
tation. For example, the above rule can be expressed in the form:
dl2.Implication(
dl2.EQ(x[FeesFreeze], 0),
dl2.LT(y[Dem], y[Rep]))
113
Giuseppe Pisano et al. 101–117
Table 1
Training with fake constraint results.
This rule is then automatically converted in a numerical function. Its evaluation contributes to
the final loss function adopted by the target neural network.
For the experiment, a completely-new network is trained considering the new constraint. The
results in Table 1 show the effect of the constraint on the network. The Democrats/Republican
imbalance – which is made evident by Table 1 – reflects in the result of the induction process
on the data generated by the constrained network:
𝑟𝑒𝑝𝑢𝑏𝑙𝑖𝑐𝑎𝑛(𝑋1 , . . . , 𝑋𝑁 ) :-
𝑠𝑢𝑝𝑝𝑜𝑟𝑡𝑀 𝑥𝑀 𝑖𝑠𝑠𝑖𝑙𝑒(𝑋1 , . . . , 𝑋𝑁 ),
𝑜𝑝𝑝𝑜𝑠𝑒𝑃 ℎ𝑦𝑠𝑖𝑐𝑖𝑎𝑛𝐹 𝑒𝑒𝐹 𝑟𝑒𝑒𝑧𝑒(𝑋1 , . . . , 𝑋𝑁 ).
𝑟𝑒𝑝𝑢𝑏𝑙𝑖𝑐𝑎𝑛(𝑋1 , . . . , 𝑋𝑁 ) :-
𝑠𝑢𝑝𝑝𝑜𝑟𝑡𝑃 ℎ𝑦𝑠𝑖𝑐𝑖𝑎𝑛𝐹 𝑒𝑒𝐹 𝑟𝑒𝑒𝑧𝑒(𝑋1 , . . . , 𝑋𝑁 ),
𝑜𝑝𝑝𝑜𝑠𝑒𝐵𝑢𝑑𝑔𝑒𝑡𝑅𝑒𝑠𝑜𝑙𝑢𝑡𝑖𝑜𝑛(𝑋1 , . . . , 𝑋𝑁 ),
𝑜𝑝𝑝𝑜𝑠𝑒𝑀 𝑥𝑀 𝑖𝑠𝑠𝑖𝑙𝑒(𝑋1 , . . . , 𝑋𝑁 ).
𝑟𝑒𝑝𝑢𝑏𝑙𝑖𝑐𝑎𝑛(𝑋1 , . . . , 𝑋𝑁 ) :-
𝑜𝑝𝑝𝑜𝑠𝑒𝑃 ℎ𝑦𝑠𝑖𝑐𝑖𝑎𝑛𝐹 𝑒𝑒𝐹 𝑟𝑒𝑒𝑧𝑒(𝑋1 , . . . , 𝑋𝑁 ),
𝑠𝑢𝑝𝑝𝑜𝑟𝑡𝐵𝑢𝑑𝑔𝑒𝑡𝑅𝑒𝑠𝑜𝑙𝑢𝑡𝑖𝑜𝑛(𝑋1 , . . . , 𝑋𝑁 ),
𝑠𝑢𝑝𝑝𝑜𝑟𝑡𝐴𝑛𝑡𝑖𝑆𝑎𝑡𝑒𝑙𝑙𝑖𝑡𝑒𝑇 𝑒𝑠𝑡𝐵𝑎𝑛(𝑋1 , . . . , 𝑋𝑁 ),
𝑠𝑢𝑝𝑝𝑜𝑟𝑡𝑀 𝑥𝑀 𝑖𝑠𝑠𝑖𝑙𝑒(𝑋1 , . . . , 𝑋𝑁 ).
The inducted knowledge base only contains rules concerning the Republican wing, thus con-
firming the footprint of the relation imposed during the conditioning process.
Summarising, the results of the assessment are positive. It was first possible to obtain the
relationships implied in the operation of the classifier in a logic form. By these rules has been
possible (i) to identify the more discriminant features in the dataset; (ii) to enable the correction
of the black box using the user knowledge. The constraining part has also demonstrated effective.
Indeed, the imposition of the user-crafted rule has led to a coherent change in the black-box
behaviour—enabling its correction. The results demonstrate how the presented guidelines lead
to an IS giving explanations about its functioning, thus allowing the user intervention on its
behaviour.
114
Giuseppe Pisano et al. 101–117
6. Conclusions
The solutions proposed so far in the literature to the opaqueness issue – one of the main problem
of today AI technologies – are disparate. In this work, we showed how symbolic logic can be a
crucial element in this panorama.
On the trails of the NSC models, we presented a series of guidelines aimed at correctly
integrating a ML-based predictor – i.e., a black box – with a logic-based subsystem. In particular,
our guidelines support the creation of IS exposing clear insights about their own functioning,
thus enabling end users to intervene on the IS behaviour via a logical interface. We then tested
our guidelines against a prototype IS, in order to study if and to what extent our approach
is feasible and useful. Notably, the prototype assessment confirms our approach is feasible
exploiting technologies already available in the research scene. Nevertheless, the prototype
has been tested only on a single scenario. In order to confirm the efficacy of our approach, we
need to perform a more exhaustive range of experiments. Moreover, we plan to extend the
prototype assessment with more complex use-cases. For example, as anticipated in Section 4,
we intend to enhance the prototype with the support for unstructured data. This extension
would considerably improve the applicability of the studied approach, allowing its assessment
also on the more complex area of image classification.
Through the above experimental investigation – in the case of more positive results – we aim
at introducing a rigorously formalised version of the proposed model—presented in this paper
in a more intuitive and preliminary shape. Consequently, we should also better investigate and
verify the preliminary guidelines provided. We aim at obtaining an accurate and comprehensive
guide that would allow developers efficiently integrating opaque AI systems and logic.
References
[1] J. Bughin, E. Hazan, S. Ramaswamy, M. Chui, T. Allas, P. Dahlstrom,
N. Henke, M. Trench, Artificial intelligence: the next digital fron-
tier?, Discussion paper, McKinsey Global Institute, 2017. URL: https:
//www.mckinsey.com/~/media/mckinsey/industries/advancedelectronics/
ourinsights/howartificialintelligencecandeliverrealvaluetocompanies/
mgi-artificial-intelligence-discussion-paper.ashx.
[2] A. B. Arrieta, N. D. Rodríguez, J. D. Ser, A. Bennetot, S. Tabik, A. Barbado, S. García,
S. Gil-Lopez, D. Molina, R. Benjamins, R. Chatila, F. Herrera, Explainable artificial intelli-
gence (XAI): concepts, taxonomies, opportunities and challenges toward responsible AI,
Information Fusion 58 (2020) 82–115. doi:10.1016/j.inffus.2019.12.012.
[3] R. Calegari, G. Ciatto, A. Omicini, On the integration of symbolic and sub-symbolic tech-
niques for XAI: A survey, Intelligenza Artificiale 14 (2020) 7–32. doi:10.3233/IA-190036.
[4] A. S. d’Avila Garcez, M. Gori, L. C. Lamb, L. Serafini, M. Spranger, S. N. Tran, Neural-
symbolic computing: An effective methodology for principled integration of machine
learning and reasoning, FLAP 6 (2019) 611–632. URL: https://arxiv.org/abs/1905.06088.
[5] S. H. Muggleton, U. Schmid, C. Zeller, A. Tamaddoni-Nezhad, T. Besold, Ultra-strong
115
Giuseppe Pisano et al. 101–117
116
Giuseppe Pisano et al. 101–117
12175 of Lecture Notes in Computer Science, Springer, Cham, 2020, pp. 3–20. doi:10.1007/
978-3-030-51924-7_1, Second International Workshop, EXTRAAMAS 2020, Auckland,
New Zealand, May 9–13, 2020, Revised Selected Papers.
[17] G. Ciatto, D. Calvaresi, M. I. Schumacher, A. Omicini, An abstract framework for agent-
based explanations in AI, in: 19th International Conference on Autonomous Agents and
MultiAgent Systems (AAMAS 2019), International Foundation for Autonomous Agents
and Multiagent Systems, 2020, pp. 1816–1818. Extended Abstract.
[18] X. Wu, V. Kumar, J. R. Quinlan, J. Ghosh, Q. Yang, H. Motoda, G. J. McLachlan, A. F. M.
Ng, B. Liu, P. S. Yu, Z. Zhou, M. S. Steinbach, D. J. Hand, D. Steinberg, Top 10 algorithms
in data mining, Knowledge and Information Systems 14 (2008) 1–37. doi:10.1007/
s10115-007-0114-2.
[19] R. Andrews, J. Diederich, A. B. Tickle, Survey and critique of techniques for extracting
rules from trained artificial neural networks, Knowledge-Based Systems 8 (1995) 373–389.
doi:10.1016/0950-7051(96)81920-4.
[20] M. de Jong, F. Sha, Neural theorem provers do not learn rules without exploration, CoRR
abs/1906.0 (2019). URL: http://arxiv.org/abs/1906.06805.
[21] E. Denti, A. Omicini, A. Ricci, tuProlog: A light-weight Prolog for internet applications
and infrastructures, in: Lecture Notes in Computer Science, volume 1990, Springer Verlag,
2001, pp. 184–198. doi:10.1007/3-540-45241-9_13.
[22] A. Paszke, S. Gross, F. Massa, A. Lerer, J. Bradbury, G. Chanan, T. Killeen, Z. Lin,
N. Gimelshein, L. Antiga, A. Desmaison, A. Köpf, E. Yang, Z. DeVito, M. Raison, A. Te-
jani, S. Chilamkurthy, B. Steiner, L. Fang, J. Bai, S. Chintala, Pytorch: An impera-
tive style, high-performance deep learning library, in: H. M. Wallach, H. Larochelle,
A. Beygelzimer, F. d’Alché-Buc, E. B. Fox, R. Garnett (Eds.), Advances in Neural In-
formation Processing Systems 32: Annual Conference on Neural Information Process-
ing Systems 2019, NeurIPS 2019, 2019, pp. 8024–8035. URL: http://papers.nips.cc/paper/
9015-pytorch-an-imperative-style-high-performance-deep-learning-library.
[23] D. Dua, C. Graff, UCI machine learning repository, 2017. URL: http://archive.ics.uci.edu/ml.
117
Session 4
Healthcare
A Multi-Agent System for Simulating the Spread of a
Contagious Disease
Giuseppe Antonio Nanna, Nicola Flavio Quatraro and Berardina De Carolis
Department of Computer Science, University of Bari "Aldo Moro", Bari, Italy
Abstract
Recent events concerning global health risks have made truly evident the importance of advanced
strategies and tools to monitor and prevent the spread of new and unpredictable diseases. COVID-19
showed the world that there are many factors that come into play when facing a viral threat, such as
politics, social and economic aspects. Taking those into account when trying to deal with such events
can make a huge difference in the efficacy and efficiency of the responses to the viruses. In this paper,
we propose the use of a Multi-Agent system that extends the previous multi-agent-based approaches by
adding a whole new set of features to control the outbreak during the simulation in order to dynamically
verify how the government strategies can impact the disease spread.
Keywords
Simulation, Multi-agent systems, Agent-based modeling
1. Introduction
The simulation of an infectious disease spread is complex, there are multiple factors to take
into account and it is quite difficult to model all the interactions that occur between them.
Some examples of approach to this problem are the mean-field type models [1], the differential
equation models [2] and the cellular automata theory [3, 4]. But those do not consider important
aspects such as the spatial and temporal variables that describe the setting of the outbreak [5].
Agent-based modeling (ABM) is able to cover effectively all these topics since, for instance,
an agent can be easily used to model different categories of individuals constituting the social
structure of the population considered, each one with his own behavior, and his movements
in a map during time [6]. The model proposed by [5] took into account all those aspects but
lacks of features (depending on the government action and on social factors) for managing the
disease spread dynamically.
For this reason we developed 1 an ABM simulation, based on the work of [5], enriched with
some social, economical and political factors which happened to be highly relevant during the
COVID-19 outbreak.
WOA 2020: Workshop “From Objects to Agents”, September 14–16, 2020, Bologna, Italy
" [email protected] (G. A. Nanna); [email protected] (N. F. Quatraro);
[email protected] (B. De Carolis)
0000-0002-3146-2561 (G. A. Nanna); 0000-0002-2689-137X (B. De Carolis)
© 2020 Copyright for this paper by its authors. Use permitted under Creative Commons License Attribution 4.0 International (CC BY 4.0).
CEUR
Workshop
CEUR Workshop Proceedings (CEUR-WS.org)
Proceedings
http://ceur-ws.org
ISSN 1613-0073
1
The simulation was developed during the lockdown in the midst of the COVID-19 outbreak as a project work
for the course on Multi-Agent Systems held by Prof. Berardina De Carolis
119
Giuseppe Antonio Nanna et al. 119–134
The human population, modelled as agents, behaves and interacts in a randomly generated
urban setting, where the places with higher risk of contagion are considered. We included
households, hospitals, public places, the transportation system, businesses and mass gatherings.
In our simulation humans and businesses dynamically change their behaviour depending
on the measures and the restrictions enacted by the local government aimed at slowing down
the spread of the disease. In order to simulate a more human behaviour, we also admitted the
possibility of reckless actions.
The effectiveness of the government strategies can also be evaluated by monitoring the
response of the healthcare system, which can get overwhelmed with tragic consequences on
the population.
120
Giuseppe Antonio Nanna et al. 119–134
in account the possibility of vaccination and pharmaceutical treatment of the population or,
eventually, the measures of quarantine and isolation [6].
More complex models are, for example, the SEQIJR (Susceptible-Exposed-Quarantine-Infective-
Isolation-Recovered) model, the SEIRP (Susceptible-Exposed-Infectious-Recovered-Persevered)
model and the SLIRDS (Susceptible-Latent-Infected-Recovered-Dead-Susceptible) model [8].
Once the mathematical model is set, an often considered approach to represent it is the
Equation-Based Modeling (EBM) in which the relationships among the variables and the states
of the simulation are modelled through equations differentiable with respect to time [11]. The
SIR model can be formulated with the following equations [12]:
𝑑𝑆
= −𝛼𝑆𝐼
𝑑𝑡
𝑑𝐼
= 𝛼𝑆𝐼 − 𝛽𝐼
𝑑𝑡
𝑑𝑅
= 𝛽𝐼
𝑑𝑡
𝑆+𝐼 −𝑅=𝑀
where, 𝛼 is the global transmission rate, 𝛽 is the recovery (or death) rate, 𝑀 is the total number
of the whole population, 𝑆 = 𝑆(𝑡), 𝐼 = 𝐼(𝑡) and 𝑅 = 𝑅(𝑡) are, respectively, the number
of susceptible individuals, the number of infected individuals and the number of recovered
individuals at time 𝑡 [6].
Usually EBM systems are effective to simulate scenarios in which the outbreak can be observed
as a mathematical, self-centered event. When this approach fails, other perspectives must be
considered. In the ABM, the outbreak is the result of each individual’s behaviour and actions that
take place in the simulation. This approach allows a better understanding and representation
of system’s variables such as heterogeneity across individuals, geographical localization and
distribution, different forms of interaction between individuals and so on [6]. But, inevitably, it
has higher computational and cognitive costs.
These are some other examples of the recent approaches to epidemic spread modelling [6]:
121
Giuseppe Antonio Nanna et al. 119–134
2. Simulation
The proposed simulation 2 is written in Java and is based on JADE, a software framework for
the development of intelligent agents 3 .
During the simulation, it is possible to monitor the contagion curves in real-time (figure 1)
and to affect the outcome of the simulation by imposing rules and restrictions such as the social
distancing (figure 2).
122
Giuseppe Antonio Nanna et al. 119–134
After each action the simulated individual will return to his own house. Since the household
transmissibility of diseases like COVID-19 is epidemiologically relevant and it cannot be ignored
[15], residences (randomly assigned at the beginning of the simulation) can be shared by agents.
123
Giuseppe Antonio Nanna et al. 119–134
Every agent has some needs to satisfy during its daytime and through its movements it
may get in contact with other groups of people who can infect it or that can be infected by it
[5]. Some agents simulate workers: in addition to the already specified actions, they will also
periodically go to their randomly assigned workplace.
A worldwide study conducted on April 2020 [16] analysed the erroneous conspiracy theory
developed by many people during the COVID-19 pandemic: "Those who were more conspira-
torial were more likely to report that the government’s response was too strong, illogical and
that the government hid information to people" [16]. "Some of these beliefs were potentially
harmful and some could have led to public rejection of public health measures to suppress the
spread of the virus" [16].
For those reasons a number of people who completely ignore the restrictions imposed by the
government have been included in the simulation.
124
Giuseppe Antonio Nanna et al. 119–134
business:
• supermarket
• park, which represents recreation and entertainment places
• hospital
• non strictly necessary business
• necessary business
The last two categories are needed to differentiate the businesses which are absolutely necessary
for the well-being of the population, such as food factories, from those that can eventually be
closed to control the outbreak.
Events of large-scale group infection [18] have been considered, they occur in circumstances
in which a huge number of individuals are located in the same place, leading to a massive increase
in chances to be exposed to the infection,in a short period of time. It has been estimated that
71.7% of the confirmed COVID-19 cases in Korea [18] are related to such events, which usually
occur in places like factories, dormitories, schools, companies or places in which individuals
are constrained in a limited physical space.
Parks represent all recreation and entertainment places and can also be casually selected as
the setting of public events, attended by a large percentage of the population and may be the
source of large-scale group infections.
During a pandemic the healthcare system has an higher risk to collapse because of difficulties
in triaging, allocation, and a shortage of high-level care beds [19].
Thus, hospitals in the simulation have a limited number of beds, which implies that if the
outbreak gets out of control and all the beds get occupied, those disease-ill individual with
strong symptoms are much more likely to die due to the lack of proper care.
This allows to further evaluate the success of the Government’s strategies to control the spread
of the disease.
125
Giuseppe Antonio Nanna et al. 119–134
The government can enact those restrictions by issuing a “decree”. After this event, all the
agents simulating individuals and businesses get notified and eventually modify their behaviour.
Susceptible
individuals who can contract the disease
Exposed
individuals who have contracted the disease and are not contagious
Infected
individuals who have contracted the disease and are contagious
Recovered
individuals who are healed from the disease and that cannot contract it anymore
The progress of the infection in an individual is then represented through the unidirectional
translation between those states, starting from the Susceptible one and ending in the Recovered
one, assuming that once an individual is Recovered he becomes immune to the disease.
Once the individual becomes Exposed, there is a latency period before he becomes Infected.
This can be represented with a simple formula [5]:
𝐼𝑝𝑖 = 𝑡𝑖 + 𝑥𝐿𝑃
Where 𝑡𝑖 represents the moment in time where the contagion occurs and 𝑥𝐿𝑃 is the number of
days necessary to become infected.
After reaching the Infected state, there is another latency period before the individual heals
completely, becoming Recovered:
𝑅𝑝𝑖 = 𝐼𝑝𝑖 + 𝑥𝐼𝑃
Where 𝐼𝑝𝑖 represents the moment in time where the individual becomes Infected and 𝑥𝐼𝑃 is
the number of days necessary to become Recovered. The translation between Susceptible to
Exposed occurs when an Infected individual infects a Susceptible one. The way this happens
depends on two conditions:
126
Giuseppe Antonio Nanna et al. 119–134
The meeting represents a violation of social distancing and is modeled as a probabilistic event.
It occurs when the following formula is true:
where 𝑖𝑛𝑓 𝑒𝑐𝑡𝑖𝑜𝑢𝑠𝐷𝑖𝑠𝑡 and 𝑠𝑢𝑠𝑐𝑒𝑝𝑡𝑖𝑏𝑙𝑒𝐷𝑖𝑠𝑡 are the probabilities (respectively associated to
the infectious individual and the susceptible one) of getting close with anyone. Those values
are randomly generated every time an individual reaches any geographical location. The values
cannot be lower than the density value associated to the location and cannot be higher than the
maximum density allowed by the Government (unless the individual is ignoring the decrees
issued by the Government).
Similarly, the Contagion event follows a probabilistic distribution and occurs if the following
formula is true:
where 𝑃 is a function depending on whether or not the infectious individual and the susceptible
one are wearing personal protection equipment (PPE) like a mask, as according to the World
Health Organization Writing Group, wearing a mask can prevent respiratory infectious diseases
[23], [24].
This claim has been proven by several studies [24]:
Each individual only wears a mask if compulsory as long as he doesn’t ignore the Govern-
ment’s dispositions.
127
Giuseppe Antonio Nanna et al. 119–134
Cases 1600
1400
1200
400
200
0 5 10 15 20 25 30 35 40
Days
700
Cases
600
500
Total infectious
400 Recovered
Deaths
Available beds
300 Total exposed
Current infectious
200
100
0
0 20 40 60 80 100 120 140 160 180 200
Days
3. Simulated Scenarios
We chose to simulate 6 different scenarios in order to verify the capabilities of the created model.
In each one 1500 people are simulated, of which 20% ignore the Government’s restriction and
50% are workers. The map consists of 3600 buildings with 500 businesses. Hospitals have a
combined capacity of 100 beds.
128
Giuseppe Antonio Nanna et al. 119–134
Cases 1600
1400
1200
400
200
0
0 10 20 30 40 50
Days
100
80
60
40 Total infectious
Recovered
Deaths
Available beds
Total exposed
20 Current infectious
0
0 10 20 30 40 50 60 70 80
Days
129
Giuseppe Antonio Nanna et al. 119–134
1600
Cases
Total infectious
1400
Recovered
Deaths
Available beds
1200
Total exposed
Current infectious
1000
800
600
400
200
0
0 20 40 60 80 100 120
Days
900
800
700
600
Total infectious
Recovered
500 Deaths
Available beds
Total exposed
400
Current infectious
300
200
100
0
0 20 40 60 80 100 120
Days
130
Giuseppe Antonio Nanna et al. 119–134
131
Giuseppe Antonio Nanna et al. 119–134
those restrictions come into force. Those results are then matching the expectations and the
events that occurred during the COVID-19 outbreak.
However there are many aspects of this tool which can be improved, such as:
• a wider geographical setting where people are able to travel between different communi-
ties
• a more heterogeneous social structure with more classes reflecting each individual’s age
and role
• a more diverse and complex behaviour of each agent allowed by the use of a BDI model
In the future we believe that improving those aspects, with the help of experts in the field,
can provide a valid tool that can assist the administrations, before and during an outbreak, in
choosing the most optimal strategies to safeguard public health and minimize the consequences
of restrictions on the economy at the same time.
References
[1] A. Kleczkowski, B. T. Grenfell, Mean-field-type equations for spread of epidemics: the
‘small world’ model, Physica A: Statistical Mechanics and its Applications 274 (1999) 355 –
360. doi:https://doi.org/10.1016/S0378-4371(99)00393-3.
[2] S. Fu, G. Milne, Epidemic modelling using cellular automata, in: H. Abbass, J. Wiles
(Eds.), The Australian Conference on Artificial Life ACAL 2003, volume N/A, UNSW Press,
Australia, 2003, pp. 43–57. Epidemic Modelling Using Cellular Automata ; Conference date:
01-01-2003.
[3] G. Sirakoulis, I. Karafyllidis, A. Thanailakis, A cellular automaton model for the effects of
population movement and vaccination on epidemic propagation, Ecological Modelling
133 (2000) 209 – 223. doi:https://doi.org/10.1016/S0304-3800(00)00294-5.
[4] L. Q.-X. Jin Zhen, A cellular automata model of epidemics of a heterogeneous susceptibility,
Chinese Physics B 15 (2006) 1248. doi:10.1088/1009-1963/15/6/019.
[5] L. Perez, S. Dragicevic, An agent-based approach for modeling dynamics of contagious
disease spread, International Journal of Health Geographics 8 (2009) 50. doi:10.1186/
1476-072X-8-50.
[6] M. Shatnawi, S. Lazarova-Molnar, N. Zaki, Modeling and simulation of epidemic spread:
Recent advances, 2013 9th International Conference on Innovations in Information Tech-
nology, IIT 2013 (2013) 118–123. doi:10.1109/Innovations.2013.6544404.
[7] H. Hethcote, The mathematics of infectious diseases, SIAM Review 42 (2000) 599–653.
doi:10.1137/S0036144500371907.
[8] S. Bin, G. Sun, C.-C. Chen, Spread of Infectious Disease Modeling and Analysis of Dif-
ferent Factors on Spread of Infectious Disease Based on Cellular Automata, Interna-
tional Journal of Environmental Research and Public Health 16 (2019) 4683. doi:10.3390/
ijerph16234683.
[9] F. Brauer, C. Castillo-Chavez, Mathematical Models in Population Biology and Epi-
demiology, volume 40 of Texts in Applied Mathematics, Springer New York, New
York, NY, 2012. URL: http://link.springer.com/10.1007/978-1-4614-1686-9. doi:10.1007/
978-1-4614-1686-9.
132
Giuseppe Antonio Nanna et al. 119–134
133
Giuseppe Antonio Nanna et al. 119–134
134
Transcultural Health-Aware Guides for the Elderly
Rafael H. Bordinia,b , Viviana Mascardib , Stefania Costantinic , Amal El
Fallah-Seghrouchnid , Yves Lespérancee and Alessandro Riccif
a
PUCRS, Porto Alegre, Brazil
b
Genova University, Genova, Italy
c
L’Aquila University, L’Aquila, Italy
d
Sorbonne University, Paris, France
e
York University, Toronto, Canada
f
Università di Bologna, Cesena, Italy
Abstract
In this brief position paper, we present our vision for using software agents and related technologies
to address the growing need of transcultural health-aware “Guides” for the elderly, an increasingly
important topic given the clear trend of population ageing. Such autonomous intelligent guides are
employed in smart living/city infrastructures to give emotional and healthcare support for the elderly
wherever they are, whether at home, outdoors, or in hospital. The main purpose is to help ageing people
to avoid progressive loss of physical, cognitive, and emotional activity, and most importantly to avoid
social exclusion.
Keywords
Population ageing, smart environment, argumentation, ontology
1. Introduction
Most continents, in particular those where the authors live, are exposed to the tangible effects
of the ageing of the population, with all the challenges for the society and for the individuals
(the ageing people, but also their relatives, caregivers, doctors) that this demographic change
raises.
In this paper, we present our vision on how to address some of these challenges; in particular,
we investigate how intelligent software agents could mitigate the risk of progressive loss of
physical, intellectual, and emotional activity of ageing people, and of their social exclusion,
WOA 2020: Workshop “From Objects to Agents”, September 14–16, 2020, Bologna, Italy
" [email protected] (R. H. Bordini); [email protected] (V. Mascardi); [email protected]
(S. Costantini); [email protected] (A. El Fallah-Seghrouchni); [email protected] (Y. Lespérance);
[email protected] (A. Ricci)
~ https://www.inf.pucrs.br/r.bordini/ (R. H. Bordini); https://person.dibris.unige.it/mascardi-viviana/ (V. Mascardi);
http://people.disim.univaq.it/~stefcost/ (S. Costantini); https://webia.lip6.fr/~elfallah/ (A. El Fallah-Seghrouchni);
http://www.cse.yorku.ca/~lesperan/ (Y. Lespérance); https://www.unibo.it/sitoweb/a.ricci/en (A. Ricci)
0000-0001-8688-9901 (R. H. Bordini); 0000-0002-2261-9926 (V. Mascardi); 0000-0002-5686-6124 (S. Costantini);
0000-0002-8390-8780 (A. El Fallah-Seghrouchni); 0000-0003-1625-0226 (Y. Lespérance); 0000-0002-9222-5092
(A. Ricci)
© 2020 Copyright for this paper by its authors. Use permitted under Creative Commons License Attribution 4.0 International (CC BY 4.0).
CEUR
Workshop
Proceedings
http://ceur-ws.org
ISSN 1613-0073
CEUR Workshop Proceedings (CEUR-WS.org)
135
Rafael H. Bordini et al. 135–146
in particular when a transition from different situations (moving from home to a protected
structure, or from a protected structure to an hospital) takes place.
We believe that one way to cope with the needs of old people, especially during these delicate
transitions where they are much more fragile than in stable situations, is to provide them with
highly-interactive culturally adaptive “Guides” that not only care for their health but also serve
as entertaining companions that interact through spoken dialogues and that stimulate their
cognitive abilities. Such Guides, designed and implemented as software agents compliant with
the strong notion of agency [1] and also characterised by emotional features à la Bates [2],
besides mentalistic ones à la Shoham [3], are meant to become a familiar and trustable point
of reference for their users. The Beliefs-Desires-Intentions (BDI) agent model, extended with
emotional features as suggested for example by Pereira et al. [4], Alfonso et al. [5], Su et al. [6],
would hence represent a suitable architecture for our Guides, and has been recently adopted
in healthcare applications [7]. Given the BDI-oriented nature of the Guides1 , we will exploit
languages like DALI [8], SR-APL [9], IndiGolog [10], or Jason [11], meant as a standalone
infrastructure or, better, integrated in the environment- and organization-oriented JaCaMo
framework [12], for their implementation.
We use the word “Guide” to emphasise that such interactive assistants are always available
to their users when they need advice or company, wherever they are, be it the comfort of their
home, outdoors, but also at difficult times for example when moving to protected structures
or hospital is needed. The Guides may provide guidance — following a protocol pre-agreed
with doctors, psychologists and caregivers — to the elderly on all those situations which do not
require a doctor evaluation and assessment (entertainment, social activity, physical activity, diet,
medication to take according to the agreed protocol). By watching over the elderly, Guides can
collect precious information on their behaviour and can serve as a source of reliable information
for the doctors who care for the elderly. Hence, guidance is bidirectional: caregivers choices
and focus of attention can indeed be driven by the Guide, based on what it senses, observes,
hears, and deduces.
We expect that Guides should quickly learn the cultural profile of their users and flexibly adapt
to cross-cultural interaction. This means adapting the style of conversation to the conversation
party: old users may require the adoption of a limited, simple vocabulary, which includes words
familiar to them, while doctors may take advantage of a rich technical vocabulary.
By boosting cross-cultural interaction, our Guides will also facilitate people to get in touch
and to interact, hence achieving one of the main risks of ageing: social exclusion.
The targets of our investigation are indeed natural language processing, ontologies and argu-
mentation techniques to ensure cross-cultural interaction [13, 14]; agent-oriented approaches to
make such cross-cultural interaction intelligent and emotionally realistic and believable, which
requires explicit representations of the user’s state of mind [15]; and smart-* approaches to
make agent-oriented approaches efficient and well integrated with the existing environment
and infrastructures.
1
By “BDI-oriented” here we mean, in a very broad sense, the conceptualization and implementation of the
Guides based on explicit knowledge/ beliefs, declarative and rule based reasoning/planning, explicit goals to achieve.
136
Rafael H. Bordini et al. 135–146
137
Rafael H. Bordini et al. 135–146
different people as well as between Guides and existing systems. To this aim we will exploit
the lessons we learned while engineering systems that integrate ambient intelligence/IoT
on the one hand, and agents/MAS on the other [26, 27, 28]. Besides existing work
emerged from the autonomous agents community, in order to immerse the Guides in a
smart environment we will also consider the potential offered by open and configurable
frameworks like FIWARE2 . Albeit not being an agent-oriented infrastructure, FIWARE
presents many features worth exploring: it has demonstrated its industrial strength
in many smart* application domains including healthcare, it implements distributed
smart components that interact asynchronously via message passing, and may be in
principle integrated with (or “under”) JaCaMo, to provide access to the surrounding smart
environment via a standard API.
• NLP profiling techniques and voice-based interaction. All the interactions between
Guides and humans will be through spoken dialogue in natural languages; although
existing tools will be used, in our vision we call for a seemless integration between out-of-
the-box voice-based human-computer interaction tools and the sophisticated culturally
adaptive AI techniques described below, which address the communication level in a
broad sense.
• Big data and computer vision. We need to have summary information from the relevant
data for the various activities the Guides will accompany the user, for supporting medical
staff about the ongoing health state of the user, as well as symbolic representation of the
surroundings of the user; again we plan to use out-of-the-box techniques for this but
connected to our approach on representing environments for autonomous agents.
• Planning and reasoning. To provide useful information and support, and to engage
in complex dialogues, we rely on various formal techniques such as non-monotonic
reasoning, logic programming, and automated planning, adapted to the context of tran-
scultural smart-environment elder care. The literature on adoption of formal techniques
for modelling and implementing agent planning and reasoning mechanisms is vast and
many recent proposals may be taken under consideration for being integrated into the
Guides. They include, for example, extensions of goal-based plans used in BDI program-
ming languages to encapsulate both proactive and reactive behaviour, which supports
agent reasoning at runtime [29], contextual planning for multiple agents in ambient
intelligence environments, useful for making the plans developed by the Guides aware
of the surrounding smart environment [30, 31, 32], dynamic goal decomposition and
planning in scenarios characterized by a strong inter-dependency between action and
context, needed to cope with unexpected, or even catastrophic, events [33], automated
synthesis of a library of template-based process models that achieve goals in dynamic
and partially specified environments, which are exactly the kind of environments where
the Guides will operate [34].
• Ontologies. Ontologies will provide the necessary vocabulary (in various languages and
also in accordance with different cultures) to be used in the multi-agent dialogues that
the Guides will be able to engage. Normally the Guides only dialogue with their user, but
for example in medical consultations the Guides may need to participate in multi-agent
2
https://www.fiware.org/, accessed on July 2020.
138
Rafael H. Bordini et al. 135–146
dialogues with the doctor and the user. The interplay between ontologies – and semantic
web in general – and BDI-style agents – and declarative agent approaches in general – has
been studied for a long time [35]. Our experience ranges from design and development of
ontologies in the health domain [36, 37, 38] to their integration into AgentSpeak [13, 39],
into MAS via CArtAgO artifacts [40], and into data-aware commitment-based MAS [41].
We will exploit this experience to provide the Guides with the semantic layer required
to boost their interaction with users. One further advantage of using ontologies is that
they could suitably cope with the dynamism that characterizes the application domain,
due not only to the dynamism of the environment, but also to the cultural specificity
of the elderly people. Many works on ontology evolution have been proposed in the
literature [42], including those connecting ontology evolution and belief revision that
seem extremely relevant for our research [43].
Finally, to make ontologies suitable to different cultures, profiles, ages, and genders, but
still interoperable, we plan to exploit our background on upper ontologies [44, 45] and
design ontologies in such a way that they have some upper layer shared among them,
and specialized sub-ontologies for different users and tasks.
• Argumentation. The core of the transcultural component of our vision are argumenta-
tion protocols based on argumentation schemes (i.e., patterns of reasoning and dialogue
exchange); these are used to decide the utterances of the Guides when engaged in dia-
logues. This is possible in practice given long-term work on the integration of Argumen-
tation Theory techniques into Jason and JaCaMo for both reasoning and communication
[14, 46, 47]. Also, the development of an argumentation-based inference mechanism for
BDI agents based on Toulmin’s model of argumentation [48] recently put forward [49]
can be used as an alternative basis for this part of our investigation.
• Theory of mind. “An individual has a theory of mind if he imputes mental states to himself
and others. A system of inferences of this kind is properly viewed as a theory because such
states are not directly observable, and the system can be used to make predictions about the
behavior of others” [50]. The theory of mind is the ability to attribute mental states – beliefs,
intents, desires, emotions, knowledge, etc. – to oneself and to others. Its philosophical
roots include the work by Dennet [51] that is very well known to researchers working
on BDI-oriented agent theories, languages and architectures. With aging, cognitive
abilities including theory of mind seem to decline [52, 53], and cultural factors impact its
development as well [54]. Based on these observations, another fundamental aspect of
our vision is that we are able to model the minds of users through formal representation of
their beliefs and intentions. Current dialogue systems have no such representation and the
literature in the area makes it clear that without such a representation, intelligent systems
cannot fully address the needs of their users. Our existing framework for theory of mind
relies on standard rationality assumptions. Based on our previous, recent investigations
[55, 56, 15] we aim at doing pioneering multi-disciplinary work on modelling the minds
of elderly and their culture, in particular what are the most appropriate ways to infer
beliefs and intentions of users given what they communicate. This is clearly specific to
the elderly public and different cultures, specially as the elder might have debilitating
diseases that compromise their cognitive processes or even for cultural reasons may want
to conceal certain states of mind.
139
Rafael H. Bordini et al. 135–146
• Organisations. Our approach also provides the ability to represent the various organisa-
tions that the users are part of (for example elderly clubs, hospitals, former employees,
etc.) and this too needs to be adapted to support the different cultural systems where the
organisations are situated. By integrating MOISE [57], JaCaMo already supports the spec-
ification and implementation of organizations [58], and the research on the exploitation
of organizations in MAS is still very active [59, 60].
• Runtime verification. Because the basis of our work is formal, this also allows us to
employ Runtime Verification (RV) techniques to ensure that Guides never make dialogue
utterances that are unethical or inappropriate for the elderly or for a particular culture.
RV can also be used at a lower, IoT, level, to check that what sensors transmit is in line
with some known pattern recognised as “normal behaviour”, to raise an alarm if sensory
inputs deviates from that pattern. Runtime verification engines based on computational
logic, like RML3 [61] and the trace expressions formalism it builds on [62, 63, 64, 65] are
a promising direction to address this challenge, and are integrated with Jason [66].
Clearly, to evaluate the results of this research, we will need a multidisciplinary team to inter-
act with elderly users, including geriatricians, as well as psychologists, sociologists interested
in population aging and philosophers interested in ethical AI systems.
3. Conclusions
This short paper presents the preliminary results of a feasibility study that the authors carried out
looking for an answer to the question: “How can we address the growing need of transcultural
health-aware tools and technologies for aging people?”. We believe that the integration of
existing IoT and smart-* approaches can help providing a very effective, pervasive and reliable
“sensing layer”, on top of which intelligent software agents can be designed and implemented,
and can provide the “intelligence layer” needed to implement a cross-cultural Guide. The MAS
infrastructure adds a further “intelligent coordination layer” to the architecture. The proper
management of emotional aspects is part of this intelligence layer, as the theory of multiple
intelligence suggests [67], and a natural interaction interface is the means to reduce the barriers
between the users and the Guide.
References
[1] M. Wooldridge, N. R. Jennings, Intelligent agents: theory and practice, Knowledge Eng.
Review 10 (1995) 115–152. doi:10.1017/S0269888900008122.
[2] J. Bates, The role of emotion in believable agents, Commun. ACM 37 (1994) 122–125. URL:
https://doi.org/10.1145/176789.176803. doi:10.1145/176789.176803.
[3] Y. Shoham, Agent-oriented programming, Artif. Intell. 60 (1993) 51–92. URL: https:
//doi.org/10.1016/0004-3702(93)90034-9. doi:10.1016/0004-3702(93)90034-9.
[4] D. Pereira, E. C. Oliveira, N. Moreira, Formal modelling of emotions in BDI agents, in:
F. Sadri, K. Satoh (Eds.), Computational Logic in Multi-Agent Systems, 8th International
3
https://rmlatdibris.github.io/.
140
Rafael H. Bordini et al. 135–146
Workshop, CLIMA VIII, Porto, Portugal, September 10-11, 2007. Revised Selected and
Invited Papers, volume 5056 of LNCS, Springer, 2007, pp. 62–81. URL: https://doi.org/10.
1007/978-3-540-88833-8_4. doi:10.1007/978-3-540-88833-8_4.
[5] B. Alfonso, E. Vivancos, V. J. Botti, Toward formal modeling of affective agents in a BDI
architecture, ACM Trans. Internet Techn. 17 (2017) 5:1–5:23. URL: https://doi.org/10.1145/
3001584. doi:10.1145/3001584.
[6] Y. Su, B. Hu, Y. Dai, J. Rao, A computationally grounded model of emotional bdi-agents, in:
D. Huang, V. Bevilacqua, P. Premaratne, P. Gupta (Eds.), Intelligent Computing Theories
and Application - 14th International Conference, ICIC 2018, Wuhan, China, August 15-
18, 2018, Proceedings, Part I, volume 10954 of LNCS, Springer, 2018, pp. 444–453. URL:
https://doi.org/10.1007/978-3-319-95930-6_41. doi:10.1007/978-3-319-95930-6_41.
[7] A. Croatti, S. Montagna, A. Ricci, E. Gamberini, V. Albarello, V. Agnoletti, BDI
personal medical assistant agents: The case of trauma tracking and alerting, Artif.
Intell. Medicine 96 (2019) 187–197. URL: https://doi.org/10.1016/j.artmed.2018.12.002.
doi:10.1016/j.artmed.2018.12.002.
[8] S. Costantini, A. Tocchio, Strips-like planning in the DALI logic programmming language,
in: G. Armano, F. D. Paoli, A. Omicini, E. Vargiu (Eds.), WOA 2003: Dagli Oggetti agli
Agenti. 4th AI*IA/TABOO Joint Workshop "From Objects to Agents": Intelligent Systems
and Pervasive Computing, 10-11 September 2003, Villasimius, CA, Italy, Pitagora Editrice
Bologna, 2003, pp. 115–120.
[9] S. M. Khan, Y. Lespérance, SR-APL: a model for a programming language for rational
BDI agents with prioritized goals, in: L. Sonenberg, P. Stone, K. Tumer, P. Yolum (Eds.),
10th International Conference on Autonomous Agents and Multiagent Systems (AAMAS
2011), Taipei, Taiwan, May 2-6, 2011, Volume 1-3, IFAAMAS, 2011, pp. 1251–1252. URL:
http://portal.acm.org/citation.cfm?id=2034511&CFID=69154334&CFTOKEN=45298625.
[10] S. Sardiña, Y. Lespérance, Golog speaks the BDI language, in: L. Braubach, J. Briot,
J. Thangarajah (Eds.), Programming Multi-Agent Systems - 7th International Workshop,
ProMAS 2009, Budapest, Hungary, May 10-15, 2009. Revised Selected Papers, volume
5919 of LNCS, Springer, 2009, pp. 82–99. URL: https://doi.org/10.1007/978-3-642-14843-9_6.
doi:10.1007/978-3-642-14843-9_6.
[11] R. H. Bordini, J. F. Hübner, M. Wooldridge, Programming Multi-Agent Systems in AgentS-
peak using Jason, Wiley Series in Agent Technology, John Wiley & Sons, 2007.
[12] O. Boissier, R. H. Bordini, J. F. Hübner, A. Ricci, A. Santi, Multi-agent oriented programming
with jacamo, Sci. Comput. Program. 78 (2013) 747–761. URL: https://doi.org/10.1016/j.scico.
2011.10.004. doi:10.1016/j.scico.2011.10.004.
[13] V. Mascardi, D. Ancona, M. Barbieri, R. H. Bordini, A. Ricci, CooL-AgentSpeak: Endowing
AgentSpeak-DL agents with plan exchange and ontology services, Web Intelligence and
Agent Systems 12 (2014) 83–107. URL: https://doi.org/10.3233/WIA-140287. doi:10.3233/
WIA-140287.
[14] A. R. Panisson, S. Parsons, P. McBurney, R. H. Bordini, Choosing appropriate argu-
ments from trustworthy sources, in: S. Modgil, K. Budzynska, J. Lawrence (Eds.),
Computational Models of Argument - Proceedings of COMMA 2018, Warsaw, Poland,
12-14 September 2018, volume 305 of Frontiers in Artificial Intelligence and Applica-
tions, IOS Press, 2018, pp. 345–352. URL: https://doi.org/10.3233/978-1-61499-906-5-345.
141
Rafael H. Bordini et al. 135–146
doi:10.3233/978-1-61499-906-5-345.
[15] A. R. Panisson, S. Sarkadi, P. McBurney, S. Parsons, R. H. Bordini, On the formal semantics
of theory of mind in agent communication, in: M. Lujak (Ed.), Agreement Technologies
- 6th International Conference, AT 2018, Bergen, Norway, December 6-7, 2018, Revised
Selected Papers, volume 11327 of LNCS, Springer, 2018, pp. 18–32. URL: https://doi.org/10.
1007/978-3-030-17294-7_2. doi:10.1007/978-3-030-17294-7_2.
[16] A. Lentzas, D. Vrakas, Non-intrusive human activity recognition and abnormal behavior
detection on elderly people: a review, Artificial Intelligence Review (2019) 1–47.
[17] A. Hariharan, S. Sourab, V. S. Varshini, I. Rajpal, S. M. George, Remote fall detection
system for the elderly, in: 2019 2nd International Conference on Intelligent Computing,
Instrumentation and Control Technologies (ICICICT), volume 1, IEEE, 2019, pp. 870–874.
[18] V. Balas, V. Solanki, R. Kumar, M. Ahad (Eds.), A Handbook of Internet of Things in
Biomedical and Cyber Physical System, Springer, 2020.
[19] C. Murphey, D. Um, Development of a sleep monitoring system by using a depth sensor:
A pilot study, Advances in Human Factors and Ergonomics in Healthcare and Medical
Devices 957 (2019) 191.
[20] S. Modgil, Reasoning about preferences in argumentation frameworks, Artificial intelli-
gence 173 (2009) 901–934.
[21] T. Gruber, Ontologies, Encyclopedia of Database Systems (2008) 1959–1959.
[22] B. Stigall, J. Waycott, S. Baker, K. Caine, Older adults’ perception and use of voice user
interfaces: A preliminary review of the computing literature, in: Proceedings of the 31st
Australian Conference on Human-Computer-Interaction, 2019, pp. 423–427.
[23] Z. Huang, J. Epps, D. Joachim, V. Sethu, Natural language processing methods for acoustic
and landmark event-based features in speech-based depression detection, IEEE Journal of
Selected Topics in Signal Processing (2019).
[24] High-Level Expert Group on AI, Ethics guidelines for trustworthy AI, 2019. URL: https:
//ec.europa.eu/digital-single-market/en/news/ethics-guidelines-trustworthy-ai.
[25] The IEEE Global Initiative on Ethics of Autonomous and Intelligent Systems (Ed.), Ethically
Aligned Design: A Vision for Prioritizing Human Well-being with Autonomous and
Intelligent Systems, IEEE, 2019. URL: https://standards.ieee.org/content/ieee-standards/
en/industry-connections/ec/autonomous-systems.html.
[26] A. Casals, A. Belbachir, A. E. Fallah-Seghrouchni, A. A. F. Brandão, Fostering agent cooper-
ation in AmI: A context-aware mechanism for dealing with multiple intentions, in: J. D. Ser,
E. Osaba, M. N. Bilbao, J. J. S. Medina, M. Vecchio, X. Yang (Eds.), Intelligent Distributed
Computing XII, 12th International Symposium on Intelligent Distributed Computing, IDC
2018, Bilbao, Spain, 15-17 October 2018, volume 798 of Studies in Computational Intelli-
gence, Springer, 2018, pp. 225–234. URL: https://doi.org/10.1007/978-3-319-99626-4_20.
doi:10.1007/978-3-319-99626-4_20.
[27] A. Freitas, D. Schmidt, A. R. Panisson, R. H. Bordini, F. Meneguzzi, R. Vieira, Applying
ontologies and agent technologies to generate ambient intelligence applications, in: F. Koch,
F. Meneguzzi, K. Lakkaraju (Eds.), Agent Technology for Intelligent Mobile Services and
Smart Societies - Workshop on Collaborative Agents, Research and Development, CARE
2014, and Workshop on Agents, Virtual Societies and Analytics, AVSA 2014, Held as Part
of AAMAS 2014, Paris, France, May 5-9, 2014. Revised Selected Papers, volume 498 of
142
Rafael H. Bordini et al. 135–146
Communications in Computer and Information Science, Springer, 2014, pp. 22–33. URL:
https://doi.org/10.1007/978-3-662-46241-6_3. doi:10.1007/978-3-662-46241-6_3.
[28] C. E. Pantoja, H. D. Soares, J. Viterbo, T. Alexandre, A. E. Fallah-Seghrouchni, A. Casals, Ex-
posing IoT objects in the internet using the resource management architecture, Int. J. Softw.
Eng. Knowl. Eng. 29 (2019) 1703–1725. URL: https://doi.org/10.1142/S0218194019400175.
doi:10.1142/S0218194019400175.
[29] R. H. Bordini, R. Collier, J. F. Hübner, A. Ricci, Encapsulating reactive behaviour in goal-
based plans for programming BDI agents: Extended abstract, in: A. E. F. Seghrouchni,
G. Sukthankar, B. An, N. Yorke-Smith (Eds.), Proceedings of the 19th International Con-
ference on Autonomous Agents and Multiagent Systems, AAMAS ’20, Auckland, New
Zealand, May 9-13, 2020, International Foundation for Autonomous Agents and Multiagent
Systems, 2020, pp. 1783–1785. URL: https://dl.acm.org/doi/abs/10.5555/3398761.3398981.
[30] R. Boukharrou, A. Chaouche, A. E. Fallah-Seghrouchni, J. Ilié, D. Saïdouni, Dealing with
temporal failure in ambient systems: a dynamic revision of plans, J. Ambient Intell.
Humaniz. Comput. 6 (2015) 325–336. URL: https://doi.org/10.1007/s12652-015-0266-y.
doi:10.1007/s12652-015-0266-y.
[31] A. Casals, A. E. Fallah-Seghrouchni, A. A. F. Brandão, C. E. Pantoja, J. Viterbo, Resource-
dependent contextual planning in ami, in: E. M. Shakshuki, A. Yasar (Eds.), The 10th
International Conference on Ambient Systems, Networks and Technologies (ANT 2019)
/ The 2nd International Conference on Emerging Data and Industry 4.0 (EDI40 2019) /
Affiliated Workshops, April 29 - May 2, 2019, Leuven, Belgium, volume 151 of Procedia
Computer Science, Elsevier, 2019, pp. 485–492. URL: https://doi.org/10.1016/j.procs.2019.04.
066. doi:10.1016/j.procs.2019.04.066.
[32] A. Chaouche, A. E. Fallah-Seghrouchni, J. Ilié, D. Saïdouni, Learning from situated
experiences for a contextual planning guidance, J. Ambient Intell. Humaniz. Com-
put. 7 (2016) 555–566. URL: https://doi.org/10.1007/s12652-016-0342-y. doi:10.1007/
s12652-016-0342-y.
[33] S. Costantini, G. D. Gasperis, Dynamic goal decomposition and planning in MAS for highly
changing environments, in: P. Felli, M. Montali (Eds.), Proceedings of the 33rd Italian
Conference on Computational Logic, Bolzano, Italy, September 20-22, 2018, volume 2214
of CEUR Workshop Proceedings, CEUR-WS.org, 2018, pp. 40–54. URL: http://ceur-ws.org/
Vol-2214/paper4.pdf.
[34] A. Marrella, Y. Lespérance, A planning approach to the automated synthesis of template-
based process models, Service Oriented Computing and Applications 11 (2017) 367–392.
URL: https://doi.org/10.1007/s11761-017-0215-z. doi:10.1007/s11761-017-0215-z.
[35] V. Mascardi, J. A. Hendler, L. Papaleo, Semantic web and declarative agent languages and
technologies: Current and future trends - (position paper), in: M. Baldoni, L. A. Dennis,
V. Mascardi, W. W. Vasconcelos (Eds.), Declarative Agent Languages and Technologies X -
10th International Workshop, DALT 2012, Valencia, Spain, June 4, 2012, Revised Selected
Papers, volume 7784 of LNCS, Springer, 2012, pp. 197–202. URL: https://doi.org/10.1007/
978-3-642-37890-4_12. doi:10.1007/978-3-642-37890-4_12.
[36] D. C. Engelmann, J. Couto, V. de Oliveira Gabriel, R. Vieira, R. H. Bordini, Towards
an ontology to support decision-making in hospital bed allocation (S), in: A. Perku-
sich (Ed.), The 31st International Conference on Software Engineering and Knowl-
143
Rafael H. Bordini et al. 135–146
edge Engineering, SEKE 2019, Hotel Tivoli, Lisbon, Portugal, July 10-12, 2019, KSI Re-
search Inc. and Knowledge Systems Institute Graduate School, 2019, pp. 71–74. URL:
https://doi.org/10.18293/SEKE2019-130. doi:10.18293/SEKE2019-130.
[37] A. Ferrando, S. Beux, V. Mascardi, P. Rosso, Identification of disease symptoms in mul-
tilingual sentences: An ontology-driven approach, in: D. Ienco, M. Roche, S. Romeo,
P. Rosso, A. Tagarelli (Eds.), Proceedings of the First Workshop on Modeling, Learning
and Mining for Cross/Multilinguality (MultiLingMine 2016) co-located with the 38th
European Conference on Information Retrieval (ECIR 2016), Padova, Italy, March 20,
2016, volume 1589 of CEUR Workshop Proceedings, CEUR-WS.org, 2016, pp. 6–15. URL:
http://ceur-ws.org/Vol-1589/MultiLingMine1.pdf.
[38] L. D. Lauretis, S. Costantini, I. Letteri, An ontology to improve the first aid service quality,
in: 2019 IEEE International Conference on Systems, Man and Cybernetics, SMC 2019, Bari,
Italy, October 6-9, 2019, IEEE, 2019, pp. 1479–1483. URL: https://doi.org/10.1109/SMC.2019.
8914460. doi:10.1109/SMC.2019.8914460.
[39] Á. F. Moreira, R. Vieira, R. H. Bordini, J. F. Hübner, Agent-oriented programming with
underlying ontological reasoning, in: M. Baldoni, U. Endriss, A. Omicini, P. Torroni
(Eds.), Declarative Agent Languages and Technologies III, Third International Workshop,
DALT 2005, Utrecht, The Netherlands, July 25, 2005, Selected and Revised Papers, volume
3904 of LNCS, Springer, 2005, pp. 155–170. URL: https://doi.org/10.1007/11691792_10.
doi:10.1007/11691792_10.
[40] A. Freitas, A. R. Panisson, L. Hilgert, F. Meneguzzi, R. Vieira, R. H. Bordini, Integrating
ontologies with multi-agent systems through CArtAgO artifacts, in: IEEE/WIC/ACM
International Conference on Web Intelligence and Intelligent Agent Technology, WI-IAT
2015, Singapore, December 6-9, 2015 - Volume II, IEEE Computer Society, 2015, pp. 143–150.
URL: https://doi.org/10.1109/WI-IAT.2015.116. doi:10.1109/WI-IAT.2015.116.
[41] S. Costantini, G. D. Gasperis, Exchanging data and ontological definitions in multi-agent-
contexts systems, in: N. Bassiliades, P. Fodor, A. Giurca, G. Gottlob, T. Kliegr, G. J. Nalepa,
M. Palmirani, A. Paschke, M. Proctor, D. Roman, F. Sadri, N. Stojanovic (Eds.), Proceedings
of the RuleML 2015 Challenge, the Special Track on Rule-based Recommender Systems for
the Web of Data, the Special Industry Track and the RuleML 2015 Doctoral Consortium
hosted by the 9th International Web Rule Symposium (RuleML 2015), Berlin, Germany,
August 2-5, 2015, volume 1417 of CEUR Workshop Proceedings, CEUR-WS.org, 2015. URL:
http://ceur-ws.org/Vol-1417/paper12.pdf.
[42] F. Zablith, G. Antoniou, M. d’Aquin, G. Flouris, H. Kondylakis, E. Motta, Ontology evolution:
a process-centric survey, The knowledge engineering review 30 (2015) 45–75.
[43] G. Flouris, On belief change in ontology evolution, AI Communications 19 (2006) 395–397.
[44] V. Mascardi, V. Cordì, P. Rosso, A comparison of upper ontologies, in: M. Baldoni,
A. Boccalatte, F. D. Paoli, M. Martelli, V. Mascardi (Eds.), WOA 2007: Dagli Oggetti agli
Agenti. 8th AI*IA/TABOO Joint Workshop "From Objects to Agents": Agents and Industry:
Technological Applications of Software Agents, 24-25 September 2007, Genova, Italy,
Seneca Edizioni Torino, 2007, pp. 55–64. URL: http://woa07.disi.unige.it/papers/mascardi.
pdf.
[45] V. Mascardi, A. Locoro, P. Rosso, Automatic ontology matching via upper ontologies:
A systematic evaluation, IEEE Trans. Knowl. Data Eng. 22 (2010) 609–623. URL: https:
144
Rafael H. Bordini et al. 135–146
//doi.org/10.1109/TKDE.2009.154. doi:10.1109/TKDE.2009.154.
[46] A. R. Panisson, R. H. Bordini, Argumentation schemes in multi-agent systems: A social
perspective, in: A. E. Fallah-Seghrouchni, A. Ricci, T. C. Son (Eds.), Engineering Multi-
Agent Systems - 5th International Workshop, EMAS 2017, Sao Paulo, Brazil, May 8-9,
2017, Revised Selected Papers, volume 10738 of LNCS, Springer, 2017, pp. 92–108. URL:
https://doi.org/10.1007/978-3-319-91899-0_6. doi:10.1007/978-3-319-91899-0_6.
[47] A. R. Panisson, F. Meneguzzi, M. S. Fagundes, R. Vieira, R. H. Bordini, Formal semantics of
speech acts for argumentative dialogues, in: A. L. C. Bazzan, M. N. Huhns, A. Lomuscio,
P. Scerri (Eds.), International conference on Autonomous Agents and Multi-Agent Systems,
AAMAS ’14, Paris, France, May 5-9, 2014, IFAAMAS/ACM, 2014, pp. 1437–1438. URL:
http://dl.acm.org/citation.cfm?id=2617511.
[48] S. E. Toulmin, The uses of argument, Cambridge university press, 2003.
[49] V. de Oliveira Gabriel, A. R. Panisson, R. H. Bordini, D. F. Adamatti, C. Z. Billa, Reasoning
in BDI agents using toulmin’s argumentation model, Theor. Comput. Sci. 805 (2020) 76–91.
URL: https://doi.org/10.1016/j.tcs.2019.10.026. doi:10.1016/j.tcs.2019.10.026.
[50] D. Premack, G. Woodruff, Does the chimpanzee have a theory of mind?, Behavioral and
Brain Sciences 1 (1978) 515–526. doi:10.1017/S0140525X00076512.
[51] D. C. Dennett, The Intentional Stance, MIT Press, Cambridge, MA, USA, 1989.
[52] S. Bottiroli, E. Cavallini, I. Ceccato, T. Vecchi, S. Lecce, Theory of mind in aging: Comparing
cognitive and affective components in the faux pas test, Archives of Gerontology and
Geriatrics 62 (2016) 152–162.
[53] S. Lecce, I. Ceccato, A. Rosi, F. Bianco, S. Bottiroli, E. Cavallini, Theory of mind plasticity in
aging: The role of baseline, verbal knowledge, and executive functions, Neuropsychological
rehabilitation 29 (2019) 440–455.
[54] A. Shahaeian, M. Nielsen, C. C. Peterson, V. Slaughter, Cultural and family influences on
children’s theory of mind development: A comparison of australian and iranian school-age
children, Journal of Cross-Cultural Psychology 45 (2014) 555–568.
[55] S. Sarkadi, A. R. Panisson, R. H. Bordini, P. McBurney, S. Parsons, Towards an approach for
modelling uncertain theory of mind in multi-agent systems, in: M. Lujak (Ed.), Agreement
Technologies - 6th International Conference, AT 2018, Bergen, Norway, December 6-7,
2018, Revised Selected Papers, volume 11327 of LNCS, Springer, 2018, pp. 3–17. URL:
https://doi.org/10.1007/978-3-030-17294-7_1. doi:10.1007/978-3-030-17294-7_1.
[56] S. Sarkadi, A. R. Panisson, R. H. Bordini, P. McBurney, S. Parsons, M. Chapman, Modelling
deception using theory of mind in multi-agent systems, AI Commun. 32 (2019) 287–302.
URL: https://doi.org/10.3233/AIC-190615. doi:10.3233/AIC-190615.
[57] M. Hannoun, O. Boissier, J. S. Sichman, C. Sayettat, MOISE: an organizational model
for multi-agent systems, in: M. C. Monard, J. S. Sichman (Eds.), Advances in Artificial
Intelligence, International Joint Conference, 7th Ibero-American Conference on AI, 15th
Brazilian Symposium on AI, IBERAMIA-SBIA 2000, Atibaia, SP, Brazil, November 19-
22, 2000, Proceedings, volume 1952 of LNCS, Springer, 2000, pp. 156–165. URL: https:
//doi.org/10.1007/3-540-44399-1_17. doi:10.1007/3-540-44399-1_17.
[58] M. R. Zatelli, A. Ricci, J. F. Hübner, Integrating interaction with agents, environment,
and organisation in JaCaMo, Int. J. Agent Oriented Softw. Eng. 5 (2016) 266–302. URL:
https://doi.org/10.1504/IJAOSE.2016.10001865. doi:10.1504/IJAOSE.2016.10001865.
145
Rafael H. Bordini et al. 135–146
146
Voice assistants in hospital triage operations
Simone Montali, Gianfranco Lombardo, Monica Mordonini and Michele Tomaiuolo
University of Parma, Italy
Abstract
This paper analyzes the creation and usage of a voice assistant for the triage of emergency room patients.
This human-centred intelligent system strongly relies on Mycroft, an extensible open source voice
assistant. The patients are able to declare their symptoms to the agent, which recognizes the urgency
and acts accordingly. The software can even provide useful medical informations to the users.
Keywords
Voice assistant, Mycroft, hospital, E.R., emergency, triage
1. Introduction
While the medical research progressed heavily in the last years, the involved IT infrastructures
didn’t. This was probably caused by the need of having ultra-reliable software, since no errors
are permitted in ER rooms. The use cases of agents in hospitals are numerous. This paper
inspects the automation of the triage procedures, usually done by nurses, to help patients faster
and more efficiently. The voice assistant is an agent able to connect to Mycroft’s cloud services,
recognize the patients’ symptoms and assign them a priority. It also features a second classifier,
based on a deep learning network, trained on a dataset composed of ER rooms interviews. This
second classifier is used every time the first one isn’t capable of recognizing the symptoms. The
intelligent system is even capable of interacting with the italian health ministery’s website to
retrieve the informations requested by the users. The triage operations produce reports in a
standard format, making the integration with existing systems easy, cheap and fast. This article
is composed as follows:
WOA 2020: Workshop “From Objects to Agents”, September 14–16, 2020, Bologna, Italy
© 2020 Copyright for this paper by its authors. Use permitted under Creative Commons License Attribution 4.0 International (CC BY 4.0).
CEUR
Workshop
Proceedings
http://ceur-ws.org
ISSN 1613-0073 CEUR Workshop Proceedings (CEUR-WS.org)
147
Simone Montali et al. 147–159
2.2. Triage
Triage is the process in which the patients requesting help in the ER are catalogued by their
urgency and their priority [2]. The term was born during wars and maxi-emergencies, but similar
operations are done everyday, in hospitals all around the world. The most famous methods
are the START and the CESIRA. The Italian health ministery never defined a standard, but
generally the patients get divided in 4 groups: red (critical, immediate access), yellow (life
threatening, access within 15 minutes), green (access within 60-90 minutes), white[3]. The
triage produces a report containing the patient’s anagraphic data, the symptoms, the urgency,
date and time of access to the hospital. Since these procedures are rather standardized and not
much varying, they could be implemented in an autonomous agent, saving time for both the
nurse and the patient. A voice assistant could ask the patient all the standard questions, for
example the main symptoms, the body temperature, the full name, a pain evaluation. . . Having
done that, the agent could analyze the data and asking for human help only when needed.
Having a computer analyze the data instead of a human could, with a sufficient dataset, spot
patterns in symptomatologies that a human could not spot. For example, rare diseases are often
ignored by healthcare workers because of their rarity, but intersecting biometric data with the
patient’s declarations could make patterns emerge.
148
Simone Montali et al. 147–159
3. Mycroft
3.1. Why Mycroft?
The most popular voice assistants, like Google Assistant or Amazon Alexa, are proprietary
software made by corporations. While this may be good for the usability and functionality, it
lacks a critical feature: privacy. Since trust, security and privacy of health data are tremendously
precious, we need to protect them, and doing that while using a proprietary voice assistant is
kind of impossible. Choosing an open source alternative allows us to guarantee data privacy,
extensibility, customizability, and last but not least, a free tool that every hospital could
use.
• Precise, a wake word listener based on a Gated Recurring Unit, a recurrent neural network
similar to a Long Short-Term Memory network with a forget gate [6]. It is trained over
audio tracks, not text, making the software compatible with different accents, dialects,
languages.
• The Speech To Text component isn’t stable enough yet. Because of this, this project uses
the Google STT engine [7]. The requests are bucketed and proxied through Mycroft’s
servers to provide a privacy layer.
• The intent interpretation is based on two tools: Padatious and Adapt. While Adapt is
based on keywords recognition, Padatious is based on a neural network trained over full
phrases. Padatious can even extract entities from the intent, like a city name or a disease.
• While Mycroft built a Text To Speech engine, Mimic, it isn’t currently available in italian.
Because of this, we’re using the Google STT engine, with proxied requests.
• A graphical user interface was built over the Qt library using KDE Plasmoids, graphical
components available in the KDE Plasma desktop environment.
4. Skill Creation
The greatest power Mycroft has to offer is its modularity: every responsibility is tied to a single
module, named skill, which interprets the related requests and provides an answer. Some
examples might be a joke-telling skill, a reminder skill, a timer skill. When Mycroft receives a
request, it checks all of the skills’ intents for matches. If a match is found, the related function
is called. Skills are coded in Python, and have a standard structure. To generate the boilerplate
code for a new skill, Mycroft provides a command line interface.
149
Simone Montali et al. 147–159
• dialog files: these files contain the assistants’s answer dialogs. Multiple phrases are
included and randomly chosen: this makes the assistant more human.
• intent files: these files are used to train the Padatious’ neural network. They contain
example phrases for every intent.
• voc files: these files contain Adapt keywords. Since this project strictly relies on Padatious,
these are almost not used.
• entity files: these files contain entities to be extracted by padatious, like city names,
diseases. . .
• settingsmeta.yaml: this YAML file defines the skill’s settings, to be edited on the
Mycroft Home website.
• __init__.py: this file contains the skill’s main code. It is based on an extension of the
MycroftSkill class, which contains the classes and decorators needed to define a new
skill.
4.2. hospital-triage-skill
The skill is structured as follows: every symptom type is caught in an intent. Basing on the
symptom type, different things happen: a urgency code is assigned to the patient (red, yellow,
green), anagraphical data is collected, minor symptoms are checked. . . All the collected data gets
saved to a Python dictionary to be exported in JSON. All the standard operations, like asking
for a pain evaluation or the patient’s name, are handled by decorators.
Every suspected patient starts with a score of 1, and if the final score reaches a threshold (by
default equal to 15, but it can be adjusted basing on the pandemic’s recession) the patient is
advised to stay where he is and wait for a doctor to visit him.
150
Simone Montali et al. 147–159
4.4. Helpers
The agent needed some helpers to cope with challenges the italian language implies. An example
might be the temperature extraction from an utterance: some inputs may be "trentasette e mezzo",
"trentasette punto cinque", "trentasette virgola cinque", "trentasette cinque", all meaning the same
thing. Another example is the number validation: the bot may interpret a "sei" as the verb
essere instead of a number.
{
"can_talk": "yes",
"main_symptom": "breathing",
"code": "red",
"fever": 38.7,
"has_sore_throat": "yes",
"has_cold": "no",
"has_breathing_difficulties": "yes",
"has_cough": "yes",
"has_had_contacts": "yes",
"misses_taste": "yes",
"covid_score": 22.6304,
"symptom_declaration": "ho fiatone",
"age": 21,
"other_symptoms": "ho mal di testa",
"pain_index": "8",
"full_name": "marco rossi"
}
151
Simone Montali et al. 147–159
5.1. Dataset
Since the medical data is fortunately well protected by privacy laws all around the world, finding
medical datasets is not easy. However, creating a dataset from scratch is still possible: this is
exactly what Appen, an australian start up, did. The dataset used in this project [9] contains
audio snippets, transcriptions and symptomatologies of patients requesting help to nurses. Since
the Mycroft’s STT engine handles the conversion to text, we only need to train a classifier that
maps patient requests to symptom types. An example of this dataset’s entries may be:
152
Simone Montali et al. 147–159
• Phrase: My son had his lip pierced and it is swollen and the skin inside on his lip is grey
and looks infected.
• Prompt: Infected wound
t = translator
for index, row in data.iterrows():
phrase = translator.translate(
row["phrase"],
dest="it").text
prompt = t.translate(
row["prompt"],
dest="it").text
if (t.detect(phrase).lang == "it" and
t.detect(prompt).lang == "it"):
td = translated_data
td.at[i, "phrase"] = phrase
td.at[i, "prompt"] = prompt
i = i+1
When Google Translate can’t recognize a phrase’s meaning, it skips it. The translator object,
besides translating things, can even detect languages. This allows us to do a little workaround:
if the detected language isn’t italian in both the phrase and the symptomatology, the entry is
skipped. This reduced the dataset from 8000 entries to almost 2000.
153
Simone Montali et al. 147–159
Term Memory[12], which enables the training to find patterns in distant parts of the text,
Average SGD and Dropconnect, a dropout that drops weights instead of activations [13]. We
can now train the network and check the confusion matrix: While it isn’t perfect, the diagonal in
the matrix shows that the model was trained correctly. Speaking about accuracy, the model
reached more than 60%: We can now easily export it and integrate it in the voice assistant by
a simple import.
154
Simone Montali et al. 147–159
Figure 2: Accuracy
{
"name": "Dolore al collo",
"emoji": "[removed]",
"code": "yellow",
"covid": false
}
Having done that, the symptoms can now be handled like any other one. Ideally, we’d like to
check if the classifier worked right by asking the patient. An example of conversation may be:
155
Simone Montali et al. 147–159
• User: Nine.
• Voice assistant: If there’s any other symptoms I need to know, please tell me
• User: Nothing else.
• Voice assistant: Could you please tell me your full name?
• User: Mario Rossi.
• Voice assistant: Mario Rossi, is that right?
• User: Yes.
• Voice assistant: Thanks for your patience, go at the YELLOW desk.
6. Information retrieval
This agents’s use cases might not be limited to triage and helping in emergencies. In fact, a
patient could just want to know some medical informations about a particular disease without
having to talk to a doctor.
156
Simone Montali et al. 147–159
• Voice assistant: What would you like to know? Choose between Description, Symptoms,
Causes, Therapy, Complications
• User: Tell me the causes.
• Voice assistant: This is what I know: celiac disease is a multifactorial condition. . .
8. Conclusions
The global pandemic the world had to bear with has highlighted how hospitals, in the last years,
have been forgotten by politicians, people, nations. In the last 20 years, in Italy, the number
of institutes diminished from 311 thousands to 191 thousands, while the public spending was
raised from 60 miliards to 112[15]. With the aid of human-centred intelligent systems[16, 17],
health workers could get some relief and concentrate on what matters more: curing people.
Voice assistants could flatten the digital divide, being easy to use for everyone, including the
elder. Translation of the agent to multiple languages could be an incredible tool for immigrants,
tourists and travelers who can’t speak the national language. Right now, the most urgent
improvement to make is finding or creating a better dataset: if the classifier worked better,
we could skip the hardcoding of the most common symptoms and just leave one skill. The
ultra low cost of this project’s requirements makes it possible for every hospital in the world to
install a tool like this. The open source design (all the source code is licensed with a GPL-3.0
license) guarantees freedom, privacy, expansibility, customizability, and, last but not least, the
possibility of saving lives without having to pay a price.
9. Source code
Every single line of code of this project is open source and available on GitHub:
• Mycroft skill for the triage operations and the information requests: montali/hospital-
triage-skill
157
Simone Montali et al. 147–159
• Fallback skill for the NLP classification and diagnosis of symptoms: montali/hospital-
fallback-skill
• Health Ministery’s encyclopedia scraper: montali/medical-infos-api
10. Acknowledgements
The authors of this paper would like to thank Prof. Elena Bignami, M.D. in Anesthesiology,
Critical Care and Pain Medicine Division, Department of Medicine and Surgery, University of
Parma and her team for their collaboration and their precious advices.
References
[1] B. Kinsella, A. Mutchler, Voice assistant consumer adoption in health-
care, Voicebot.AI & Orbita Report (2019). URL: https://voicebot.ai/
voice-assistant-consumer-adoption-report-for-healthcare-2019/.
[2] J. Bazyar, M. Farrokhi, A. Salari, H. R. Khankeh, The principles of triage in emergencies
and disasters: a systematic review, Prehosp Disaster Med 6 (2020) 1–9.
[3] Linee di indirizzo nazionali sul triage interospedaliero, Ministero Della Salute - Re-
pubblica Italiana, 2019. URL: http://www.salute.gov.it/imgs/C_17_notizie_3849_listaFile_
itemName_1_file.pdf.
[4] T. J. Judson, A. Y. Odisho, A. B. Neinstein, J. Chao, A. Williams, C. Miller, T. Moriarty,
N. Gleason, G. Intinarelli, R. Gonzales, Rapid design and implementation of an integrated
patient self-triage and self-scheduling tool for covid-19, Journal of the American Medical
Informatics Association 27 (2020) 860–866.
[5] R. Harrington, Customize an open-source hal for your home, Popular Science (2016). URL:
https://www.popsci.com/ultimate-diy-ai/.
[6] F. A. Gers, J. Schmidhuber, F. Cummins, Learning to forget: Continual prediction with
lstm, Neural Computation 12 (2000) 2451–2471.
[7] Speech-to-text, Google AI and machine learning products (2020). URL: https://cloud.google.
com/speech-to-text.
[8] Nuovo coronavirus covid-19, Pagine Mediche (2020). URL: https://www.paginemediche.it/
coronavirus.
[9] P. Mooney, Medical speech, transcription, and intent, 2019. URL: https://appen.com/
datasets/audio-recording-and-transcription-for-medical-scenarios/.
[10] G. Lombardo, P. Fornacciari, M. Mordonini, L. Sani, M. Tomaiuolo, A combined ap-
proach for the analysis of support groups on facebook-the case of patients of hidradenitis
suppurativa, Multimedia Tools and Applications 78 (2019) 3321–3339. doi:10.1007/
s11042-018-6512-5.
[11] G. Lombardo, A. Ferrari, P. Fornacciari, M. Mordonini, L. Sani, M. Tomaiuolo, Dynamics
of emotions and relations in a facebook group of patients with hidradenitis suppurativa,
in: International Conference on Smart Objects and Technologies for Social Good, Springer,
2017, pp. 269–278. doi:10.1007/978-3-319-76111-4\_27.
158
Simone Montali et al. 147–159
159
Session 5
Agents & Actors for Data Science
Calibration of an agent-based model for opinion
formation through a retweet social network
Loretta Mastroenia , Maurizio Naldib and Pierluigi Velluccia
a
Dept. of Economics, Roma Tre University, Via Silvio D’Amico 77 00145 Rome, Italy
b
Dept. of Law, Economics, Politics and Modern languages, LUMSA University, Via Marcantonio Colonna 19 00192 Rome,
Italy
Abstract
Calibration of agent-based models (ABM) for opinion formation is needed to set their parameters and
allow their employment in the real world. In this paper, we propose to use the correspondence between
the agent-based model and the social network where those agents express their opinions, namely Twitter.
We propose a calibration method that uses the frequency of retweets as a measure of influence and allows
to obtain the influence coefficients in the ABM by direct inspection of the weighted adjacency matrix
of the social network graph. The method has a fairly general applicability to linear ABMs. We report a
sample application to a Twitter dataset where opinions about wind power (where turbines convert the
kinetic energy of wind into mechanical or electrical energy) are voiced. Most influence coefficients (76%)
result to be zero, and very few agents (less than 5%) exert a strong influence on other agents.
Keywords
Opinion formation, Agent-based models, Twitter, Calibration
1. Introduction
Agent-based models (ABM) are increasingly used to analyse opinion formation (see the survey
in [1]), as an alternative to econophysics models [2]. Some examples with general applicability
are described in [3, 4, 5, 6]; they are also applied to study specific phenomena such as equality
bias [7] or personal finance decisions [8, 9].
However, models with no application to real world data may be too abstract. In the mathemat-
ical model describing the interactions among agents, we need to set the parameters governing
those interactions, i.e. to calibrate those models. Calibration allows us to obtain realistic ex-
pectations about the behaviour of a social group. Very few studies have attempted to calibrate
agent-based models. We can group them into two classes, where data are obtained respectively
through a laboratory experiment of from the observation of a real social network.
One of the first example of the former class is the celebrated Friedkin-Johnsen model [10],
which has been evaluated through data collected on small groups in a laboratory [11], where
the authors asked their subjects to estimate the extent to which each other group member
influenced their final opinion by means a mechanism based on a reward paid in poker chips.
Another example is provided in [12], where participants in the experiment expressed their
WOA 2020: Workshop “From Objects to Agents”, September 14–16, 2020, Bologna, Italy
" [email protected] (L. Mastroeni); [email protected] (M. Naldi); [email protected]
(P. Vellucci)
© 2020 Copyright for this paper by its authors. Use permitted under Creative Commons License Attribution 4.0 International (CC BY 4.0).
CEUR
Workshop
Proceedings
http://ceur-ws.org
ISSN 1613-0073
CEUR Workshop Proceedings (CEUR-WS.org)
161
Loretta Mastroeni et al. 161–173
opinion about the best location for a new leisure center (on the line across two towns), and
the influence could be observed through the evolution of one’s opinion after examining the
opinions of others.
Influence in real contexts has instead been studied through social networks. An advice
network inside a manufacturing company was considered in [13] on the basis of the data
provided in [14]. The influence of any individual was assumed to be proportional to the number
of people who seek advice from him/her. A political context, namely the American Senate, was
instead investigated in [15], where co-sponsorship of bills was taken as a measure of influence.
The opinion value for each senator was assumed to be the fraction of votes when he/she was
present and voted with the majority. Finally, a co-habitation context, namely a university
student dormitory, was analysed in [16], where the Social Evolution dataset enclosed in [17]
was employed. A similar context is also the stage for the study contained in [17], where surveys
were conducted monthly on social relationships, health-related habits, on-campus activities and
other issues.
Here we wish to propose a method to calibrate agent-based models for opinion formation,
considering data extracted from an online social network, namely Twitter. This contrasts with
the contributions appeared in the literature so far, where just physical social networks have
been considered. The abundance of data appearing in online contexts makes them a natural
choice to look at for our goal. We measure the influence by the frequency of retweeting, which
makes our methods applicable to any social network where reposting of opinions is allowed.
Our major original contributions can be summarised as follows:
• for that specific context, we show that, though most actors exert an influence, very few
exert a strong influence (i.e., being retweeted more than once);
• for that specific context, we show that the influence of any agent is limited to one other
agent in most cases so that the matrix of influence coefficients is sparse.
162
Loretta Mastroeni et al. 161–173
14
𝐵 𝐶
30
13
25
3 𝐴 2
4
5
6
𝐸 𝐷
a topic to the message: all messages concerning a specific topic (as identified by the hashtags
included in those messages) can be retrieved at once by searching for that hashtag.
Twitter allows retweeting a message, i.e., reposting somebody else’s tweet. This is a sign
of support for somebody else’s opinion, stronger than just following him/her because it is an
uncritical sharing of his/her opinions (retweeting through the Retweet button does not allow
to add comments). It is also specific because it concerns a single message. Being retweeted is
a sign of influence. We are using retweets to measure the influence of somebody’s opinion
on other participants in a social network. In particular, we build a retweet network. Retweet
networks have been designated (see Chapter 4 of [19]) as a major tool to analyse the influence
of twitterers. In our network each node represents a twitterer (an agent in the corresponding
agent-based model) and an edge from node 𝐴 to node 𝐵 means that 𝐴 has been retweeted by
𝐵. The weight associated to that edge is the number of retweets: the weighted out-degree of
a node is the measure of the associated agent’s influence. In the end, we obtain a weighted
directed network. It is to be noted that this network allows us to quantify the influence of each
agent on each other agent, which is what we need in our any-to-any agent-based model, rather
than the overall influence of a twitterer (as in [20]).
In Figure 1, we show a toy retweet network made of five twitterers to illustrate this concept.
We see that 𝐶 has been retweeted 13 times by 𝐴, and 14 times by 𝐵, but has never retweeted
either 𝐴 or 𝐵. Retweeting is not symmetric in general.
3. Calibration methodology
Our aim is to set the parameters defining an agent-based model for opinion formation, i.e., to
calibrate the model, exploiting the data retrieved from Twitter. In this section, we describe our
calibration method and highlight its applicability.
For the time being, without loss of generality, we refer to an agent-based model such as
described in [5], where the generic agent 𝑖 features a quantity 𝑥𝑖 (𝑡) representing its opinion at
time 𝑡. Then we denote the opinions of all the agents at time 𝑡 by the vector 𝑥(𝑡); its evolution
163
Loretta Mastroeni et al. 161–173
with 𝑆 being the matrix of influence coefficients. Namely, the element 𝑠𝑖𝑗 of 𝑆 describes the
effect of the opinion of the agent 𝑗 on the opinion of the agent 𝑖.
The process leading from Twitter activity to the matrix of influence coefficients is made of
the following phases:
1. scraping Twitter data;
164
Loretta Mastroeni et al. 161–173
• opinion domain;
• interaction direction;
• interacting agents;
• updating equation;
• updating frequency;
• utility function.
Opinion domain. Though an opinion is intrinsically a qualitative and potentially multi-
faceted feature, we have to describe it by a numeric variable and choose the domain where that
variable can lie. The following three domains have been surveyed in [1]:
• discrete;
• continuous over a bounded interval;
• continuous over R.
In the discrete case, the agent may choose its opinion within a limited set. Discretization lends
itself well to represent a qualitative feature through a proper mapping. For example, if we
consider the simplest discrete case where we have a binary opinion variable, the two values
may represent respectively a positive versus a negative opinion.
If the domain is instead a continuous but bounded interval, a common choice is the [0, 1]
interval.
The method proposed here is generally applicable to any opinion domain, since the applica-
bility condition concerns the values of the influence coefficients. However, the closure property
may impose some conditions on the influence coefficients. By closure property we mean that
the set 𝑉 is closed with respect to the application of the state updating equation. For example,
in [5], where 𝑉 = [0, 1] and the agents belong to one of 𝑐 classes (𝑛𝑖 representing the number
of agents in class 𝑖), and similarly in [4] for the pairwise case, the closure property requires that
𝑐
∑︁ 𝑐
∑︁
𝑠𝑖𝑖 (𝑛𝑖 − 1) + 𝑠𝑖𝑘 𝑛𝑘 ≤ 1 𝑖 = 1, 2, . . . , 𝑛𝑗 (3)
𝑘=1 𝑗=1
𝑘̸=𝑖
Interaction direction. That feature considers which way the agents influence each other.
again, we refer to the classification established in [1]. In a bilateral interaction, any two agents
always influence each other mutually. We have instead a unilateral influence when an agent
may influence another agent without being influenced by it. Even in the bilateral case, the
influence may not be perfectly symmetrical, since we can have different weights in the opinion
updating equations, signalling that the impact of agent 𝑋 on agent 𝑌 is different from that in
the reverse direction.
The method is applicable when the interaction direction is bilateral, non symmetric since
retweeting may take place in either direction.
Interacting agents. As to the number of agents that interact at each step, the classification
adopted in [1] considered the following three:
165
Loretta Mastroeni et al. 161–173
• pairwise;
• any-to-any;
• closest neighbours.
In the pairwise case, just two agents interact at any single opinion updating round. Since the
pairs may change at each round, any agent may interact (influencing or being influenced by)
with any other agent in the long run. The any-to-any interaction case is obviously the case
where all the agents change their opinion at each time step, since they are influenced by the
opinions of the other agents at the previous time step. Finally, in the closest neighbour case,
any agent interacts just the closest agents (where the notion of closest involves the use of some
distance metric, which is natural in a social network).
In our method, since the interaction is associated with retweeting, and any twitterer can
retweet any other twitterer, the calibration we propose applies to all three categories. For the
case of pairwise interaction, the weights will be employed in pairs at each round, though they
have been estimated considering the embedding social network as a whole. As to the closest
neighbour case, if the distance employed for agents is that established on the embedding retweet
network, there is actually no difference, since the closest neighbour are those retweeting and
actually the only ones exhibiting a non-zero weight.
Updating equation. The updating equation is the function that relates the opinion of an
agent to the opinions of the other agents. Here, the classification proposed in [1] is quit simple,
considering a linear vs a nonlinear model.
Here we have described the method considering just linear updating equations so far, but
it could also be applied to non-linear updating equations, though requiring a more complex
mapping from 𝑀 to 𝑉 .
Updating frequency. This parameter can be considered as the speed of the opinion for-
mation process. The survey in [1] considers periodic and aperiodic updating. In the periodic
setting, each time step involves a change of opinions for all the agents. On the other hand, we
fall in the aperiodic case when just a couple of agents changes their opinion at each time step
(and it is not known in advance when their turn comes again), or opinions are updated just after
a triggering event, or opinion change takes place for a random selection of agents at each time.
Our calibration method is agnostic to the choice of updating frequency, since it can be applied
as many times as desired.
Utility function. Again, our calibration method is agnostic to the choice of utility function,
as long as that does not impact on the influence coefficients.
4. The dataset
As recalled in the Introduction, for our calibration method we have chosen an application
example concerning the influence of people’ opinions about wind power. In this section, we
describe our dataset and the procedure we have adopted to build it.
The procedure goes along the following four phases:
1. tweet retrieval;
166
Loretta Mastroeni et al. 161–173
2. duplicate removal;
In order to retrieve all relevant tweets, we exploit the Twitter API by searching for all the tweets
containing either of the following word combinations:
We deem those words to be fairly representative of the tweets associated to wind power for our
calibration demo. Of course, if our aim were to go beyond a demo, we could devise an ampler
set of words to obtain a dataset as exhaustive as possible. In this paper, we consider the tweets
posted in the week ending on December 9, 2019. Again, the calibration could be made more
accurate by extending the analysis horizon over several weeks or even longer periods.
Since many tweets contain both the above combinations, our basket after the retrieval phase
may contain duplicates. In the second phase of our procedure, we remove all duplicates. The
unique tweets after Phase 2 are 36539.
We must however recognize the possibility of including tweets that, despite binding the word
wind to power or energy terms, are not relevant to our actual theme, i.e. the use of wind to get
electrical power. Examples of such tweets are shown in Figure 2.
We need to eliminate as many as possible non-relevant tweets. In order to arrive at a set
of relevant tweets, we employ a semi-automatic procedure, based on hashtags and the co-
occurrence principle. Our procedure, which makes up Phase 3 of the overall procedure mentioned
above, goes through the following steps:
2. identify the hashtags that are surely relevant with out topic and form a group with them
(say Group X);
3. form a group with all the other hashtags (say Group Y);
4. examine all tweets containing Group Y hashtags but not Group X ones, and move their
hashtags to Group X if those tweets are relevant;
5. assign to Group X all the hashtags co-occurring with Group X hashtags (this is not done
iteratively, but just once for each Group X hashtag).
1. building the network of hashtags, where an edge is drawn between two hashtags if those
two hashtags co-occur in at least one tweet;
167
Loretta Mastroeni et al. 161–173
(b) Tweet 2
(a) Tweet 1
(c) Tweet 3
Figure 2: Example of non-relevant tweets.
A subset of the hashtag network is shown in Figure 3, where the nodes (hashtags) belonging
to Group X are highlighted in dark colour.
At this point we have the Group X of relevant hashtags. We can consider a tweet as relevant
if it contains any hashtag included in Group X and build the retweet network on the basis of
those tweets as described in Section 3. The resulting network is built out of 4739 tweets and is
made of 3528 nodes and 3617 edges.
168
Loretta Mastroeni et al. 161–173
2. how widespread is the influence of any single agent upon the community?
3. how heavy is the influence of any single agent on another specific agent?
As to RQ1, we already have a partial answer from Figure 4. There are wide imbalances in the
connectivity of individual nodes. The sparsity of the adjacency matrix is 99%; this means that
the network is extremely far from a fully-meshed network where every twitterer retweets all
his/her fellows. However, this should be better investigated over time, since we considered
a single week, and retweeting relationship accrue over time. In fact, though older tweets are
often quickly forgotten, most users tend to “live in the present”, forgetting or abandoning topics
they followed just some hours or days after, the retweeting relationship lasts over time if the
retweeting user is a convinced follower/supporter of the retweeted one.
In order to answer RQ2, we show the distribution of nodes by their degree in Figure 5(a).
We see that 89.6% of the agents influences just another agent (the corresponding nodes have
degree 1), though there is a very small number of agents exerting their influence on a large
169
Loretta Mastroeni et al. 161–173
number of other agents, even more than 10. An overall measure of the imbalance in influence is
given by the graph centralization measure (see Chapter 5.3.1 of [22]), which takes values in the
[0,1] range, with 0 corresponding to a network where all the agents have the same influence,
and 1 corresponding to a star network (maximum possible imbalance). The centrality measure
we consider is based on the degree (i.e., the number of links incident upon a twitterer in the
embeddding retweet network). Mathematically, if 𝑔𝑣 is the degree of node 𝑣, and 𝑣 * is the node
exhibiting the highest degree the graph centralization is:
∑︁𝑛
1
𝐺 := [𝑔𝑣* − 𝑔𝑣𝑖 ] . (4)
(𝑛 − 1)(𝑛 − 2)
𝑖=1
In our case, the graph centralization measure achieves an intermediate value, namely 0.4275.
Though this could appear lower than expected, given the emergence of a few dominant twitterers,
those large imbalances that inflate the sum in Equation (4) are probably countered by the large
size of the network (hence, large value of 𝑛 that enlarges the denominator in Equation (4)).
As to RQ3, in the correspondence between the retweeting network and the agent-based
model, we have set the influence coefficients proportional to the edge weights. A measure of
the level of influence exerted by twitterers on their fellows is therefore the weight: if some
edge is associated to a large weight, that relationship bears a heavy influence. If we look at the
distribution of edge weights in Figure 5(b), we see that most twitterers (94.8%) exert just a small
influence on others (i.e., the weight of their edges is just 1), though there are a small minority
that are retweeted more frequently (even 7 times over the week of observation) and therefore
exert a heavier influence.
170
Loretta Mastroeni et al. 161–173
3,161
3,000
No. of agents
2,000
1,000
201
50 30 13 15 9 7 2 8 4
0
1 2 3 4 5 6 7 8 9 10 11
degree
3,000
No. of edges
2,000
1,000
145 29
6 1 3 2 0
0
1 2 3 4 5 6 7 8
weights
6. Conclusions
Our paper deals with a critical issue in the development of agent-based models, i.e., setting
the parameters that govern the model and allow to apply such models in the real world (what
we call the calibration of the model). Our method can be applied whenever the agents act in a
social network. Though we showed an example using Twitter data, any social network allowing
an opinion reposting mechanism can be used. Also, the class of agent-based models to which
it can be applied is fairly large. The only significant limitation of the current approach is the
linear form of the equations that govern the interaction among agents. The possible limitations
on the correspondence between the ranges of influence coefficients in the agent-based model
on one side and edge weights in the social network on the other side could be addressed easily
by suitable operations, e.g., by translation and rescaling to realign the two ranges or possibly
by nonlinear transformations.
We therefore envisage this calibration model to fill the gap between the theoretical analysis
171
Loretta Mastroeni et al. 161–173
of an agent-based model and its applicability in a real world context. We wish to address its
limitations as to the applicability to nonlinear models and different parameter ranges in our
future work.
References
[1] L. Mastroeni, P. Vellucci, M. Naldi, Agent-based models for opinion formation: a biblio-
graphic survey, IEEE Access (2019) 1–12.
[2] P. Vellucci, M. Zanella, Microscopic modeling and analysis of collective decision making:
equality bias leads suboptimal solutions, Annali dell’Università di Ferrara (2017).
[3] Y. Shang, An agent based model for opinion dynamics with random confidence threshold,
Communications in Nonlinear Science and Numerical Simulation 19 (2014) 3766–3777.
[4] S. Monica, F. Bergenti, An analytic study of opinion dynamics in multi-agent systems,
Computers & Mathematics with Applications 73 (2017) 2272 – 2284.
[5] L. Mastroeni, M. Naldi, P. Vellucci, Opinion dynamics in multi-agent systems under
proportional updating and any-to-any influence, in: M. Paolucci et al. (eds.), Advances in
Optimization and Decision Science for Society, Services and Enterprises, AIRO Springer
Series 3, Springer Nature Switzerland., 2019. URL: https://www.springer.com/gp/book/
9783030349592#aboutBook.
[6] E. Dacrema, S. Benati, The mechanics of contentious politics: an agent-based modeling
approach, The Journal of Mathematical Sociology 44 (2020) 163–198.
[7] L. Mastroeni, M. Naldi, P. Vellucci, Individual competence evolution under equality bias,
in: European Modelling Symposium (EMS), Manchester, 2017.
[8] T. Lux, Estimation of an agent-based model of investor sentiment formation in financial
markets, Journal of Economic Dynamics and Control 36 (2012) 1284–1302.
[9] L. Mastroeni, M. Naldi, P. Vellucci, An agent-based model on scale-free networks for
personal finance decisions, in: Proceedings of the 20th Workshop "from Objects to Agents",
2019.
[10] N. E. Friedkin, E. C. Johnsen, Social influence and opinions, The Journal of Mathematical
Sociology 15 (1990) 193–206.
[11] N. E. Friedkin, E. C. Johnsen, Social influence networks and opinion change, Advances in
Group Processes 16 (1999) 1–29.
[12] M. Mäs, A. Flache, Differentiation without distancing. Explaining bi-polarization of
opinions without negative influence, PLOS ONE 8 (2013) 1–17.
[13] P. Jia, A. MirTabatabaei, N. E. Friedkin, F. Bullo, Opinion dynamics and the evolution of
social power in influence networks, SIAM Review 57 (2015) 367–397.
[14] D. Krackhardt, Cognitive social structures, Social Networks 9 (1987) 109 – 134.
[15] K. R. Varshney, Bounded confidence opinion dynamics in a social network of Bayesian
decision makers, IEEE Journal of Selected Topics in Signal Processing 8 (2014) 576–585.
doi:10.1109/JSTSP.2014.2309945.
[16] L. Li, A. Scaglione, A. Swami, Q. Zhao, Consensus, polarization and clustering of opinions in
social networks, IEEE Journal on Selected Areas in Communications 31 (2013) 1072–1083.
172
Loretta Mastroeni et al. 161–173
[17] A. Madan, M. Cebrian, S. Moturu, K. Farrahi, A. Pentland, Sensing the “health state” of a
community, IEEE Pervasive Computing 11 (2012) 36–45.
[18] T. O’Reilly, S. Milstein, The twitter book, O’Reilly Media, Inc., 2011.
[19] S. Kumar, F. Morstatter, H. Liu, Twitter data analytics, Springer, 2014.
[20] E. Bakshy, J. M. Hofman, W. A. Mason, D. J. Watts, Everyone’s an influencer: quantifying
influence on twitter, in: Proceedings of the fourth ACM international conference on Web
search and data mining, ACM, 2011, pp. 65–74.
[21] J. Gentry, Package ‘twitteR’, CRAN repository., 2016. URL: https://cran.r-project.org/web/
packages/twitteR/twitteR.pdf.
[22] S. Wasserman, K. Faust, et al., Social network analysis: Methods and applications, volume 8,
Cambridge university press, 1994.
173
Actor-based architecture for Cloud Services
Orchestration: the case of social media data
extraction
Stefano Cavalli, Stefano Cagnoni, Gianfranco Lombardo and Agostino Poggi
University of Parma
Abstract
In this paper we present a distributed system for social media scraping which aims to acquire an
arbitrarily large number of information from social networks, by exploiting an actor-based solution able
to orchestrate efficiently several services on cloud. Our goal is to ensure that correct operations among
actors occur, thanks to a master node, based on the ActoDeS architecture, which takes care of managing
communications, interface and messages exchanged by client nodes. As a use case, we consider Twitter
as social media platform for the key role that is playing in the modern society, as shown by Google
Trends data. However, Twitter’s search API have many limitations and there is definitely no way to make
it work when it comes to obtaining millions of records within a monthly or annual time range. Thus,
we have designed a distributed solution that is able to overcome these constraints without breaking the
current laws on this subject and the policies of Twitter.
Keywords
Actor-based systems, Cloud computing, Web-scraping, Data Analysis
1. Introduction
Nowadays, web scraping is one of the most widely used techniques to extract any type of data
from a web page, thanks to multiple software that automatize this process. Over the past few
years, it has been the subject of many controversies but on September 9th 2019, the Appeal from
the United States District Court for the Northern District of California officially declared [1]
that web scraping is not illegal, as are not methodologies that try to prevent users from working
on it, provided that no access is made by the software within the platform itself. Therefore, in
the United States, as well as in the rest of the world, laws are changing and more than ever the
knowledge represents a truly competitive key for companies and industries.
With over 500 million tweets per day, according to their 2020 Q1 report [2], Twitter has
over 166 million daily active users who generate a quantity of information that can certainly
be defined as big data. In light of this, the interest in big data generated over social media is
increasing and, at the same time, software solutions to perform data extraction are more and
WOA 2020: Workshop “From Objects to Agents”, September 14–16, 2020, Bologna, Italy
" [email protected] (S. Cavalli); [email protected] (S. Cagnoni); [email protected]
(G. Lombardo); [email protected] (A. Poggi)
0000-0002-3505-0556 (S. Cavalli); 0000-0003-4669-512X (S. Cagnoni); 0000-0003-1808-4487 (G. Lombardo);
0000-0003-3528-0260 (A. Poggi)
© 2020 Copyright for this paper by its authors. Use permitted under Creative Commons License Attribution 4.0 International (CC BY 4.0).
CEUR
Workshop
Proceedings
http://ceur-ws.org
ISSN 1613-0073
CEUR Workshop Proceedings (CEUR-WS.org)
174
Stefano Cavalli et al. 174–183
Figure 1: Google Trends data shows interest over time in Twitter (blue) and Facebook (red) expressed
by people from all over the world, within a time range which goes from July 2013 to July 2020
more demanded. Several research works have also highlighted the importance of collecting
contents from the main social media platforms, such as Facebook and Twitter, to perform
various kinds of analysis. For example, in [3], data from Facebook are used to analyze a rare
disease. In [4], social media data are used to study collaboration in firms and organizations. In
[5] and [6], data from Twitter are used to train classifiers able to detect troll users.
Moreover, different sentiment analysis techniques perform really well and obtain successful
results when applied to social media [7, 8, 9]. These applications are improving day by day and
they are moving to cloud and to distributed systems, to better tackle countless performance
issues, software and hardware conflicts, backup and replication problems. Cloud orchestration
manages and coordinates all the activities coming from cloud automation, i.e., those processes
that run without the need for human interaction. Nowadays, cloud orchestration brings many ad-
vantages depending on the application context: cost reduction and scaling, efficiency, improved
security and enhanced visibility into resources.
When it comes to distributed computing and actor-model, one of the software frameworks
for multi-agent and actor architecture modelling is ActoDeS [10]: developed entirely in Java, it
takes advantage of the actor model by delegating the management of events to the execution
environment. Moreover, thanks to the use of different implementations of components that
manage the execution of the actors, it is suitable for the development of efficient and scalable
applications in particular in the data mining domain [11]. In this environment, messages, actors
and message patterns are all instances of Java classes. Every message is an object containing a
set of fields, a message pattern is an object defined as a combination of constraints on the value
of some message field and the actor address acts as both a system-wide unique identifier and a
local and remote proxy of an actor.
In this article, we present an actor-based architecture for orchestrating cloud services. In
particular, as use case, the system aims at easing the execution of data extraction from Twitter.
The following tasks are available: retrieving data for a long period of time, without any limitation;
distributing the computing power and computational logic on different machines and making
sure that a master process will orchestrate all services.
2. Related Work
Examining the state of the art of web scraping [12], we confirm that this term is always
considered in two different contexts: (i) data collection, in which the main focus is not a real-
175
Stefano Cavalli et al. 174–183
time system, therefore speed performance is not an important factor and it does not affect results;
(ii) work within a real-time environment, where it is important to provide all the information
required and where a millisecond error could be very critical.
Nowadays, web scraping is widely used. Some of its applications include: job search [13],
weather data [14], advertisement [15], journalism [16], and health sector [17]. Financial trading
[18] is also important and requires real-time systems to be very performing. News, along with
political-economic decisions, may drastically influence a price stock within a very short time
range, where web scraping automation plays a fundamental role. In this case, web scraping is
used to design and implement automated bots that act as trading decision support systems [19].
In 2017, Trifa et al. [20] described a Personalized Multi-Agent Systems (PMAS) on a distributed
and parallel architecture in order to predict users’ topics of interest using data coming from
web scraping tools, focusing on Twitter, Facebook and LinkedIn. As previously mentioned, we
have chosen to evaluate Twitter as social network because it is still increasing its user base
against Facebook, which instead has set an interest decrease for seven consecutive years, based
on Google trends data [21] (Figure 1) which is frequently used in data analysis and statistical
topics.
Building a cloud system, in order to analyze an unlimited amount of data, avoids running into
several problems and leads to multiple advantages. Integrity, which refers to data completeness,
accuracy and consistency, must be kept safe; a cloud system always helps to provide data
integrity [22]. Along with it, connectivity, speed, scalability and store availability are also
features of cloud or cloud-hybrid systems. Working with services on a cloud-based environment
can be risky and drive into several problems [23]: large computational load can be required
and nodes could take too long for a decision-making process; recovery from mistakes that
can arise with a centralized decision making process would not be managed by the system.
By using an actor model, all these problems can be solved. This is due to the fact that each
actor is able to make decisions in this cloud-based environment, where only partial information
may be available. If one or more nodes fail, a readjustment process will take place in order
to prevent any related problem. Dealing with actor-model also brings some advantages: the
use of simple and high-level abstractions for distribution, concurrency and parallelism; an
asynchronous, non-blocking and highly performing message-driven programming model can
be easily designed; take advantage of a very lightweight event-driven processes.
Cloud orchestration and automation are well-known terms in tech industries. Based on
their context, researchers have different opinions about them, but when web services come
up, orchestration has been extensively discussed [24] along with concurrency programming.
Concurrency in today’s middleware is almost always thread-based and hardware still evolves
towards more parallel architectures. Threads are the most used way to execute code concurrently
and they should manage possible conflicts of their execution, avoiding synchronization that
seems to help on correct data ordering and consistency. However, this paradigm raises several
problems when it comes to deadlocks, maintaining data consistency and liveness. Most of the
problems with concurrency, such as deadlocks and data corruption, result from having shared
state. That is where the actors come into play: the actor model, where independent processes
exchange immutable messages, is an interesting alternative to the shared state model.
176
Stefano Cavalli et al. 174–183
Figure 2: Actor model cloud-based architecture: each node represents an actor enclosed in its cloud
environment; it can communicate exchanging messages with the master node, retrieving data coming
from Twitter. N stands for the number of actors the system is designed for.
3. System Architecture
In this section, we describe the cloud system architecture and its components, as shown in
Figure 2. The solution is composed by multiple actors that play different roles depending on
their behavior and act with different logics. The overall system combines several existing
technologies, which have strongly evolved during the last decades such as server, databases,
web services, actor model, networks and cloud. The main purpose of our work is to obtain any
number of tweets, specifying a time interval together with a language tag (i.e. "EN" for English)
and a keyword which is part of the tweets themselves.
177
Stefano Cavalli et al. 174–183
Figure 3: When clients are in IDLE state, they send a message to the master trough the WebSocket
and it replies with a set of operations coming from the List of Instruction, it than update the list
removing this specific item. In this example, two clients are busy for some other reasons and they are
not communicating with the server.
out their previous tasks and nobody send them new messages, these actors get passive and wait
for another message to receive. In this architecture, actors communicate asynchronously with
each other by sending immutable messages following a specific pattern which is later discussed.
A FIFO (First-In-First-Out) order is respected when an actor receive multiple messages from
others. Receiving messages is always a blocking operation from the actor point of view, however,
sending a new message must be non-blocking. In particular, when a slave wants to send data to
the master, it keeps going on working as a web scraping service: in this case, a non-blocking
operation cannot be performed at all.
The master node acts as a system orchestrator (Figure 3): firstly, it sets all the communication
channels between itself and all the other nodes, obviously located on separate servers. According
to the user’s requests, a list of instructions is made by the master node, which keeps it up-to-date
as needed during the execution time. The list of instructions contains a set of operations that
must be executed by the clients. At a certain point, while it is not working, a client can get
one of these instructions by establishing a WebSocket connection with the master and sending
a message to it. A WebSocket is a communication protocol, located at layer seven in the OSI
model and standardized by IETF as RFC 6455 in 2011, that provides full-duplex communications
channels over a single TCP connection. The master, which instantly reacts to this event and
wakes up, replies with a random message taken from the list of instructions and updates the
list, removing the instruction itself. While multiple clients may simultaneously connect to
the master, a FIFO (First-In-First-Out) strategy is applied in order to maintain consistency and
optimize the workload on all clients, avoiding that some of them work more than others or stay
inactive for too long, causing inefficiency. Once the client has done with its set of operations (a
178
Stefano Cavalli et al. 174–183
Figure 4: Once server sends a message to the clients, they send an http request to Twitter using a proxy
list, in order to retrieve tweet’s information. In this example, Slave_3 and Slave_N are busy and they are
not communicating with Twitter.
process which is extensively discussed below), it sends another message to the master using the
Remote Copy Protocol (RCP) to transfer files and Secure Shell (SSH) to provide authentication
and encryption. These files are all stored in the master’s server and they will be removed
from client’s one as soon as the sending process is successfully completed. When the list of
instructions is empty, it means there is no need to keep the client alive again and the server
interrupts its WebSocket.
179
Stefano Cavalli et al. 174–183
Table 1
Search parameters Lan, Interval, Kw
Parameter Description
Lan The language of a tweets..
Interval A specific interval that includes a list of tweets.
Kw A word, or sentence, that must be part of the tweets.
Table 2
Search parameters Lan, Interval, Kw
Parameter Description
Username Username of the tweet’s creator.
FullName Full name of the tweet’s creator.
User_id User id of the tweet’s creator.
Tweet_id Tweet’s id.
Tweet_url Tweet’s url.
Timestamp Tweet’s timestamp.
Replies Number of tweet’s replies.
Retweets Number of tweet’s retweets.
Likes Number of tweet’s likes.
Text Plain text of the tweet.
Html Html extracted from the tweet.
Table 3
Effective parameters Lan, Interval, Kw used while testing the entire system.
Parameter Value
Lan English
Interval 2009-01-01 / 2019-01-01
Kw Bitcoin
retrieve tweets from Twitter. We use a free proxy list [26] available from the web, which is a
list of open HTTP/HTTPS/SOCKS proxy servers that allow clients to make indirect network
connections to Twitter. This approach prevents from being banned by Twitter, once too many
http requests are made.
Once an http request is made, the Python Beautifulsoup4 library is used in order to parse the
content, retrieving all possible information a tweet may hold (Table 2).
4. Experimental Results
We have implemented the previously described system and a set of experiments has been
performed. Using twenty-two different clients and one server, while working on a distributed
and cloud environment, we have chosen the parameters described in Table 3.
The first problem we faced on is that when dealing with such systems, we will not have
180
Stefano Cavalli et al. 174–183
the data size, nor the execution time, until the execution itself is finished. Nobody has any
idea about how long it could takes to retrieve all those tweets, since we do not know how
many tweets may have been posted for a specific term in a given time interval. Choosing the
parameters mentioned above, we have realized that the execution time took 8 hours and 23
minutes (in a distributed system, it is the maximum execution time of the node that takes the
longest time to complete its work), and 53,353,764 tweets have been collected in multiple files
with comma-separated values (CSV) format, for a total physical size of 73 GB.
While working in a distributed cloud system the workload is shared among the nodes,
choosing a sequential approach within a non-distributed actor-model it requires a longer
execution time. The process includes one server which involves just one client. The client
receives all the information coming from the server and works on each request by processing
the data received from Twitter. However, this architecture shows no advantages at all, delaying
the execution time up to 193 hours and 52 minutes using the same parameters we already
focused on in the actor-model system.
5. Conclusion
The proposed actor-based approach shows how it is possible to obtain a large amount of data
coming from Twitter, using a distributed cloud-based system. The API limits imposed by Twitter
are incresingly difficult to avoid and restrict the scientific research progress in many field, such
as the Natural Language Processing (NLP). The actor-model we choose optimizes every single
action in order to guarantees a well distributed workload between all nodes, drastically reducing
the possibility that an IP address may be banned by Twitter using a list of free proxies available
on the web.
References
[1] Appeal from the United States District Court for
the Northern District of California, https://parsers.me/
appeal-from-the-united-states-district-court-for-the-northern-district-of-california, last
accessed October 2020.
[2] Twitter Q1 2020 Financial Report, https://s22.q4cdn.com/826641620/files/doc_financials/
2020/q1/Q1-2020-Earnings-Press-Release.pdf, last accessed October 2020.
[3] G. Lombardo, P. Fornacciari, M. Mordonini, L. Sani, M. Tomaiuolo, A combined approach for
the analysis of support groups on facebook-the case of patients of hidradenitis suppurativa,
Multimedia Tools and Applications 78 (2019) 3321–3339.
[4] E. Franchi, A. Poggi, M. Tomaiuolo, Social media for online collaboration in firms and
organizations, International Journal of Information System Modeling and Design (IJISMD)
7 (2016) 18–31.
[5] P. Fornacciari, M. Mordonini, A. Poggi, L. Sani, M. Tomaiuolo, A holistic system for troll
detection on twitter, Computers in Human Behavior 89 (2018) 258–268.
[6] M. Tomaiuolo, G. Lombardo, M. Mordonini, S. Cagnoni, A. Poggi, A survey on troll
detection, Future Internet 12 (2020) 31.
181
Stefano Cavalli et al. 174–183
182
Stefano Cavalli et al. 174–183
data and index returns, in: 2018 International Conference on Computation of Power,
Energy, Information and Communication (ICCPEIC), 2018, pp. 042–045.
[22] A. M. Talib, R. Atan, R. Abdullah, M. Azrifah, Cloudzone: Towards an integrity layer of
cloud data storage based on multi agent system architecture, in: 2011 IEEE Conference on
Open Systems, 2011, pp. 127–132.
[23] F. De la Prieta, S. Rodríguez, J. Bajo, J. M. Corchado, A multiagent system for resource
distribution into a cloud computing environment, in: Y. Demazeau, T. Ishida, J. M. Corchado,
J. Bajo (Eds.), Advances on Practical Applications of Agents and Multi-Agent Systems,
Springer Berlin Heidelberg, Berlin, Heidelberg, 2013, pp. 37–48.
[24] X. Kang, C. Zhou, X. Liu, H. Sun, Y. Huang, Improving performance for decentralized
execution of composite web services, in: 2013 IEEE Ninth World Congress on Services,
IEEE Computer Society, Los Alamitos, CA, USA, 2010, pp. 582–589.
[25] Python Requests Library, https://requests.readthedocs.io/, last accessed October 2020.
[26] Free Proxy List, https://free-proxy-list.net/, last accessed October 2020.
183
An Early Warning System for Seismic Events based
on the Multi-Agent Model
Roberto Spinaa,b , Andrea Fornaiaa and Emiliano Tramontanaa
a
Department of Mathematics and Computer Science, University of Catania, Italy
b
National Council of Geologists (CNG), Rome, Italy
Abstract
When a disastrous earthquake is about to occur in a specific territory, there are a series of anomalies that
alter the pre-existing natural balances. Seismic swarms, ground deformation, bright flashes, emissions
of various gas types (radon, CO2 ,..), changes in the composition and flow rate groundwater are just
some physical-chemical perturbations induced by the growing stress condition borne by the crustal
masses. Dilatancy theory and asperity model allow us to interpret the dynamic mechanisms to which
the seismic precursors are due: the development of a network of cracks and the sliding of areas with
less mechanical resistance are in agreement with seismic, mechanical and geochemical anomalies that
occur before to high magnitude earthquakes. In areas with high seismic risk, constant monitoring of
geophysical parameters is frequent, carried out using different types of sensors.
The MAS (Multi-Agent System) model is one of the most suitable choices for efficiently implementing
a seismic alert system, based on the interpretation of experimental data obtained from the sensor network.
Using this type of approach, a Seismic Early Warning (SEW) has been created that according to the data
acquired by the sensors and through the activities carried out by agent clusters, define the risk of seismic
events having magnitude at least six. The SEW system aims to interpret, in real-time, the variations
of an adequate number of seismic precursors for specific threshold values, calculated statistically. The
integrated and complementary analysis of them, using several specific Boolean expressions, assesses the
contribution provided by each parameter for computing the level of risk, divided into soft, medium and
hard. The model has been tested with data gathered in New Zealand, a nation with a high seismic and
volcanic risk which offers free access to some seismic precursors.
Keywords
MAOP, MAS, multi-agent system, seismic precursors, earthquakes, geophysical parameters
1. Introduction
Software applications based on MAOP (Multi-Agent Oriented Programming) are widely used in
various fields and have taken on an increasingly important role thanks to the use of artificial
intelligence (AI) techniques [1, 2, 3]. The adoption of centralized methods presents intrinsic
difficulties due to the growing complexity of the systems, the dimensions of which continue
to increase: in this context, the architectural solutions proposed by the MAS (Multi-Agent
System) offer different advantages and a good solution for the modelling of complex distributed
WOA 2020: Workshop “From Objects to Agents”, September 14–16, 2020, Bologna, Italy
" [email protected] (R. Spina); [email protected] (A. Fornaia); [email protected]
(E. Tramontana)
0000-0001-7393-7249 (R. Spina); 0000-0001-6034-855X (A. Fornaia); 0000-0002-7169-659X (E. Tramontana)
© 2020 Copyright for this paper by its authors. Use permitted under Creative Commons License Attribution 4.0 International (CC BY 4.0).
CEUR
Workshop
Proceedings
http://ceur-ws.org
ISSN 1613-0073
CEUR Workshop Proceedings (CEUR-WS.org)
184
Roberto Spina et al. 184–199
systems [3, 4, 5]. One of the fundamental characteristics of the MAS paradigm is the interac-
tion between agents, independent and autonomous software modules that perform specific
propaedeutics activities for the development of one or more system functions. The innumerable
properties that distinguish the agents (communication, persistence, reactivity, proactivity, etc.)
make them potentially suitable for monitoring natural phenomena, especially those capable of
producing catastrophic events.
The different activities required by a seismic early warning system, summarized in the
acquisition, interpretation and formatting of geophysical data with the addition of real-time user
assistance, make the MAS model one of the most appropriate systems for real-time monitoring
of precursor parameters (seismic swarms, ground deformation, soil temperature, radon gas
emission, etc.) aimed at predicting earthquakes potentially destructive.
Concerning the previous observations, a software system called SEW (Seismic Early Warning)
has been developed, based on a dashboard that, in real-time, shows updates based on alert
level (soft, medium and hard) that characterizes a specific area at high seismic risk. The system
of agents, operating in the background, allows comparing the experimental data of seismic
precursors with the corresponding threshold values, obtained statistically from seismic swarms
which, in the past, have produced a destructive earthquake. Through simple Boolean expressions,
it will then be possible to automatically establish a certain alarm level in the places surrounding
the seismic source.
The remainder of this document is organized as follows. A literature survey is discussed in
Sections II. Section III presents the seismic domain of the application and the methodologies
used. Section IV defines the characteristics of the MAS and the collaborative interaction between
agents. Section V illustrates the case study of New Zealand, a region with high seismic and
volcanic risk in which a SEW prototype has been implemented and tested and the results of
which are discussed in section VI. And in conclusion, the MAS approach advantages and all the
new features presented were analyzed in Section VII.
2. Related Work
Many applications that combine artificial intelligence and MAS technologies, in various sec-
tors, have been developed: some examples are represented by the new opportunities created
respectively for traffic control at intersections[1], for monitoring and improving the cloud
performance and security [2], or for alerting people about crowded destinations [6]. In the last
years, a group of scientists presented a Multi-Agent System paradigm and discuss how it can be
used to design intelligent and distributed systems [3]. Next, a decentralized approach of MAS
has been developed using a distributed simulation kernel to solve partitioning, load balancing
and interest management problems in an integrated, transparent and adaptive manner [4].
Different works have been produced on the implementation of multi-agent systems relating to
coordination and rescue in the stages following the occurrence of a high-intensity seismic event.
A multi-agent system for the evacuation of people in immediate post-emergency situations
has been implemented for the city of Iaşi (Romania) [7]. A series of simulators using a MAS
architecture, following the damage caused by the 1999 earthquakes in Turkey and Pakistan
in 2005, have been developed: damage, victims and other auxiliary simulators [8]. A Disaster
185
Roberto Spina et al. 184–199
Management System (DMS) developed with the multi-agent model has been proposed to
adequately manage a multi-risk situation consisting of two or more disasters occur at the same
time, such as, for example, the combination of earthquake and tsunami [9].
Other systems for the management of the pre-post seismic phases have been developed
by the authors in various ways: (i) through a Seismic and Volcanic Early Warning System in
the Etna area based on specific threshold values for each geophysical precursor [10]; (ii) with
an approach based on the coupling of multi-agent systems and intelligent systems (cellular
automata) for simulation on rescue in the event of an earthquake disaster [11]; (iii) through
simulations of various post-seismic evacuation scenarios for people using a multi-agent system
[12]; (iv) integrating GIS with multi-agent seismic disaster simulations to investigate factors
significantly affecting rescue efforts, and to clarify countermeasures for saving lives [13].
3. Approach
This section describes the model on which SEW is based and the methodologies used to im-
plement the proposed system. The first activity concerns the extraction of useful information
from the databases of seismic precursors (seismic swarms, soil deformations, ...) and their
visualization in a SPA (Single Page Application), based on Angular. The next phase is the
implementation of a multi-agent system defining the alert level of the seismic territory based
on the result obtained from a set of Boolean expressions founded on the seismic precursors.
3.1. Methodology
Within each seismic zone, there are one or more seismogenic structures (faults) which, with
their displacement, can produce the vibrations that generate the earthquake. Sequences of
seismic events that, in some cases, may prelude to a major magnitude earthquake (mainshock)
are called seismic swarms. Every single event (foreshock) belonging to the sequence often
occurs a short time from the previous one.
Suppose we consider all the seismic swarms that in the past have given rise to mainshocks of
medium-high magnitude (above 6) which, about to the characteristics of the territory concerned,
can produce serious damage to people and things. We denote with 𝑆1 , 𝑆2 , 𝑆3 three classes of
seismic swarms which as a final result gave an earthquake of magnitude M𝑤 ≥ 6 and with
¯ 1 ), (𝑃2 , 𝑆
(𝑃1 , 𝑆 ¯ 2 ), (𝑃3 , 𝑆
¯ 3 ), the ordered pairs where P corresponds to the number of S elements
¯
and 𝑆 to the arithmetic mean for each class 𝑆1 , 𝑆2 , 𝑆3 . The average of the averages for the three
classes of seismic swarms that prelude to an earthquake of Magnitude 𝑀𝑤 will be given by:
3
1 ∑︁ ¯
𝑆𝑆𝑇ℎ = 𝑃𝑖 𝑆 𝑖 (1)
𝑁
𝑖=1
𝑁 = 𝑃1 + 𝑃2 + 𝑃3 . (2)
The 𝑆𝑆𝑇ℎ value obtained corresponds to the most probable value for seismic swarms with 𝑀¯𝑤 <
6 for that specific seismogenic structure, and therefore a threshold value for the mainshock of
magnitude M𝑤 ≥ 6.
186
Roberto Spina et al. 184–199
The same procedure is performed for geophysical precursors for which a consistent database
of measurements is available. Consequently, three further threshold values (𝑅𝐶𝑇ℎ , 𝐺𝐷𝑇ℎ and
𝑆𝑇𝑇ℎ ) will be obtained referring respectively to Radon Concentration (RC), Ground Deformation
(GD) and Soil Temperature (ST) for earthquakes with M𝑤 ≥ 6. The four previously threshold
values (𝑇ℎ ) will be associated with the respective standard deviations (𝜎) expressed by:
⎯
⎸ 3
⎸ ∑︁
⎸ (𝑆¯𝑖 − 𝑇ℎ )2
⎸
⎷ 𝑖=1
𝜎= (3)
3
and the achievement of the threshold value (𝑇ℎ ) will occur when:
where 𝑀 ¯ 𝑤 represents the average magnitude of the current seismic swarm and 𝜎𝑤 the standard
deviation associated with it. In real conditions in presence of an extensive seismic swarm (SS),
the system will calculate the average magnitude value (𝑆𝑆 ¯ ) of the seismic sequence in progress
¯ ¯ ¯
and the other three seismic precursors (𝑅𝐶 , 𝐺𝐷 and 𝑆𝑇 ). In the next step, it will compare the
mean value of the four precursors with the respective threshold values.
The definition of the alarm level will be based on the evaluation of a series of Boolean
expressions and conditional instructions, arranged in sequence, which allows defining the
type of alarm based on the number of precursor parameters that have reached or exceeded
the threshold value, going from hard (all variables are true) to soft (only two variables have
exceeded the threshold value). Among the four Boolean variables, SS (Seismic Swarm) has a
fundamental role in defining any alarm level:
if (𝑆𝑆 ∧ 𝑅𝐶 ∧ 𝐺𝐷 ∧ 𝑆𝑇 ) (5)
return "hard";
if (𝑆𝑆 ∧ ((𝑅𝐶 ∧ 𝐺𝐷) ∨ (𝑅𝐶 ∧ 𝑆𝑇 ) ∨ (𝐺𝐷 ∧ 𝑆𝑇 )))
return "medium";
if (𝑆𝑆 ∧ (𝑅𝐶 ∨ 𝐺𝐷 ∨ 𝑆𝑇 ))
return "soft".
187
Roberto Spina et al. 184–199
In the barrier model [15, 16] it is assumed that, before the earthquake, the stress on the fault
is uniform. The earthquake is produced by the sliding of the weakest area, while the most
resistant area (barrier) is opposed to dislocation. In this way, there is an increase in barrier
stress. Consequently, after the earthquake, the barrier may be affected by seismic (aftershock)
or aseismic sliding episodes.
The asperity model [15, 16] considers that the sliding that generates the earthquake concerns
the most resistant area, i.e. the asperity. Before the mainshock, the stress on the fault is not
uniform because aseismic sliding and preliminary shocks (foreshock) have reduced stress in the
weakest areas of the fault, concentrating it on asperities. When stress reaches a critical value,
the asperity yields giving rise to the earthquake.
The three models agree with the physico-chemical anomalies related to the extensive fracture
affecting the seismogenic area (seismic precursors) and with the long sequences of earthquakes
preceding (foreshock) and subsequent (aftershock) at the mainshock, providing a valid interpre-
tative key.
4. Framework
The SEW dashboard consists of a series of software components (agents) capable of performing
simple tasks, but unable to perform a complex task individually. Recall that each task can
be decomposed into simpler parts, to be performed by individual agents or groups of them
who cooperate. By planning their interaction through a multi-agent architecture, based on
collaboration and the exchange of information, it is possible to achieve the common goal.
A more detailed analysis of the individual responsibilities attributed to each agent and the
proposed architectures are described in the following sections.
188
Roberto Spina et al. 184–199
189
Roberto Spina et al. 184–199
B1
C1
earthquakes database
seismic swarms
database
A Level of alarm
……
Graphics
ground deformation
and table database
B2
F E
ground deformation
C2 database
Se
nd
m
es
D2
ge
SEW Dashboard
front-end. The system, still under development, uses Java Agent Development Framework
(JADE), a network-oriented framework that guarantees very efficient communication. The
example shown refers to the geophysical parameter "Seismic Swarm", but the actions and
operations carried out can also be considered substantially equivalent for the other geophysical
parameters.
Collaboration and exchange of information can be summarized with the following activities,
distributed over a series of agents: (i) download of experimental data from the corresponding
servers where they have been stored by the sensor network; (ii) filtering according to certain
rules that establish whether they are suitable for registration or not; (iii) analysis of current
data and comparison with statistically calculated threshold values; (iv) establish if the alarm
level must be updated defining its criticality; (v) formatting and display of data to be presented
to the user; (vi) notification of a warning to a select group of scientists on any existing critical
problems.
Figure 2 highlights the different roles assumed by agents 𝐵1 , 𝐶1 , 𝐷1 , belonging to the same
group of agents, while A belongs to a hierarchically higher level. Every 10 minutes agent A
sends a notification to agent 𝐵1 that queries the internal server for the latest updates on seismic
events occurred in that source area. In case of a positive response, it sends a message to agent
190
Roberto Spina et al. 184–199
𝐶1 which includes the magnitude (𝑀𝑤 ), the hypocenter (𝐻𝑝 ) and the date/hour (D) in which
the seismic event occurred. Received the message, the agent 𝐶1 compares the data received
with those of the previous earthquake, stored in its internal state: the earthquake will be entered
in the seismic swarm database only if it has 𝑀𝑤 ≥ 1 and occurred within 24 hours from the
previous one, otherwise it is discarded. If the earthquake is inserted in the current seismic
sequence, 𝐶1 sends a notification signal to agent 𝐷1 which activates and checks the earthquake
frequency (𝐹𝐸 ) in its own state in the last seven days, with the specifications defined previously
(hypocenter, magnitude). If the frequency is sufficiently high (e.g. 𝐹𝐸 ≥ 5 earthquakes/day),
𝐷1 calculates the average magnitude and the associated 𝜎 for the current seismic sequence and
compares it with the corresponding threshold value. In case it reaches or exceeds the threshold
value, 𝐷1 updates the value of 𝑀 ¯ 𝑤 in the database and sends a message to agent A, whose
evaluation will take into account the frequency of the seismic swarm in the last days.
Next, based on the result obtained from the Boolean expression (5), it will decide whether
to activate an alarming level and of which type (soft, medium or hard), sending a notification
to the 𝐸 and 𝐹 agents, “specialized” in user assistance. In particular, the 𝐸 agent will update
the table and the respective graphs (histograms, box-and-whisker diagrams, ...), while the 𝐹
agent will send, via e-mail, a report to a small group of scientists. The document, created in an
automated way, will report the experimental data that determined the activation of the specific
alert level. At the end of the activity cycle, the clusters of agents listen for new notifications that
191
Roberto Spina et al. 184–199
can re-trigger the sequence of activities listed above. A mockup of the SEW interface, currently
under development, is shown in Figure 3.
192
Roberto Spina et al. 184–199
Figure 4: Scheme of the subduction area (Kermadec Trench) and the transform zone (Alpine fault)
with the relative displacement speeds of the Pacific plate in collision with the Australian plate. (Credit:
Mikenorton via Creative Commons https:// commons.wikimedia.org/ w/ index.php?curid=10735284)
5.2. Experiments
The network of seismometers and GPS/GNSS sensors is well developed and represents a good
way to test the seismic alert system. Each seismic region is covered by a fair number of
193
Roberto Spina et al. 184–199
GPS/GNSS stations for the measurement of the ground deformation, even if for some stations
the operativeness has occurred only in the last years and for others, the first registrations are
from 1999. Of the three components that relate to displacement from the initial position (east,
north, and up) only the up component was taken into consideration, relative to the vertical
displacements of the ground. And this because the other two components, east and north, are
mainly attributable to the displacement of the two plates.
The seismic data available on the “GeoNet Quake Search” page of the geonet.org.nz site
were filtered by geographic coordinates, region and depth and downloaded in CSV format: the
threshold value and the relative standard deviation were then calculated for two high magnitude
seismic events. To download the data relating to the ground deformation, the GeoNet API
was used, which allows the experimental data to be downloaded quickly, using special queries
carried out in GET mode.
The SEW test was performed on the northern segment of the Marlborough fault system of
the Wellington & Marlborough seismic region. The GPS/GNSS stations used for the calculation
of the threshold values are those closest to the seismogenic structure analyzed, in which
experimental data were available from 2004. Seismic events occurred on 2013-07-21 and 2016-
11-14 were considered, respectively of 𝑀𝑤 = 6.5 and 𝑀𝑤 = 6.2. Only two mainshocks have
been considered, although they are made up of more than 600 seismic events in total, because
catastrophic earthquakes of high magnitude, over the last twenty years, are quite limited in
number.
For the ground deformation, the registrations made up to four months before the mainshock
was considered and the threshold values for each of the three stations were obtained using the
data relating to the two seismic events of 2013 and 2016. In reality, by restricting the datasets to
one month before the seismic event, the variation in the values obtained for the three stations
is negligible and falls within the order of a tenth of a millimetre.
The 2013-08-16 earthquake of 𝑀𝑤 = 6.5 was used to test the correspondence between seismic
swarms in progress and statistically calculated threshold values. A further test was performed
on the seismic swarm of May 2018 which as a final result did not give a mainshock.
6. Results
The data of the seismic swarms relating to earthquakes occurred on 2013-07-21 and 2016-11-14
are shown in Table 1: 𝑀𝑚𝑠 indicates the magnitude value of the mainshock. The threshold
value obtained for the northern segment of the Marlborough fault system is of 2.2 ± 0.2. Table
2 shows the threshold values (𝑇ℎ ) and the respective standard deviations (𝜎), expressed in
centimetres, relating to the 2013 and 2016 earthquakes for the three stations CMBL, WITH
and KAIK. All stations are characterized by negative ground displacements which denote land
subsidence before the mainshock.
The 2013-08-16 earthquake of 𝑀𝑤 = 6.5, which occurred about a month later after the strong
earthquake of July 2013, was used as a sequence to test the system. Figure 3 shows one of the
seismic swarms, in the Marlborough fault system, which preceded the mainshock: you can see
the alignment of the hypocenters along a preferential direction that corresponds to the direction
of development of the fault system that generated it (see Marlborough fault system of Figure 4).
194
Roberto Spina et al. 184–199
Table 1
Seismic swarms before the mainshock (Marlborough fault system)
Table 2
Ground deformation before the mainshock (Marlborough fault system)
Table 3 reports the average magnitude value and the relative standard deviation of the seismic
swarm before the mainshock which is in the range of 2.3±0.4. The fields relating to the three
ground deformation measuring stations show the values 𝐺𝐷 ¯ ± 𝜎𝑔𝑑 . It can be seen that in all
stations the intervals of the ground deformation in progress fall within the intervals of the
threshold values 𝑇ℎ ± 𝜎. Hence, condition (4) is verified for both seismic precursors (SS and
GD):
([𝑀¯𝑤 ± 𝜎𝑤 ] ∩ [𝑆𝑆𝑇 ℎ ± 𝜎𝑡ℎ ] ̸= ∅) ∧ ([𝐺𝐷 ¯ ± 𝜎𝑔𝑑 ] ∩ [𝐺𝐷𝑇 ℎ ± 𝜎𝑡ℎ ] ̸= ∅). (6)
The evaluation of the Boolean expression for ground deformation corresponds to a logical AND
between the three GNSS/GPS stations:
(CMBL) ∧ (WITH) ∧ (KAIK). (7)
Figure 5 shows that in the three stations considered, before the event of August 2013, the
ground deformation intervals intersects that of the respective threshold values and therefore,
according to the final result, the evaluation of the GD parameter returns true. A similar result is
also obtained for the seismic swarm parameter with an almost complete overlap between the
confidence interval in progress and that relating to the threshold value. Table 3 also shows the
results of the seismic swarm of May 2018 (about 115 foreshocks), indicated as two asterisks,
195
Roberto Spina et al. 184–199
Table 3
Test 2013-08-16 earthquake* and seismic swarm** on May 2018
¯ **
𝐺𝐷 - 94.7 ± 0.5 9.4 ± 0.5 57.6 ± 0.5
which affected the same fault system. It can be observed that although the average value of
the seismic swarm falls within the confidence interval of the respective threshold value, the
expression (7) returns false because this does not happen for the ground deformation which has
an inverse (positive) sign with respect to the corresponding (negative) threshold values.
7. Conclusions
An integrated, complementary and real-time analysis of a series of precursor parameters to
establish of the alert level of a seismic risk territory, is the idea on which the SEW forecasting
system is based. With the integrated analysis, we aim to simultaneously analyze the experimental
data of the physico-chemical precursors for which an adequate network of sensors is available.
Acting in a complementary way means considering the results obtained by each parameter
not disjoint from the others but which contribute, in different ways, to the achievement of
the final objective. The innovation of the proposed model lies precisely in these short and
simple concepts and the final evaluation of Boolean expressions made up of representative
variables of each precursor allows each of them to make their contribution. In this way, it
is possible to assess whether the transformation that a seismic territory is undergoing is on
average attributable to those that occurred in the past in the periods preceding earthquakes of
equal magnitude (𝑀𝑤 ≥ 6).
According to the theory of dilatancy and asperity, the transformations that a territory un-
dergoes before a strong seismic event produce ground deformations which, by fracturing,
generates foreshock and catalyzes fluids from the surrounding areas, making their geochemical
properties vary. If we consider that the entity of the deformations depends on the mechanical
characteristics of the rocks present in each seismogenic area, we can consider that before each
“characteristic earthquake” [15], physico-chemical anomalies, on average similar to those that
occurred in the past, can be generated.
The SEW system has been implemented using the MAS approach, hence ensuring modularity,
efficiency and maintainability. The choice to use a multi-agent structure greatly facilitates
the process of acquiring and processing experimental data carried out in parallel by the agent
clusters, each of which deals with a specific precursor. Two further agents, specialized in user
196
Roberto Spina et al. 184–199
Figure 5: Comparison between the ranges of the data in progress and the threshold values for the
ground deformation and the seismic swarms related to the August 2013 earthquake. Note that in all
cases there is an overlap of the intervals.
assistance, take care of adequately formatting diagrams, tables and reports to be presented to
users or sent to specific scientific groups to alert them of any critical states.
The results of the 𝑀𝑤 = 6.5 earthquake test of 2013-08-16 on one of the seismic regions of
New Zealand show an extensive overlap of the ranges [𝑀¯𝑤 ± 𝜎𝑤 ] and [𝐺𝐷 ¯ ± 𝜎𝑔𝑑 ] of both
precursors with their respective confidence intervals of the threshold values and only small
parts of the left interval are external to them. The ground deformation indicates that the areas
surrounding the seismogenic structure undergo pronounced subsidence in the period before
the seismic event. The choice of this datasets is due to the possibility of using both seismic
swarms and ground deformations starting from 2004, a combination not possible for surface
earthquakes in the other seismic regions of New Zealand.
On the contrary, the seismic swarm of May 2018, which affected the same area, shows that
even if the seismic swarms in progress meet the threshold intervals, the deformation values in
the three stations are largely outside the intervals [𝐺𝐷𝑇 ℎ ± 𝜎𝑡ℎ ]: the absence of the mainshock
is therefore in agreement with the result of the expression (7) which returns false. The results,
therefore, confirm that a forecast based on a fair number of precursors can be a good solution
for the implementation of a seismic alert system.
197
Roberto Spina et al. 184–199
Acknowledgement
We acknowledge the New Zealand GeoNet project and its sponsors EQC, GNS Science and
LINZ, for providing data/images used in this study, and project TEAMS–TEchniques to support
the Analysis of big data in Medicine, energy and Structures–Piano di incentivi per la ricerca di
Ateneo 2020/2022.
References
[1] M. Krzysztoń, B. Śnieżyński, Combining machine learning and multi-agent approach
for controlling traffic at intersections, in: Computational Collective Intelligence, LNCS,
volume 9329, 2015, pp. 57–66. doi:10.1007/978-3-319-24069-5_6.
[2] D. Grzonka, A. Jakóbik, J. Kołodziej, S. Pllana, Using a multi-agent system and artificial
intelligence for monitoring and improving the cloud performance and security, Future
Generation Computer Systems, Elsevier 86 (2018) 1106–1117. doi:10.1016/j.future.
2017.05.046.
[3] A. E. F. Seghrouchni, A. M. Florea, A. Olaru, Multi-agent systems: A paradigm to design
ambient intelligent applications, in: Studies in Computational Intelligence, SCI, volume
315, 2010, pp. 3–9. doi:10.1007/978-3-642-15211-5_1.
[4] V. Suryanarayanan, G. Theodoropoulos, M. Lees, PDES-MAS: Distributed simulation
of multi-agent systems, Procedia Computer Science, Elsevier 18 (2013) 671–681. doi:10.
1016/j.procs.2013.05.231.
[5] A. Calvagna, E. Tramontana, Delivering dependable reusable components by expressing
and enforcing design decisions, in: Proc. of IEEE Computer Software and Applications
Conference (COMPSAC), IEEE, 2013, pp. 493–498.
[6] C. Cavallaro, G. Verga, E. Tramontana, O. Muscato, Suggesting just enough (un)crowded
routes and destinations, in: Proc. of 21st Workshop ’From Objects to Agents’ (WOA 2020),
Bologna, Italy, 2020, pp. 493–498.
[7] G. Bunea, F. Leon, G. Atanasiu, Postdisaster evacuation scenarios using multiagent system,
Journal of Computing in Civil Engineering, American Society of Civil Engineers 30 (2016).
doi:10.1061/(ASCE)CP.1943-5487.0000575.
[8] F. Fiedrichn, An hla based multiagent system for optimized resource allocation after strong
earthquakes, in: J. Cohen (Ed.), Proceedings of the 2006 Winter Simulation Conference,
Monterey, CA, 2006, pp. 486–492. doi:10.1109/WSC.2006.323120.
[9] D. Moser, D. Pinto, A. Cipriano, Developing a multiagent based decision support system
for realtime multi-risk disaster manage- ment, International Journal of Environmental and
Ecological Engineering 9 (2015) 831–835. doi:doi.org/10.5281/zenodo.1099832.
[10] R. Spina, A. Fornaia, E. Tramontana, VSEW: an early warning system for volcanic and
seismic events, in: Proceedings of IEEE International Conference on Smart Computing,
SMARTCOMP, Bologna, Italy, 2020.
[11] A. Tani, T. Yamamura, Y. Waridashi, H. Kawamura, A. Takizawa, Simulation on rescue
in case of earthquake disaster by multi-agent system, in: Proc. of World Conference on
Earthquake Engineering, Vancouver, BC, Canada, 2004, pp. 1–6.
198
Roberto Spina et al. 184–199
199
Session 6
Tools & Applications
A Reactive Cognitive Architecture based on Natural
Language Processing for the task of Decision-Making
using a Rich Semantic
Carmelo Fabio Longoa , Francesco Longob and Corrado Santoroa
a
Department of Mathematics and Computer Science, University of Catania, Viale Andrea Doria, 6, 95125 Catania, Italy
b
Department of Engineering, University of Messina, Contrada di Dio, S. Agata, 98166 Messina, Italy
Abstract
The field of cognitive architectures is rich of approaches featuring a wide range of typical abilities of
human mind, like perception, action selection, learning, reasoning, meta-reasoning and others. However,
those leveraging Natural Language Processing are quite limited in both domain and reasoning capabilities.
In this work, we present a cognitive architecture called CASPAR, based on a Belief-Desire-Intention
framework, capable of reactive reasoning using a highly descriptive semantic made of First Order Logic
predicates parsed from natural language utterances.
Keywords
Cognitive Architecture, Natural Language Processing, Artificial Intelligence, First Order Logic, Internet
of Things
1. Introduction
In the last decade, a large number of devices connected together and controlled by AI has entered
in millions of houses: the pervasive market of Internet of Things (IoT). Such a phenomenon is
extended also in domains other than the domestic one, such as smart cities, remote e-healthcare,
industrial automation, and so on. In most of them, especially the usual domestic ones, vocal
assistants assume an important role, because voice is the most natural way to give the user the
feeling to deal with an intelligent sentient being who cares about the proper functioning of
the home environment. But how intelligent are these vocal assistants actually? Although there
can be more definitions of intelligence, in this work we are interested only in those related to
autonomous agents acting in the scope of decision-making.
Nowadays, companies producing vocal assistants aim more at increasing their pervasiveness
than at improving their native reasoning capabilities; with reasoning capabilities, we can intend
not only the ability to infer the proper association command → plan from utterances, but also
to be capable of combining facts with rules in order to infer new knowledge and help the user
in decision-making tasks.
Except the well known cloud-based vocal assistants [1], other kind of solutions [2, 3, 4]
are based on neural models exclusively trained on the domotic domain; or they exploit chat
WOA 2020: Workshop “From Objects to Agents”, September 14–16, 2020, Bologna, Italy
" [email protected] (C. F. Longo); [email protected] (F. Longo); [email protected] (C. Santoro)
0000-0002-2536-8659 (C. F. Longo); 0000-0001-6299-140X (F. Longo); 0000-0003-1780-5406 (C. Santoro)
© 2020 Copyright for this paper by its authors. Use permitted under Creative Commons License Attribution 4.0 International (CC BY 4.0).
CEUR
Workshop
Proceedings
http://ceur-ws.org
ISSN 1613-0073
CEUR Workshop Proceedings (CEUR-WS.org)
201
Carmelo Fabio Longo et al. 201–218
engines [5, 6] whose understanding skills are strictly depending on syntax. This makes the
range of their capabilities quite limited.
In light of the above, in this paper our aim is the design of a cognitive architecture, called CAS-
PAR, based on Natural Language Processing (NLP), that makes it possible the implementation
of intelligent agents able to outclass the available ones in performing deductive activities. Such
agents could be used for both domotic purposes and any other kind of applications involving
common deductive processes based on natural language. As a further motivation, we have to
highlight that, as claimed in [7], cognitive architectures have been so far mainly used as research
tools, and very few of them have been developed outside of academia; moreover, none of them
has been specifically designed for IoT. Of course, most of them have features and resources
which could be exploited in such a domain, but the starting motivations were different from
ours.
Although cognitive architectures should be distinguished from models that implement them,
our architecture can be used as domotic agent as is, after the definitions of both the involved
entities and the I/O interfaces.
This paper is structured as follows: Section 2 describes the state of the art of related literature;
Section 3 shows in detail all the architecture’s components and underlying modules; Section 4
shows the architecture reasoning heuristic in the presence of clauses made of composite predi-
cates, taking into account possible argument substitutions as well; Section 5 summarizes the
content of the paper and provides our conclusions, together with future work perspectives.
A Python implementation of CASPAR is also provided for research purposes in a Github
repository1 .
2. Related work
The number of existing cognitive architectures has reached several hundreds according to
the authors of [7]. Among the most popular ones, which also influenced several subsequent
works, there are SOAR, CLARION and LIDA, mentioned in a theoretical comparison in [8].
Most of them got inspired either by neuroscience or psychanalysis/philosophy studies; the
former are surely less fancy, being supported by scientific data regarding functions of brain
modules in specific conditions and their interactions. The Integrated Information Theory [9]
provides even a metric Phi to evaluate the consciousness level of a cognitive system, which
would be proportional to those overall interactions. In this section, we will focus mostly on
those architectures implementing Reasoning/Action Selection, Natural Language Processing
and Decision-Making, being the main basis on which CASPAR has been built.
In [10] the authors describe three different spoken dialog systems, one of them based on the
FORR architecture and designed to fulfill the task of ordering books from the public library
by phone. All the three dialog systems are based on a local Speech-to-Text engine called
PocketSphinx which is notoriously less performing than cloud-based systems [11]. This leads
to a greater struggle to reduce the bias between user’s request and result.
The authors of [12] present a computational model called MoralIDM, which integrates
multiple AI techniques to model human moral decision-making, by leveraging a two-layer
1
http://www.github.com/fabiuslongo/pycaspar
202
Carmelo Fabio Longo et al. 201–218
Physical
Direct commands
ASR Sensors
Parser
Devices
Dependency Routines Parser
Parser
Devices Groups
Beliefs KB
Uniquezer PHIDIAS Engine
Smart Environment Smart
Interface Home
Sensor
MST Builder Instances
Clauses KB
inference engine which takes into account prior cases decisions and a knowledge base with a
formal representation of moral quality-weighted facts. Such facts are extracted from natural
language by using a semi-automatic translator from simplified English (which is the major
weakness of such approach) scenarios into predicate calculus.
The DIARC architecture [13] has been designed for addressing the issue of recognizing morally
and socially charged situations in human-robot collaborations. Although it exploits several
well known NLP resources (such as Sphinx, Verbnet, and Framenet), it has been tested only on
trivial examples in order to trigger robot reactions, using an ad-hoc symbolic representation of
both known and perceived facts.
In general, probing the existing cognitive architectures leveraging NLP, we have found that
most of them are limited in both domain of application and in term of semantic complexity.
3. The Architecture
The name that has been chosen for the architecture presented in this paper is CASPAR. It
derives from the following words: Cognitive Architecture System Planned and Reactive, whom
summarize its two main features. In Figure 1, all interacting components are depicted, filled
with distinct colours.
The main component of this architecture, namely the Reactive Reasoner, acts as "core router"
by delegating operations to other components, and providing all needed functions to make the
whole system fully operative.
This architecture’s Knowledge Base (KB) is divided into two distinct parts operating separately,
which we will distinguish as Beliefs KB and Clauses KB: the former contains information of
physical entities which affect the agent and which we want the agent to affect; the latter contains
203
Carmelo Fabio Longo et al. 201–218
conceptual information not perceived by agent’s sensors, but on which we want the agent to
make logical inference.
The Beliefs KB provides exhaustive cognition about what the agent could expect as input
data coming from the outside world; as the name suggests, this cognition is managed by means
of proper beliefs that can - in turn - activate proper plans in the agent’s behaviour.
The Clauses KB is defined by the means of assertions/retraction of nested First Order Logic
(FOL) definite clauses, which are possibly made of composite predicates, and it can be interro-
gated providing answer to any query (True or False).
The two KBs represent, somehow, two different kinds of human being memory: the so
called procedural memory or implicit memory[14], made of thoughts directly linked to concrete
and physical entities; the conceptual memory, based on cognitive processes of comparative
evaluation.
As well as in human being, in this architecture the two KBs can interact with each other in a
very reactive decision-making process.
The variable e, which we define davidsonian variable, identifies the verbal action related to
stabbed. In the case a sentence contains more than one verbal phrases we’ll make usage of
indexes for distinguish e𝑖 from e𝑗 with 𝑖 ̸= 𝑗.
As for the notation used in this work, it does not use ground terms as arguments of the predicates,
in order to permit the sharing of different features related to the same term like it follows,
whether we include the adjective evil:
which can also be represented, ungrounding the verbal action arguments, as it follows:
Furthermore, in the notation used for this work each predicate label is in the form L:POS(t),
where L is a lemmatized word and POS is a Part-of-Speech (POS) tag from the Penn Treebank
tagset[16].
204
Carmelo Fabio Longo et al. 201–218
The first module in the pipeline, i.e., the Automatic Speech Recognition [17, 18, 19] (ASR),
allows a machine to understand the user’s speech and convert it into a series of words.
The second module is the Dependency Parser, which aims at extracting the semantic relation-
ships, namely dependencies, between all words in a utterance. In [20], the authors present a
comparative analysis of ten leading statistical dependency parsers on a multi-genre corpus of
English.
The third module, the Uniquezer, aims at renaming all the entities within each dependency in
order to make them unique. Such a task is mandatory to ensure the correctness of the outcomes
of the next module in the pipeline (the Macro Semantic Table), whose data structures need a
distinct reference to each entity coming from the dependency parser.
The fourth module, defined as MST Builder, has the purpose to build a novel semantic structure
defined as Macro Semantic Table (MST), which summarizes in a canonical shape all the semantic
features in a sentence, starting from its dependencies, in order to derive FOL expressions.
Here is a general schema of a MST, referred to the utterance u:
where
All tuples inside such lists are populated with variables and labels whose indexing is considered
disjoint among distinct lists, although there are significant relations which will be clarified
later. The MST building takes into account also the analysis done in [21] about the so-called
slot allocation, which indicates specific policies about entity’s location inside each predicate,
depending on verbal cases. This is because the human mind, in the presence of whatever
utterance, is able to populate implicitly any semantic role (identified by subject/object slots)
taking part in a verbal action, in order to create and interact with a logical model of the utterance.
In this work, by leveraging a step-by-step dependencies analysis, we want to create artificially
such a model, to give an agent the chance to make logical inference on the available knowledge.
All the dependencies used in this paper are part of the ClearNLP[22] tagset, which is made of
46 distinct entries. For instance, considering the dependencies of 1:
nsubj(stabbed, Brutus)
ROOT(stabbed, stabbed)
advmod(stabbed, suddenly)
dobj(stabbed, Caesar)
prep(stabbed, In)
det(agora, The)
pobj(in, agora)
205
Carmelo Fabio Longo et al. 201–218
from the couple nsubj/dobj it is possible to create new a tuple inside ACTIONS as it follows,
taking also in account of variables indexing counting:
(stabbed, e1 , x1 , x2 )
(x1 , Brutus)
(x2 , Caesar)
Similarly, after an analysis of the couple prep/pobj it is possibile to create further tuples inside
PREPS like it follows:
(in, e1 , x3 )
(x3 , agora)
The dependency advmod contains informations about the verb (stabbed) is going to modify by
means the adverb suddenly. In light of this, a further tuple inside VARLIST will be created as it
follows:
(e1 , suddenly)
As for the BINDS list, it contains tuples with a quality modifiers role: in the case the 1 had
the brave Caesar as object, a further dependency amod will be created as it follow:
amod(Caesar, brave)
In this case, a bind between Caesar and brave will be created inside BINDS as it follows:
(Caesar, brave)
As with BINDS, COMPS contains tuples of terms related to each other, but in this case they
are part of multi-word nouns like Barack Hussein Obama, whose nouns after the first will be
classified as compound by the dependency parser.
As for the CONDS lists, it contains davidsonian variable whose related predicates subordinate
the remaining others. For instance in the presence of utterances like:
or
206
Carmelo Fabio Longo et al. 201–218
in both cases, the dependency mark will give information about subordinate conditions related
to the verb shines, which are mark(shines, If) and mark(shines, while). In those
cases, the davidsonian variable related to shines will populate the list CONDS. In the same way,
in presence of the word when, a subordinate condition might be inferred as well; but since any
adverbs are classified as advmod (as we have seen for suddenly before), it will be considered as
subordinate condition only when its POS is WRB and not RB; the former denotes a wh-adverb,
the latter a qualitative adverb.
The fifth and last module, defined as FOL Builder, aims to build FOL expressions starting
from the MSTs. Since (virtually) all approaches to formal semantics assume the Principle of
Compositionality2 , formally formulated by Partee [23], every semantic representation can be
incrementally built up when constituents are put together during parsing. In light of the above,
it is possible to build FOL expressions straightforwardly starting from a MST, which summarizes
all semantic features extracted during a step-by-step dependencies analysis.
For the rest of the paper, the labels inside the MST tuples will be in the form of lemma:POS.
Then, for instance, instead of stabbed we’ll have stab:VBD, where stab is the lemmatization
of stabbed and VBD is the POS representing a past tense.
For each tuple (var, lemma:POS) in VARLIST the following predicate will be created:
lemma:POS(var)
lemma:POS(dav/var, obj)
lemma:POS2 (var)
where var is the variable of a the tuple in VARLIST with lemma:POS1 as second entity. In case
of multi-word nouns, each further noun over the first of them in VARLIST will be encoded
2
“The meaning of a whole is a function of the meanings of the parts and of the way they are syntactically
combined.”
3
Without considering entities enumeration.
207
Carmelo Fabio Longo et al. 201–218
within COMPS.
As for CONDS, its usage will be explained next with an example. Let the sentence in exam be:
It has to be noticed the numeration of the entities within each list, as effect of the Uniquezer
processing before the MST building. As final outcome we’ll have an implication like the
following:
208
Carmelo Fabio Longo et al. 201–218
The Definite Clauses Builder is responsible of combining FOL expression predicates with
common variables, through a production rules system, in order to produce nested definite
clauses. Considering the 2 and its related FOL expression producted by the Translation Service,
the production rule system of the Definite Clauses Builder, taking in account of the POS of each
predicate, will produce the following nested definite clause:
shine01:VBZ(sun01:NN(x1 ), _) =⇒ be01:VBZ(Robert01:NNP(x3 ),
happy01:JJ(𝑥4 ))
The rationale behind such a notation choice is explained next: a definite clause is either atomic
or an implication whose antecedent is a conjunction of positive literals and whose consequent
is a single positive literal. Because of such restrictions, in order to make MST derived clauses
suitable for doing inference with the Backward-Chaining algorithm (which works only with
KB made of definite clauses), we must be able to incapsulate all their informations properly.
The strategy followed is to create composite terms, taking into account of the POS tags and
applying the following hierarchy to every noun expression as it follows:
IN(JJ(NN(NNP(x))), t) (3)
where IN is a preposition label, JJ an adjective label, NP and NNP are noun and proper noun
labels, x is a bound variable and t a predicate.
As for the verbal actions, the nesting hierarchy will be the following:
ADV(IN(VB(t1 , t2 ), t3 ))
where ADV is an adverb label, IN a preposition label, VB a verb label, and t1 , t2 , t3 are predicates;
in the case of intransitive or imperative verb, instead of respectively t2 or t1 , the arguments of
VB will be left void. As we can see, a preposition might be related either to a noun or a verb.
209
Carmelo Fabio Longo et al. 201–218
Belief eval_cls(Y) lets Belief KB and Clauses KB interact with each other in a very decision-
making process, where the agent decides either to execute or not the related plan within the
square brackets, accordingly to the reasoning of the query Y; the latter in line 12-13 of Listing 1
in the Appendix is the representation of the sentence an inhabitant is at home.
Finally, this module contains also production rules to change routines into direct commands
according to the presence of specific belief related to conditionals, which might be asserted or
not by some Sensor Instance (see lines 2, 3, 5, 8, 9 of Listing 1 in the Appendix).
but before that, we must consider a premise: the introduction of such rules in a KB can be
possible only by shifting all its predicates from a strictly semantic domain to a pure conceptual
one, because in a semantic domain we have just the knowledge of morphological relationships
between words given by their syntactic properties. Basically, we need a medium to give
additional meaning to our predicates, which is provided by WordNet [27]. This allows us to
make logical reasoning in a conceptual space thanks to the following functions:
F𝐼 is the Interpreter Function between the space of all semantic predicates which can be yield
by the MST sets and the space of all conceptual predicates P𝐶 ; it is not injective, because a
single semantic predicate might have multiple corrispondences in the codomain, one for each
different synset containing the lemma in exam. F𝐴𝑟𝑔𝑠(𝐹𝐼 ) is between domain and codomain
of all predicate’s argument of F𝐼 , which have equal arity. For instance, considering the FOL
expression of (4):
After an analysis of be, we find the lemma within the WordNet synset encoded by be.v.01
and defined by the gloss: have the quality of being something. This is the medium we need for
the domain shifting which gives a common sense meaning to our predicates.
In light of above, in the new conceptual domain given by (5), the same expression can be
rewritten as:
210
Carmelo Fabio Longo et al. 201–218
where be_VBZ is fixed on the value which identify y1 with y2 , Robert_NNP(x) means that x
identify Robert, and man_NN(x) means that x identify a man.
Considering the meaning of be_VBZ, it does make sense also to rewrite the formula as:
man_NN(Robert_NNP(y)) (7)
which agrees with the hierarchy of 3 as outcome of the Definite Clauses Builder.
As claimed in [28], not every KB can be converted into a set of definite clauses, because of
the single-positive-literal restriction, but many KB can, like the one related to this work for the
following reasons:
1. No clauses made of one single literal will ever be negative, due to the closed world
assumption. Negations, initially treated like whatever adverb, when detected and related
to ROOT dependency are considered as polarity inverter of verbal phrases; so, in this
case, the assert will be turned into retract.
2. When the right hand-side of a clause is made by more than one literals, it is easy to
demonstrate that, by applying the implication elimination rule and the principle of
distributivity of ∨ over ∧, a non-definite clause can be splitted into n definite clauses
(where n is the number of consequent literals).
211
Carmelo Fabio Longo et al. 201–218
Querying such a KB with P3 (H3 (x)), for instance, using the Backward-Chaining algo-
rithm, it will return False because there are neither any unifiable literals present nor as conse-
quent of a clause. Instead, by exploiting H3 (x) =⇒ F3 (x), we can also query the KB with
P3 (F3 (x)) which is present as consequent of the first clause and it is surely satisfied together
with P3 (H3 (x)): that’s what we define as Nested Reasoning.
Now, to continue the reasoning process, we should check about the premises of such clause,
which is made of the conjunction of two literals, namely P1 (G1 (x1 )) and P2 (G2 (x2 )). The
latters, although not initially asserted, can be obtained starting by argument substitution on
copies of other clauses from the same KB. Such a process is achieved by implicitly asserting the
following clauses together with P1 (F1 (x1 )) and P2 (F2 (x2 )):
Since we cannot know in advance what a future successful reasoning requires, considering
all possible nesting levels, along with the previous clauses also the so-called Clause Conceptual
Generalizations will be asserted:
where the antecedent of the implication is unchanged to hold the quality of the rule, while
F1 (x1 ), F2 (x1 ), F3 (x3 ), as satisfiability contributors of respectively P1 (F1 (x1 )), P2 (F2 (x2 )),
P3 (F3 (x3 )), are assumed asserted together with the latters. In other terms, the predicates: P1 ,
P2 , P3 can be considered as modifiers of respectively F1 , F2 , F3 .
A generalization considering also the antecedent of the implicative formula is possible only
through a weaker assertion of the entire formula itself, by changing =⇒ with ∧ as it follows:
which is not admitted as definite clause, being not a single positive literal. In any case, the
mutual existence of x1 , x2 , x3 which satisfies such a conjunction, is already subsumed by the
implication.
After such a theoretic premise, let’s make a more practical example considering the following
natural language utterance:
When the sun shines hard, Barbara drinks slowly a fresh lemonade
212
Carmelo Fabio Longo et al. 201–218
Table 1
Clause Generalizations Constituents Table (A=Applied, NA=Not Applied)
Hard Slowly Fresh
A NA NA
A A NA
A NA A
A A A
The corresponding definite clause will be (omitting the POS tags for the sake of readability):
Considering as modifiers adjectives, adverbs and prepositions, following the schema in Table 1:
all the clauses generalization (corresponding to the first three rows of the table, while the forth
is the initial clause) can be asserted as it follows:
As said before, the antecedent (whether existing) of all generalizations remains unchanged
to hold the quality of the triggering condition, while the consequent shape will range on all
possible variations of its modifiers, which will be 2𝑛 with 𝑛 as number of modifiers. Here the
adverb Hard, being common part of all the antecedents composition, is always Applied.
Although in such a case the number of generalizations is equal to 4, in general it might be quite
higher: it has been observed, after an analysis of more text corpus from the Stanford Question
Answering Dataset[29], that the average number of modifiers in a single non-implicative
utterance is equal to 6. In such cases the number of generalizations would be equal to 64, but
greater numbers of modifiers would make the parsing less tractable, considering also arguments
analysis for possible substitutions. In order to limit such a phenomenon, depending on the
domain, CASPAR gives the chance to limit the number of generalizations by a specific parameter
which modifies the policies of selective inclusion/exclusion of modifiers categories (adjectives,
adverbs or prepositions).
In such a scenario, of course, the more the combinatorial possibilities, the more the number
of clauses in the Clauses KB. It will appear clear, for the reader, that this approach sacrifices
space for a lighter reasoning, but we rely on a three distinct points in favor of our choice:
1. An efficient indexing policy of the Clauses KB, for a fast retriving of any clause.
2. The usage of the class Sensor of Phidias for every clauses assertion, which works asyn-
chronously with respect to the main production rules system, will make the agent imme-
diately available after every interrogation without any latency, while additional clauses
will be asserted in background.
213
Carmelo Fabio Longo et al. 201–218
3. We point to keep the Clauses KB as small as possible, in order to limit the combinatorial
chances. In this paper we assume the assignment rules properly chosen among the most
likely which can get the query closer to a proper candidate. As future works, a reasonable
balancing between two distinct Clauses KB working on different levels might be a good
solution: in the lower level (long-term memory) only clauses pertinent with the query will
be searched, then put in the higher one (short-term memory) for attempting a successful
reasoning. Similar approaches have been used with interesting outcomes in some of the
widespread Cognitive Architectures[8].
214
Carmelo Fabio Longo et al. 201–218
complex direct IoT commands and routines, letting the user customize with ease his own Smart
Environment Interface and Sensors, with whatever Speech-to-Text engine.
As future works, we want to test CASPAR capabilites with other languages than english
and evaluate other integrations, like Abductive Reasoning and Argumentations. Even chatbots
applications can take advantage of this architecture’s features.
Finally, we want to exploit Phidias multiagent features by implementing standardized com-
munication protocols between agents and exploit other ontologies as well.
References
[1] V. Këpuska, G. Bohouta, Next-generation of virtual personal assistants (Microsoft Cortana,
Apple Siri, Amazon Alexa and Google Home), in: 2018 IEEE 8th Annual Computing and
Communication Workshop and Conference (CCWC), 2018, pp. 99–103.
[2] H. Jeon, H. R. Oh, I. Hwang, J. Kim, An Intelligent Dialogue Agent for the IoT Home, in:
AAAI Workshops, 2016. URL: https://www.aaai.org/ocs/index.php/WS/AAAIW16/paper/
view/12596.
[3] E. V. Polyakov, M. S. Mazhanov, A. Y. Rolich, L. S. Voskov, M. V. Kachalova, S. V. Polyakov,
Investigation and development of the intelligent voice assistant for the Internet of Things
using machine learning, in: 2018 Moscow Workshop on Electronic and Networking
Technologies (MWENT), 2018, pp. 1–5.
[4] M. Mehrabani, S. Bangalore, B. Stern, Personalized speech recognition for Internet of
Things, in: 2015 IEEE 2nd World Forum on Internet of Things (WF-IoT), 2015, pp. 369–374.
[5] R. Kar, R. Haldar, Applying Chatbots to the Internet of Things: Opportunities and Archi-
tectural Elements, International Journal of Advanced Computer Science and Applications
7 (2016). URL: http://dx.doi.org/10.14569/IJACSA.2016.071119. doi:10.14569/IJACSA.
2016.071119.
[6] C. J. Baby, F. A. Khan, J. N. Swathi, Home automation using IoT and a chatbot using
natural language processing, in: 2017 Innovations in Power and Advanced Computing
Technologies (i-PACT), 2017, pp. 1–6.
[7] I. Kotseruba, J. K. Tsotsos, 40 years of cognitive architectures: core cognitive abilities
and practical applications, Artificial Intelligence Review (2018) Rev 53, 17–94 (2020).
doi:https://doi.org/10.1007/s10462-018-9646-y.
[8] D. F. Lucentini, R. R. Gudwin, A comparison among cognitive architectures: A theoretical
analysis, in: 2015 Annual International Conference on Biologically Inspired Cognitive
Architectures, 2015.
[9] T. Giulio, Consciousness as integrated information: A provisional manifesto, The Biological
bulletin (2008) 215(3), 216–242.
[10] S. Epstein, R. Passonneau, J. Gordon, T. Ligorio, The role of knowledge and certainty in
understanding for dialogue, in: AAAI Fall Symposium Series, 2011. URL: https://www.
aaai.org/ocs/index.php/FSS/FSS11/paper/view/4179.
[11] V. Këpuska, G. Bohouta, Comparing speech recognition systems (microsoft api, google api
and cmu sphinx), Int. Journal of Engineering Research and Application Vol. 7, Issue 3, (
Part -2) (March 2017) 20–24.
215
Carmelo Fabio Longo et al. 201–218
216
Carmelo Fabio Longo et al. 201–218
15
217
Carmelo Fabio Longo et al. 201–218
1 > +STT("Nono is an hostile nation")
2
3 Be(Nono(x1), Nation(x2))
4 Be(Nono(x1), Hostile(Nation(x2)))
5 Nono(x) ==> Nation(x)
6 Nono(x) ==> Hostile(Nation(x))
7
8 > +STT("Colonel West is American")
9
10 Be(Colonel_West(x1), American(x2))
11 Colonel_West(x) ==> American(x))
12
13 > +STT("missiles are weapons")
14
15 Be(Missile(x1), Weapon(x2))
16 Missile(x) ==> Weapon(x)
17
18 > +STT("Colonel West sells missiles to Nono")
19
20 Sell(Colonel_West(x1), Missile(x2)) ==> Sell(American(v_0), Missile(x4))
21 Sell(Colonel_West(x1), Missile(x2)) ==> Sell(American(x3), Weapon(v_1))
22 Sell(Colonel_West(x1), Missile(x2)) ==> Sell(Colonel_West(x1), Weapon(v_2))
23 Sell(Colonel_West(x1), Missile(x2))
24 To(Sell(Colonel_West(x1), Missile(x2)), Nono(x3)) ==> To(Sell(Colonel_West(x1), Missile(x2)), Nation(v_4))
25 To(Sell(Colonel_West(x1), Missile(x2)), Nono(x3)) ==> To(Sell(American(v_5), Missile(v_6)), Nation(v_4))
26 To(Sell(Colonel_West(x1), Missile(x2)), Nono(x3)) ==> To(Sell(American(v_7), Weapon(v_8)), Nation(v_4))
27 To(Sell(Colonel_West(x1), Missile(x2)), Nono(x3)) ==> To(Sell(Colonel_West(v_9), Weapon(v_10)), Nation(v_4))
28 To(Sell(Colonel_West(x1), Missile(x2)), Nono(x3)) ==> To(Sell(Colonel_West(x1), Missile(x2)), Hostile(Nation(v_11))
29 To(Sell(Colonel_West(x1), Missile(x2)), Nono(x3)) ==> To(Sell(American(v_12), Missile(v_13)), Hostile(Nation(v_11))
30 To(Sell(Colonel_West(x1), Missile(x2)), Nono(x3)) ==> To(Sell(American(v_14), Weapon(v_15)), Hostile(Nation(v_11))
31 To(Sell(Colonel_West(x1), Missile(x2)), Nono(x3)) ==> To(Sell(Colonel_West(v_16), Weapon(v_17)), Hostile(Nation(v_11))
32 To(Sell(Colonel_West(x1), Missile(x2)), Nono(x3)) ==> To(Sell(American(v_18), Missile(v_19)), Nono(x3))
33 To(Sell(Colonel_West(x1), Missile(x2)), Nono(x3)) ==> To(Sell(American(v_22), Weapon(v_23)), Nono(x3))
34 To(Sell(Colonel_West(x1), Missile(x2)), Nono(x3)) ==> To(Sell(Colonel_West(v_26), Weapon(v_27)), Nono(x3))
35 To(Sell(Colonel_West(x1), Missile(x2)), Nono(x3))
36
37 >+STT("When an American sells weapons to a hostile nation, that American is a criminal")
38
39 To(Sell(American(x1), Weapon(x2)), Hostile(Nation(x3))) ==> Be(American(x4), Criminal(x5))
40
41 >+STT("reason")
42
43 Waiting for query...
44
45 > +STT("Colonel West is a criminal")
46
47 Reasoning...............
48
49 Query: Be_VBZ(Colonel_West(x1), Criminal(x2))
50
51 ---- NOMINAL REASONING ---
52
53 Result: False
54
55 ---- NESTED REASONING ---
56
57 Result: {v_211: v_121, v_212: x2, v_272: v_208, v_273: v_209, v_274: v_210, v_358: v_269, v_359: v_270, v_360: v_271}
Listing 2: CASPAR Clauses Knowledge Base changes and reasoning, after assertions
218
2P-Kt: logic programming with objects & functions
in Kotlin
Giovanni Ciattoa , Roberta Calegarib , Enrico Sibonic , Enrico Dentia and
Andrea Omicinia
a
Dipartimento di Informatica – Scienza e Ingegneria (DISI), Alma Mater Studiorum—Università di Bologna, Italy
b
Alma Mater Research Institute for Human-Centered Artificial Intelligence, Alma Mater Studiorum—Università di
Bologna, Italy
c
University of Applied Sciences and Arts of Western Switzerland (HES-SO), Sierre, Switzerland
Abstract
Mainstream programming languages nowadays tends to be more and more multi-paradigm ones, by
integrating diverse programming paradigms—e.g., object-oriented programming (OOP) and functional
programming (FP). Logic-programming (LP) is a successful paradigm that has contributed to many
relevant results in the areas of symbolic AI and multi-agent systems, among the others. Whereas Prolog,
the most successful LP language, is typically integrated with mainstream languages via foreign language
interfaces, in this paper we propose an alternative approach based on the notion of domain-specific
language (DSL), which makes LP available to OOP programmers straightforwardly within their OO
language of choice. In particular, we present a Kotlin DSL for Prolog, showing how the Kotlin multi-
paradigm (OOP+FP) language can be enriched with LP in a straightforward and effective way. Since it is
based on the interoperable 2P-Kt project, our technique also enables the creation of similar DSL on top
of other high-level languages such as Scala or JavaScript—thus paving the way towards a more general
adoption of LP in general-purpose programming environments.
Keywords
logic programming, object-oriented programming, multi-paradigm languages, domain-specific languages,
Kotlin
1. Introduction
Logic Programming (LP) [1, 2] is a programming paradigm based on formal logic, inspired to
the idea of declaratively specifying a program semantics via logic formulæ, so that automatic
reasoners can then prove such formulæ by leveraging on different control strategies. In the
years, LP has contributed to the development of a number of diverse research fields laying
under the umbrella of symbolic AI—such as automatic theorem proving, multi-agent systems,
model checking, research optimisation, natural language processing, etc.
WOA 2020: Workshop “From Objects to Agents”, September 14–16, 2020, Bologna, Italy
" [email protected] (G. Ciatto); [email protected] (R. Calegari); [email protected] (E. Siboni);
[email protected] (E. Denti); [email protected] (A. Omicini)
~ https://about.me/gciatto (G. Ciatto); http://robertacalegari.apice.unibo.it (R. Calegari);
http://enricodenti.apice.unibo.it (E. Denti); http://andreaomicini.apice.unibo.it (A. Omicini)
0000-0002-1841-8996 (G. Ciatto); 0000-0003-3794-2942 (R. Calegari); 0000-0003-3584-8637 (E. Siboni);
0000-0003-1687-8793 (E. Denti); 0000-0002-6655-3869 (A. Omicini)
© 2020 Copyright for this paper by its authors. Use permitted under Creative Commons License Attribution 4.0 International (CC BY 4.0).
CEUR
Workshop
Proceedings
http://ceur-ws.org
ISSN 1613-0073 CEUR Workshop Proceedings (CEUR-WS.org)
219
Giovanni Ciatto et al. 219–236
Nowadays, LP is one of the major programming paradigms available for software development,
along with the imperative, functional, and object-oriented ones. In particular, LP is today one
of the best-suited choices for tackling problems involving knowledge representation, logic
inference, automated reasoning, search in a discrete space, or meta-programming [3]. Moreover,
today LP supports the core of AI components in pervasive and distributed systems, providing
intelligence where and when it is needed [4].
This is why the integration of LP within the main programming languages is nowadays more
interesting than ever. However, to make it actually work, integration should be designed – from
a linguistic standpoint – so as to reduce both the development time and the learning curve of
developers, as well as the psychological and cultural resistances against the adoption of new
paradigms—thus, basically, moving LP up to a manageable level by the OOP developer.
Most mainstream programming languages – such as Java, Kotlin, Scala, Python, JavaScript,
C# – have recognised the added value of the integration of diverse programming paradigms
under a unique syntax, a coherent API, and a rich standard library. In fact, they all already
support both the object-oriented (OOP) and functional (FP) programming paradigms. We believe
that the same languages would largely benefit from extending their support to LP languages as
well, making them usable in the OOP context in the same way as FP features already are.
Interoperability among Prolog [5] (as the first and most prominent LP language) with other
languages from different paradigms is not new: the Prolog community has actually been studying
this theme for years [6], as shown by the many forms of integration historically present in most
Prolog systems, providing either (i) logic-to-OOP interoperability, making object orientation
available within Prolog scripts, or (ii) OOP-to-logic interoperability, making logic programming
exploitable within object-oriented code—or both, as in the case of tuProlog Java Library [7]. It
is worth noting here that existing integrations make quite strong assumptions. For instance,
item (i) assumes the main application is written in Prolog and the interoperation is given via
a suitable interface allowing the injection of (small) parts written in other languages, while
item (ii) implicitly assumes LP and Prolog to be somehow harmonised with the language(s)
hosting them, at the paradigm, syntactical, and technological levels. Both these assumptions
can actually create a barrier against an effective adoption of LP in today applications despite its
huge potential.
Therefore, the approach adopted in this work is to devise instead a form of LP-FP-OOP blended
integration, such that the key features of LP paradigm can be exposed and made available to
mainstream language developers in a way that is the most natural in that context. The key
requirement, therefore, is the “making LP easy to adopt for OOP programmers”, in order to
break down the learning curve for non-experts, and pursuit the typical developers’ mindset.
Going beyond the mere interoperability intended as simple technical habilitation, our approach
is meant to embrace the perspective of the OOP developer aiming at exploiting the potential of
LP.
To this end, we show how designing Prolog as a domain-specific language (DSL) for an OOP
language such as Kotlin can make LP close enough to the OOP developers’ mindset to overcome
most cultural barriers, while at the same mimicking the Prolog syntax and semantics close
enough to make its use straightforward for LP developers.
Generally speaking, the integration of Prolog with other paradigms aims at bringing the
effectiveness and declarativeness of LP into general-purpose OOP framework. In particular,
220
Giovanni Ciatto et al. 219–236
OOP designers and programmers can be expected to benefit from LP features for (i) data-driven
or data-intensive computations, such as in the case of complex-event-processing frameworks;
(ii) operation research or symbolic AI algorithms, or more generally other algorithms involving a
search space to be explored; (iii) multi-agent systems, and the many areas in that field leveraging
on LP, such as knowledge representation, argumentation, normative systems, etc.
The proposed solution is based on the 2P-Kt technology [8], a re-engineering of the tuProlog
project [9, 10] as a Kotlin multi-platform library supporting the JVM, JS, Android, and Native
platforms. The case of a Kotlin-based Prolog DSL is presented and discussed.
Accordingly, the paper is organised as follows. Section 2 briefly introduces LP, providing
details about tuProlog, 2P-Kt, and Kotlin as well. It also summarises the current state of
the integration between LP and mainstream programming languages. Section 3 discusses
the rationale, design, and architecture of our Prolog-Kotlin DSL along with some examples.
Section 4, briefly illustrates a case study where our DSL is used in combination with functional
programming to solve a simple AI task in an elegant way. Finally, in section 5, concludes the
paper by providing some insights about the possible future research directions stemming from
our work.
221
Giovanni Ciatto et al. 219–236
terms
clauses & theories resolution
Term
Theory Solution Solver
apply(Substitution): Term query: Struct
assertA(Clause) freshCopy(): Term solve(Struct,Long): Sequence<Solution>
assertZ(Clause)
retract(Clause)
retractAll(Clause)
get(Clause): Sequence<Clause>
* Struct MutableSolver
Constant Var Yes Halt
No
functor: String
Clause value: Any name: String substitution: Unifier exception: PrologError loadStaticKb(Theory)
args: Array<Term>
loadDynamicKb(Theory)
head: Struct?
body: Term
substitutions
Substitution
Atom
Numeric List
value: String get(Var): Term unification
Directive Fact Rule contains(Var): Boolean
Unificator
Figure 1: Overview on the public API of 2P-Kt: a type is provided for each relevant concept in LP
222
Giovanni Ciatto et al. 219–236
Table 1
Prolog implementations and their foreign language interfaces (FLI)
Prolog FLI Nature Paradigm
Platform Source
Implementation towards of FLI of FLI
BProlog [15] C Java JNI imperative Official BProlog doc.
Ciao! [16] C Java TCP/IP imperative Official Ciao Prolog doc.
ECLiPSe [17] C Java JNI imperative Official ECLiPSe doc.
SICStus [18] C Java, C# TCP/IP object-oriented Jasper Library
SWI [19] C Java JNI object-oriented JPL API
𝜏 Prolog [20] JS JavaScript Native object-oriented Project homepage
JS, JVM Kotlin, Java, object-oriented,
tuProlog [9] Native Project homepage
Android JavaScript functional
XSB [21] C Java TCP/IP imperative Interprolog Java Bridge
As we are mostly interested in discussing how and to what extent Prolog exploitation is possible
within the target languages, in the reminder of this section we only focus on those FLI allowing
to “call Prolog from the target language”.
Each FLI mentioned in table 1 is characterised by a number of features that heavily impact
the way the users of the target languages may actually exploit Prolog. These are, for instance,
the nature of the FLI – which is tightly related to the target platform of the underlying Prolog
implementation – and its reference programming paradigm.
By “nature” of the FLI, we mean the technological mechanism exploited by a particular Prolog
implementation to interact with the target language. There are some cases – like tuProlog and
𝜏 Prolog – where this aspect is trivial, because the target language is also the implementation
language—so Prolog is considered there as just another library for the target language. More
commonly, however, Prolog is implemented in C, and the Java Native Interface (JNI) is exploited
to make it callable from Java. This is for instance the case of SWI- and ECLiPSe-Prolog. While
this solution is very efficient, it hinders the portability of Prolog into particular contexts such
as Android, and its exploitation within mobile applications.
Another viable solution is to leverage on the TCP/IP protocol stack. This is for instance the
case of SICStus- and Ciao-Prolog. The general idea behind this approach is that the Prolog
implementation acts as a remote server offering logic-programming services to the target
language via TCP/IP, provided that a client library exists on the Java side making the exploitation
of TCP/IP transparent to the users. While this solution is more portable – as virtually any sort of
device supports TCP/IP –, it raises efficiency issues because of the overhead due to network/inter-
process communications. A more general solution of that sort is instead offered by the LPaaS
architecture [22], where the fundamental idea is to have many Prolog engines distributed over
the network, accessed as logic-based web services. By the way, the implementation of LPaaS1 is
based on tuProlog.
By “reference programming paradigm” of the FLI we mean the specific programming style
proposed by a Prolog implementation to the target language users through its API. Some FLI are
conceived to be used in a strictly imperative way: this is e.g. the case of BProlog or Ciao! Prolog,
where a Java API is available for writing Prolog queries and issue them towards the underlying
Prolog system in an imperative way. Other Prolog implementations, such as SICStus- and
1
http://lpaas.apice.unibo.it
223
Giovanni Ciatto et al. 219–236
SWI-Prolog, offer a more object-oriented API which let developer not only represent queries but
also terms, and solutions (there including variable bindings) which can be consumed through
ordinary OOP mechanisms such as iterators.
In most cases, however, the code to be produced in the target language is far less concise and
compact than pure Prolog – unless strings and parsing are extensively adopted –, especially
when the size of the Prolog code to be represented grows. So, for instance, the simple Prolog
query ?- parent(adam, X) (aimed at computing who Adam’s son is) in Java through SWI-
Prolog’s JPL interface would be written as:
While this a totally effective solution on the technical level, we argue that a more convenient
integration among LP and the other paradigms is possible. In particular, in this paper we
show how 2P-Kt allows for a finer integration at the paradigm level through domain-specific
languages.
2
https://gradle.org
224
Giovanni Ciatto et al. 219–236
API, and libraries of the hosting language—there including conditional or iterative constru-
cts, string manipulation API, etc., which are common and useful for many DSL, regardless of
their particular domain. Third, the ecosystem of tools supporting the hosting language – e.g.
compilers, debuggers, formatters, code analysers, IDE, etc. – can be reused for the DSL as well,
easing its adoption and making it more valuable.
When Kotlin is the hosting language of choice, DSL leverage on a small set of features making
the Kotlin syntax very flexible, described below:
operator overloading3 — allowing ordinary arithmetic, comparison, access, and function
invocation operators to change their ordinary meaning on a per-type basis;
function types/literals with receiver4 — allowing functions and methods to accept lambda
expressions within which the this variable references a different object than the outer
scope;
extension methods5 — allowing pre-existing types to be extended with new instance methods
whose visibility is scope-sensible.
Of course, Kotlin-based DSL automatically inherit the full gamma of facilities exposed by
the Kotlin language and standard library—there including support for imperative, and object-
oriented programming, as well as a rich API supporting functional programming through
most common high-order operations. Furthermore, if properly engineered, these DSL may be
executed on all the platforms supported by Kotlin—which commonly include, at least, the JVM,
JavaScript, and Android. This is for instance the case of our DSL proposed in section 3.
While this paper focuses on Kotlin-based DSL, similar results could be achieved in other
languages by means of equivalent mechanisms. For instance, in Scala, extension methods have
to be emulated via implicit classes, and DSL, in particular, can be built via the “Pimp My Library”
pattern [24].
225
Giovanni Ciatto et al. 219–236
exploited from within our DSL. However, we also require (P3 ) the DSL to be well encapsulated
and clearly identifiable within the hosting language, in order to prevent unintended usage of
the DSL itself. Finally, we require (P4 ) our DSL to be as close as possible to Prolog, both at the
syntactic and semantic level, to ease its exploitation for logic programmers.
In order to accomplish to the aforementioned principles, we choose the Kotlin language as the
technological reference for prototyping our proposal. This is because it (i) comes with a flexible
syntax supporting the definition of DSL, (ii) supports a considerable number of platforms (JVM,
JavaScript, Android, Native) and therefore enables a wide exploitation of LP – for instance, on
smart devices –, (iii) includes a number of libraries supporting LP-based applications, such as
2P-Kt.
parent(abraham, isaac).
parent(isaac, jacob).
parent(jacob, joseph).
It enables a number of queries, e.g. ancestor(abraham, X), which can be read as “Does
there exist some X which is a descendant of Abraham?”. According to the Prolog semantics, this
query may have a number of solutions, enumerating all the possible descendants of Abraham
that can be deduced from the above theory—i.e., Isaac, Jacob, and Joseph.
The same result may be attained through the following Kotlin program, which leverages on
our DSL for Prolog:
prolog {
staticKb(
rule {
"ancestor"("X", "Y") `if` "parent"("X", "Y")
},
rule {
"ancestor"("X", "Y") `if` ("parent"("X", "Z") and
˓→ "ancestor"("Z", "Y"))
},
fact { "parent"("abraham", "isaac") },
fact { "parent"("isaac", "jacob") },
fact { "parent"("jacob", "joseph") }
)
226
Giovanni Ciatto et al. 219–236
The program creates a Prolog solver and initialises it with standard built-in predicates. Then
it loads a number of facts and rules representing the aforementioned Prolog theory about
Abraham’s family tree. Finally, it exploits the solver to find all the descendants of Abraham, by
issuing the query ancestor(abraham, X).
It is worth noting how the simple code snippet exemplified above is adherent w.r.t. our
principles. In fact, the whole DSL is encapsulated (P3 ) within the
prolog { ⟨𝐷𝑆𝐿 𝑏𝑙𝑜𝑐𝑘⟩ }
In there, LP facilities can be exploited in combination with the imperative and functional
constructs offered by the Kotlin language and its standard-library (P1 and P2 )—such as the
for-each-loop used to print solutions in the snippet above. Furthermore, within prolog
blocks, both theories and queries are expressed via a Kotlin-compliant syntax mimicking Prolog
(P4 ). The main idea behind such syntax is that each expression in the form
"functor"(⟨𝑒1 ⟩, ⟨𝑒2 ⟩, . . .)
is interpreted as a compound term (a.k.a. structure) in the form functor(𝑡1 , 𝑡2 , . . .), provided
that each Kotlin expression 𝑒𝑖 can be recursively evaluated as the term 𝑡𝑖 —e.g. capital strings
such as "X" are interpreted as variables, whereas non-capital strings such as "atom" (as
well as Kotlin numbers) are interpreted as Prolog constants. In a similar way, expressions of the
form6
rule {"head"(⟨𝑒1 ⟩, . . ., ⟨𝑒𝑁 ⟩) `if` (⟨𝑒𝑁 +1 ⟩ and . . . and ⟨𝑒𝑀 ⟩)}
are interpreted as Prolog rules of the form
head(𝑡1 , . . . , 𝑡𝑁 ) :- 𝑡𝑁 +1 , . . . , 𝑡𝑀
provided that 𝑀 > 𝑁 and each Kotlin expression 𝑒𝑖 can be recursively evaluated as the term 𝑡𝑖 .
A similar statement holds for fact expressions of the form fact { . . . } .
To support our DSL for Prolog, a number of Kotlin classes and interfaces have been designed
on top of the 2P-Kt library, exploiting manifold extensions methods, overloaded operators,
etc. to provide the syntax described so far. The details of our solution – there including its
architecture, design, and implementation – are discussed in the reminder of this section.
227
Giovanni Ciatto et al. 219–236
Scope
_: Var
Prolog PrologWithUnification
varOf(String): Var
Prolog DSL atomOf(String): Atom
Any.toTerm(): Term Any.mguWith(Any): Substitution
structOf(String, Iterable<Term>): Struct
String.invoke(Any, vararg Any): Struct Any.matches(Any): Boolean
emptyList(): EmptyList
Substitution.get(String): Term? Any.unifyWith(Any): Term?
listOf(Iterable<Term>): List
2P-Kt numOf(Double): Real
numOf(Int): Integer
Kotlin
extends
JVM JS
PrologWithResolution
PrologWithTheories
(a) Layered view show- solve(Any): Sequence<Solution>
solverOf(...) theoryOf(vararg Clause): Theory
ing the modules of member(Any, Any): Term
rule(PrologWithTheories.() -> Any): Rule
fact(PrologWithTheories.() -> Any): Fact
is(Any, Any): Term
2P-Kt and our Kotlin !: Atom
fail: Atom
and(Any, Any): Term
or(Any, Any): Term
built on top of Kotlin and 2P-Kt, as represented by fig. 2a. In particular, the DSL is enabled by
the five factory interfaces depicted in fig. 2b. We call factory interface a type definition whose
methods are aimed at instantiating objects of related types, as dictated by the Gang of Four’
abstract factory pattern [25].
The five factory interfaces are: Scope, Prolog, PrologWithUnification, PrologWithTheories,
and PrologWithResolution. Each factory type extends the previous one with more LP-
related functionalities. So, for instance, while instances of Scope simply provide the basic
bricks to create logic terms, instances of Prolog leverage on these bricks to enable the ex-
ploitation of the Prolog-like syntax exemplified above. PrologWithUnification extends
Prolog with unification-related facilities, and it is in turn extended by PrologWithTheo-
ries, which lets developers create both clauses and theories via a Prolog-like syntax. Finally
PrologWithResolution extends PrologWithTheories by adding resolution-related facili-
ties, plus some syntactic shortcuts for writing rules exploiting Prolog standard predicates such
as member/2, length/1, etc.
In the following we provide further details about how each factory contributes to our DSL.
Scope The simplest factory type is Scope. As suggested by its name, it is aimed at building
terms which must share one or more variables. For this reason, it exposes a number of factory
methods – roughly, one for each sub-type of Term –, some of which are mentioned in fig. 2b.
The main purpose of a scope, however, is to enable the creation of objects reusing the same
logic Variables more than once. Thus, it includes a method – namely, varOf(String) – which
always returns the same variable if the same name is provided as input.
For example, to create the term member(X, [X | T]), one may write:
val m = Scope.empty {
structOf("member", varOf("X"), consOf(varOf("X"), varOf("T")))
} // m references the term member(X, [X | T])
228
Giovanni Ciatto et al. 219–236
There, the two calls to varOf("X") actually return the same object, if occurring within the
same scope—whereas they would return different variables if invoked on different scopes.
This mechanism is what enables developers to instantiate terms and clauses without having
to explicitly refresh variables among different clauses: it is sufficient to create them within
different scopes.
Prolog The Prolog factory type extends Scope by adding the capability of creating terms
through a Prolog-like syntax. To do so, it exposes a number of extension methods aimed at
automatically converting Kotlin objects into Prolog terms or using Kotlin objects in place of
Prolog terms. The most relevant extension methods are mentioned in fig. 2b. These methods
are:
• fun Any .toTerm(): Term , which is an extension method aimed at making any
Kotlin object convertible into a Prolog term, through the syntax obj.toTerm() . To
convert an object into a term, it leverages on the following type mapping: (i) a Kotlin
number is either converted into a Prolog real or integer number, depending on whether
the input number is floating-point or not, (ii) a Kotlin string is either converted into
a Prolog variable or atom, depending on whether the input string starts with a capital
letter or not, (iii) a Kotlin boolean is always converted into a Prolog atom, (iv) a Kotlin
iterable (be it an array, a list, or any other collection) is always converted into a Prolog
list, provided that each item can be recursively converted into a term, (v) a Kotlin object
remains unaffected if it is already an instance of Term, (vi) an error is raised if the input
object cannot be converted into a Term.
• operator fun String.invoke(vararg Any): Struct , which is an extension
method aimed at overloading the function invocation operator for strings. Its purpose is to
enable the construction of compound terms through the syntax "f"(arg1 , . . . , arg𝑁 ) ,
which mimics Prolog. Its semantics is straightforward: assuming that each arg𝑖 can
be converted into a term via the Any.toTerm() extension method above, this method
creates a 𝑁 -ary Structure whose functor is "f" and whose 𝑖𝑡ℎ is arg𝑖 .toTerm(). So,
for instance, the expression
"member"("X", arrayOf(1, true))
creates the Prolog term member(X, [1, true]).
• fun Substitution.get(String): Term? , which is an extension method aimed at
overloading the get method of the Substitution type in such a way that is can also
accept a string other than a Variable. This enables DSL users to write expressions such as
substitution.get("X")
instead of having to create a variable explicitly via varOf("X") . While we only discuss
this method, the main idea here is that every method in the 2P-Kt API accepting some basic
Prolog type – such as Var, Atom, or Real – as argument should be similarly overloaded
to accept the corresponding Kotlin type as well—e.g. String or Double. This is what
enables a fine-grained integration of our DSL with the Kotlin language and the 2P-Kt
library.
229
Giovanni Ciatto et al. 219–236
It is worth highlighting that every Prolog object is also a particular sort of Scope. So, con-
verting the same string into a Variable twice or more times, within the same Prolog object,
always yields the exact same variable.
• infix fun Any .`if`(Any): Rule , which is an extension method aimed at creating
logic rules via a Prolog-like syntax in the form head `if` body . Its semantics is
straightforward: assuming that both head and body can be converted into logic goals via
the Any.toTerm() extension method above, this method creates a binary Structure
whose functor is ‘:-’ and whose arguments are head.toTerm() and body.toTerm().
Similar methods exists – namely, and, or, etc. – to create conjunctions or disjunctions of
clauses.
val r1 = fact {
"member"("X", consOf("X", `_`))
}
val r2 = rule {
230
Giovanni Ciatto et al. 219–236
while being sure that the X variable used in r1 is different than the one used in r2.
• fun member(Any, Any): Struct which is an ordinary method aimed at easily cre-
ating invocations of the member/2 built-in predicate. While we only discuss this method,
the main idea here is that every standard built-in predicate in Prolog has a Kotlin coun-
terpart in PrologWithResolution accepting the proper amount or arguments and
returning an invocation to that built-in predicate. This is aimed easing the exploitation of
the standard Prolog predicates to developers leveraging our DSL. So, for instance, we also
provide facility methods for built-in such as is/2, +/2, -/2, !/0, fail/0, append/3,
etc.
static method, which accepts a lambda expression letting the user exploit the DSL on the fly,
and returns the object created by this lambda expression. This is for instance what enables
developers to write the code snippet discussed in section 3.2.
231
Giovanni Ciatto et al. 219–236
aimed at computing all the possible solutions to the N-Queens problem. More precisely, the
method is expected to enumerate all the possible dispositions of 𝑛 queens on a 𝑛 × 𝑛 chessboard,
such that no queen can be attacked by others. Each solution can be represented by a list of
queen positions, in the form [(1, 𝑌1 ), . . . , (𝑛, 𝑌𝑛 )], where each 𝑌𝑖 represent the row occupied
by the 𝑖𝑡ℎ queen—i.e., the one in column 𝑖.
Computing all solutions for the N-Queens problem may require a lot of code in most pro-
gramming paradigms. However, in LP, the solution is straightforward and compact. One may,
for instance, leverage the following Prolog code:
no_attack_all(_, []).
no_attack_all(C , [H | Hs]) :-
no_attack(C, H),
no_attack_all(C, Hs).
solution(_, []).
solution(N, [(X, Y) | Cs]) :-
solution(N, Cs),
between(1, N, Y), % built-in predicate
no_attack_all((X, Y), Cs).
232
Giovanni Ciatto et al. 219–236
This implementation produces a lazy stream of solutions to the N-Queens problem, given a
particular value of 𝑛. In doing so, it takes advantages not only of logic- but also of functional-
programming paradigm. For instance, on the last line, it exploits the map high-order function
to build a list in the form [(1, 𝑌1 ), . . . , (𝑛, 𝑌𝑛 )], to be provided as argument of solution/2.
A number of minutiæ may be noted as well by comparing the Prolog code with its Kotlin
counterpart. For instance, Prolog operators (such as =∖=/2, -/2, etc.) retain their infix notations
in the Prolog DSL. This is possible because they are part of the DSL, in the same way as Prolog
built-in predicates (such as between/3). This implies the Kotlin compiler can prevent standard
operators and built-in from being silently mistyped.
233
Giovanni Ciatto et al. 219–236
apart from Kotlin itself and 2P-Kt –, even if, however, analogous extensions can in principle be
constructed for other high-level languages as well—such as Scala.
Our DSL is currently implemented as part of the 2P-Kt project – namely, within the dsl-*
modules –, and it is hosted on both GitHub [8] and Maven Central. Other than being available to
the public for general purpose usage – under the terms of the Apache License 2.07 open-source
license –, the DSL is currently extensively exploited to implement the unit tests of 2P-Kt itself.
While in this paper we discuss the design rationale and architecture of our DSL by explicitly
focusing on Kotlin as our target technology, in the future we plan to generalise our approach,
possibly tending to technology independence. Furthermore, we plan to provide other implemen-
tations of our DSL, targeting other high-level languages and platforms, in order to make logic
programming and its valuable features available in general-purpose programming languages
and frameworks.
As concerns possible research directions and applications, in the future, we plan to exploit
our DSL in several contexts. For instance, we argue our DSL may ease the usage of the logic
tuple spaces offered by the TuSoW technology [26]. Similarly, we believe our DSL may be used
as a basic brick in the creation of logic-based technologies for MAS, as the MAS community is
eager of general-purpose, logic-based technologies targetting the JVM platform [27]. Along this
line, we argue logic-based languages for MAS may benefit from the integration of our DSL – or
a similar one – to support the reasoning capabilities of agents. Finally, we plan to exploit our
DSL within the scope of XAI [28], to ease the creation of hybrid (i.e., logic + machine-learning)
systems, and management on the symbolic side.
Acknowledgments
R. Calegari has been supported by the H2020 ERC Project “CompuLaw” (G.A. 833647). A.
Omicini has been partially supported by the H2020 Project “AI4EU” (G.A. 825619).
References
[1] K. R. Apt, The Logic Programming Paradigm and Prolog, Cambridge University Press,
2001, pp. 475–508. doi:10.1017/CBO9780511804175.016.
[2] R. A. Kowalski, Predicate logic as programming language, in: J. L. Rosenfeld (Ed.),
Information Processing, Proceedings of the 6th IFIP Congress, North-Holland, 1974, pp.
569–574.
[3] R. Calegari, G. Ciatto, E. Denti, A. Omicini, Logic-based technologies for intelligent
systems: State of the art and perspectives, Information 11 (2020) 1–29. doi:10.3390/
info11030167, special Issue “10th Anniversary of Information—Emerging Research
Challenges”.
[4] A. Omicini, R. Calegari, Injecting (micro)intelligence in the IoT: Logic-based approaches
for (M)MAS, in: D. Lin, T. Ishida, F. Zambonelli, I. Noda (Eds.), Massively Multi-Agent
Systems II, volume 11422 of Lecture Notes in Computer Science, Springer, 2019, pp. 21–
7
https://www.apache.org/licenses/LICENSE-2.0
234
Giovanni Ciatto et al. 219–236
235
Giovanni Ciatto et al. 219–236
236
Suggesting Just Enough (Un)Crowded Routes and
Destinations
Claudia Cavallaro, Gabriella Verga, Emiliano Tramontana and Orazio Muscato
Department of Mathematics and Computer Science, University of Catania, Italy
Abstract
Though people like to visit popular places, for health-related concerns and due to the recent restrictions
adopted around the world, gatherings should be avoided. When planning a trip, one has to consider
both attractiveness in terms of general interest for the destinations, and the density of people gathering
there. In this work, we propose a recommendation system aiming at offering users some suggestions on
useful routes and destinations that balance both liveliness and overcrowding. Firstly, we use datasets
storing GPS positions as a basis for the statistics on routes and destinations. Then, we use an accurate
probability algorithm that estimates the number of people moving from one place to another in the city
and accordingly we show a list of destinations to users. The destination points are filtered based on the
user’s preference on the density of people. A multi-agent system is used to handle the user requests
to find a route for a trip, statistics on possible destinations, and suggestions to users. Thanks to our
solution we can inform users on suitable routes and destinations, as well as alert them when a preferred
destination is overcrowded.
Keywords
GPS trajectory, Recommendation systems, Movement predictions, Multi-agent system
1. Introduction
Currently, organising a trip should take into account the number of people that will gather in
the chosen destination points, since it is necessary to avoid visiting a place that will become
overcrowded to comply with the restrictions due to the Covid-19 influenza pandemic. Hence,
an estimate of the number of people that will be in some place in a future time can be valuable
for people moving and in situations where they could choose visiting some other place.
In previous works, the statistics accumulated over time are used to estimate a measure of
traffic or gatherings [1, 2, 3, 4, 5]. Moreover, both popular online services, and other apps just
count the number of people currently present in some place [6, 7, 8, 9]. However, statistics
gathered in the past cannot be a reliable indication for the current situation that has to cope
with e.g. restrictions on gatherings, lower capacity of public transport means, etc. due to the
influenza pandemic. Additionally, a kind of real time measures of gatherings do not let other
people plan their trip, hence understanding whether e.g. one hour later when arriving at the
destination, the place will still be (un)crowded. A better estimate is therefore needed which
WOA 2020: Workshop “From Objects to Agents”, September 14–16, 2020, Bologna, Italy
" [email protected] (C. Cavallaro); [email protected] (G. Verga); [email protected]
(E. Tramontana); [email protected] (O. Muscato)
0000-0002-7169-659X (E. Tramontana)
© 2020 Copyright for this paper by its authors. Use permitted under Creative Commons License Attribution 4.0 International (CC BY 4.0).
CEUR
Workshop
Proceedings
http://ceur-ws.org
ISSN 1613-0073
CEUR Workshop Proceedings (CEUR-WS.org)
237
Claudia Cavallaro et al. 237–251
takes into account: (i) the current amount of people in some place, and (ii) the statistics on the
number of people that being in some origin place typically flow to another place to visit later on.
Moreover, an app behaving as an assistant agent is needed to timely inform interested people.
This paper proposes an approach to determine the probability that users are moving along
some routes. Given the recordings of several user positions, we compute the probability for
a user that being in some place 𝐴 will move to another place 𝐵 (i.e. a possible destination),
hence when arriving in place 𝐵 he will contribute to the number of people gathering there. By
computing beforehand the probability that he will go to place 𝐵 in a future time, we can guess
whether a place will become overcrowded. Our proposed estimation of people destinations
is based on the analysis of the co-occurrence of places statistically visited by an amount of
people greater than a threshold. Moreover, we propose to give users an app that will let them
know the amount of people that will gather to some areas that can be reached from the point
where the user is. The app provides us support for suggesting the user possible destinations
that are viable both in terms of distance, usefulness, and gathering. Moreover, the app provides
means to collect data on the current amount of people in some place and then their trajectories.
When collecting user data by means of the app we make sure that user privacy is preserved by
providing only an approximate location to a central server.
Our approach can be useful in many contexts where estimating the number of people before-
hand can be a crucial factor for a better service, such as e.g. when organising public transport, or
for retailer, etc. Moreover, it could be enriched with data, coming from proper authorities, that
reveal some places where a Covid-19-positive has been found. Then, by using our computed
trajectories, we could give for other places the probabilities of having infection spreads.
The paper is organised as follows. Next section describes the related work. Section 3 explains
our proposed solution. Section 4 illustrates the experiments and shows the viability of our
approach. Finally, conclusions are drawn in Section 5.
2. Related work
This section offers an overview of the studies on multi-agent systems and the analysis of the
movement of people.
Multi Agent System: a multi-agent system is a system with a significant number of independent
agents that interact with each other [10]. In recent years, multi-agent systems have been
widely used as being regarded suitable for systems with a modular architecture, thanks to their
independence [10]. Generally, agents interact in three ways [11]: (i) each agent can communicate
directly with any other agents (“autonomous agents”); (ii) agents communicate indirectly with
each other via an intermediary (“facilitator”); (iii) all agents communicate with each other via an
intermediary, however the agents can communicate with each other after the communication
has been set up by the intermediary (“Mediator”). In the second case, the robustness can be
poor and the overhead is relatively high but the intermediary acts as a protective wall for users
privacy because agents do not communicate directly and it processes the information received
from the users, decreasing their work [12]. On the other hand, the use of an intermediary has
several advantages in terms of synchronization, reusability, scalability and modularity [13, 14].
Mobility monitoring: an accurate monitoring of user mobility provides support for efficient
238
Claudia Cavallaro et al. 237–251
resource usage. E.g., it could help avoid traffic congestion [1, 2, 3], give warnings or make tar-
geted advertising by discovering the next place to visit [15], or simply study user behaviour [16].
The approach described in [4] identifies the routine behaviour of two sample of people by using
a probabilistic approach (Latent Dirichlet Allocation) to extract 10 different positions shared
by multiple users. Other approaches identify people movements. In [5], the proposed system
observes GPS data in the urban area of Milan and creates an origin-destination matrix, then
provides the similarity between two trajectories, leading to the discovery of mobility behaviours.
Moreover, to find typical trajectories of a group of people, the approach in [17] identifies
flows using a grid with the Apriori algorithm [18], however noting only flows and not the
frequently visited points of interests, nor the probability of some people moving to another
place. In [19], the flows are identified by associating them with spatio-temporal trajectories
shared by multiple users heading in the same direction. Finally, other approaches use machine
learning techniques, e.g. the approach in [20] is based on a clustering algorithm, and uses an
unsupervised learning solution for an automatic lane detection in multidirectional pedestrian
flows.
Our proposed work uses a multi-agent system communicating with a server that acts as an
intermediary and predicts movements by means of an innovative and reliable mathematical
solution. Unlike the work presented in [4], our goal is to detect the foreseeable routes by
computing their probability, instead their method determines the probability that a group of
users is moving together. The work presented in [20] uses an unsupervised learning approach
and aggregates instantaneous information on the position and speed of pedestrians to form
clusters, calculated on short time windows. We use a fixed grid to group people positions into
cells, and then compute the probabilities using the data arriving from the agents in real time.
The paper [21] presents personalised recommendations for guiding tourists through the city of
Melbourne by observing their actions. This system is modelled as a Markov decision process
that recommends the user in sequence the next place to visit. However, unlike the StayPoint
analysis presented here, it does not consider the stationary nature of visitors over a period
of time and this is a key element in avoiding overcrowding. In [17] the frequent corridors, i.e.
routes, were found on a grid through Apriori algorithm [18], while in this work we initially find
the areas having highly visited points of interest, hence giving great importance to the user
stay time. Moreover, we consider the Confidence and Lift metrics used in the Market Basket
Analysis to know the probability of displacement and therefore predict the contagion areas that
are continuously updated.
3. Proposed Approach
We aim at determining the probability that users are moving from one point to another point.
Such a probability is then used to provide recommendations accordingly. Recommendations,
alerts, or user requests, are communicated by means of a smartphone app. Therefore, our
proposed solution comprises two parts: (i) an algorithm that determines the probability of people
movements, and (ii) an app on the users device to track movements and suggest destinations.
239
Claudia Cavallaro et al. 237–251
240
Claudia Cavallaro et al. 237–251
Figure 1: System architecture showing the interaction between agents and server: each agent sends his
preference for crowded places and where he is, the server gathers data and creates recommendations.
Figure 2: User communicates with agents via application GUI. The left panel shows the list of destina-
tions suggested by the multi-agent system and the right panel is the administration view where the
user gives his preferences on (un)crowded places. The colour of the icons represents the intensity of
crowding, that is, more (less) red equals more (less) crowded.
The server, having acquired by the user the position of the nearest SP, returns the list of
other SPs that could be visited according to the probability estimate of passing through that
point (0 equals low probability, 1 equals high probability). In this way, we create a Collaborative
Filtering based recommendation system [23], as it is based on the choices of other users.
Finally, the user, through an administration panel, can set with a flag, if he prefers ’warm’ or
’cold’ places. Thus, the agent, based on the users choice and the list received from the server,
determines information to show and then suggest. Destinations are displayed as a map or a
241
Claudia Cavallaro et al. 237–251
list. All agents are independent of each other and since they extrapolate data directly from the
device they are reliable, making the architecture stable and trustworthy.
4. Experiments
This section describes the experiments carried out using a dataset that collects real movements
from one part of the city to another by taxis and/or people. Positions have been gathered by
periodically reading geo-coordinates from tablets or smartphones. The experiments focus on
data analysis for determining the probabilities of moving from one StayPoint to another as
described in Section 3. This approach is used in our centralized server in order to select the
list of suggestions to send to the agents. The used dataset allows us to simulate the behaviour
of a reasonable number of users, showing the useful of the app. Over time, data are updated
as provided by agents. Below we describe the dataset used in our experiments, then the tests
carried out, and the results that have been found.
4.1. Dataset
The dataset used to perform our tests is Cabspottingdata [24] and includes the trajectories
collected in May 2008 by 536 taxis, for a total of 11, 219, 424 GPS points. Cab mobility traces
are provided by the Exploratorium—the museum of science, art and human perception through
the cabspotting project1 . To gather data each vehicle was outfitted with a GPS tracking device
that was used by dispatchers to efficiently reach customers. Data were sent from each cab
to a central receiving station, and then delivered in real-time to dispatch computers via a
central server. Each mobility trace file, associated to a taxi ID, contains in each line: latitude,
longitude, occupation, timestamp. Where latitude and longitude are in decimal degrees, the
occupation indicates whether a taxi has a fare (1 = busy, 0 = free) and the time is in the UNIX
era format. The area covered by these routes corresponds to the county of San Francisco of
USA and its surroundings in California, with maximum and minimum longitude and latitude
= [−127.08143; 32.8697] x [−115.56218; 50.30546]. The total size of the trajectories registered
with a customer on the taxi consists of 5, 017, 659 points.
1
http://cabspotting.org
242
Claudia Cavallaro et al. 237–251
path two successive points in temporal order only if they were at a minimum distance of 140
𝑚. This was done to decrease the size of the dataset and therefore will allow a reduction in the
execution time of the algorithm.
To carry out a statistical analysis, 90% of trajectories were randomly selected, and this set
was the Train set for the the flow detection algorithm. The complementary set, that is the
remaining 10% of the trajectories, consists in the Test set, that is the verification set. We
considered 6 time slots of 4 hours each, to visualise the movement of the vehicles at different
times and the trajectories were therefore split according to the 6 time slots. To identify the
sub-trajectories common to different users in the same time slot, a maximum tolerance distance
was set between two different points of different users as 280 𝑚. The distance between two
points was computed by using the Haversine distance, which given two points 𝑃𝑖 (𝑙𝑡𝑖 , 𝑙𝑔𝑖 ) and
𝑃𝑗 (𝑙𝑡𝑗 , 𝑙𝑔𝑗 ) characterised by latitude and longitude in decimal degrees returns their distance in
meters considering the curvature of the earth:
√︂
𝑙𝑡𝑖 − 𝑙𝑡𝑗 𝑙𝑔𝑖 − 𝑙𝑔𝑗
𝑑(𝑃𝑖 , 𝑃𝑗 ) = 2𝑅 arcsin sin2 + cos 𝑙𝑡𝑖 cos 𝑙𝑡𝑗 sin2
2 2
where 𝑅 is the mean radius of the earth.
We define flows as close sub-trajectories, belonging to different users, spatially similar and
recorded in the same time slot. The density of a flow is the number of users that pass through it.
For detecting flows in this dataset, the minimum density threshold was set to 25. According to
these parameters, 12 flows were identified, ranging from 1 to 2 km in length. The minimum
density of the flows found is 26 taxis, while the maximum density found is 192 taxis. Then, by
taking the complement of the trajectory sample (10% of the taxis, as the test set) we checked
where their GPS points were compared to the previous train set. We found that the points of
the test set intersect with the 12 paths identified on the train set. Another check was carried
out by confirming the correspondence of the points of the flows on a map. It consists of the
process of matching the coordinates of the obtained flows and the road segments, and assessing
that there are no external points with respect to road segments (see Figure 3).
We apply the StayPoint detection algorithm to each trajectory (more details can be found
in [25]) with time threshold, TimeThr, equal to 10 minutes, and distance threshold, DistThr,
100 meters. Such thresholds should suffice to select the positions in which a user dwells (in
several SPs) as he finds the place interesting, and removes the locations where a user is stopping
because e.g. he is blocked at the traffic light.
The execution time for the StayPoints detection algorithm on the whole Cabspotting dataset
(536 taxis and more than 11𝑀 points) was 36 minutes and 54 𝑠. We obtained a total of 4261
𝑆𝑃 𝑠, which is an average of 8 𝑆𝑃 𝑠 per vehicle journey. The results show that 98% of users
have at least one StayPoint associated with their trip (523 users out of 536). The implementation
of StayPoints detection algorithm used Python and the experiments were executed in a host
having an Intel Xeon CPU E5-2620 v3 2.40GHz, with RAM 32 GB.
Figure 4 shows the recorded trace for each trip in blue, and the detected SPs in yellow. Figure 5
shows the detected flows in magenta and the SPs in that area in green.
243
Claudia Cavallaro et al. 237–251
244
Claudia Cavallaro et al. 237–251
and shown as red dots. Some areas consisting of nearby cells have many more SPs than others,
hence red dots are more dense in some areas than others, as shown in the said figure.
In order to determine whether a cell 𝐴 is a frequent destination, the Support for each cell
was calculated. The Support is the ratio between the number of trajectories that contain the
cell and the total number of trajectories. If this ratio exceeds a certain threshold, i.e. if cell 𝐴
245
Claudia Cavallaro et al. 237–251
Figure 5: A zoomed in map of an area in Figure 4, showing flows in magenta and the nearby StayPoints
in green.
is crossed by a certain number of different trajectories (10% value was chosen for Minimum
Support, i.e. 0.1), then the cell (containing one or more SPs) will be a frequently visited cell.
Our experiments on the above said taxi dataset have shown that there are 43 cells visited by
a number of users greater than or equal to 52. I.e. we can say that in the dataset there are 43
frequently visited 𝑆𝑃 𝑠 cells. This means that there has been a probable meeting in that cell, as
users have remained stationary in the same time slot in the same cell. Data are updated in real
time through the agents running on smartphones as an app, therefore the Minimum Support
is fixed, however the number of frequent cells in output and the position of these frequently
visited cells will vary over time.
By lowering the Minimum Support, i.e. the threshold of the minimum amount of people
sharing the same cell, the number of cells considered as having a sufficient amount of people
will increase and then the number of cells considered overcrowded will increase. In order to
compute association rules only between the frequently visited cells in the dataset, we considered
246
Claudia Cavallaro et al. 237–251
Figure 6: Grid formed by squared cells of 1 𝑘𝑚 per side, each red dot represent a cell having at least
one SP.
247
Claudia Cavallaro et al. 237–251
be used to predict whether a user can be potentially infected (as his trajectory is estimated),
and predict who else he will infect (i.e. people whose trajectories are expected to pass through
the same areas).
The Confidence limit is due to the fact that it does not consider the Support of the item on
the right side of the rule and therefore does not provide a correct evaluation in case the groups
of items are not stochastically independent.
A measure that takes this eventuality into account is Lift(𝐴 ⇒ 𝐵), defined as:
Lift(𝐴 ⇒ 𝐵) takes into account the importance (the Frequency) of 𝐵. Using such an amount,
then we can say
Therefore, Lift indicates how the occurrence of one event raises the occurrences of the
other. At this point, the setting would be a Minimum Confidence (0.6 i.e. 60%) to skim the
results and obtain only the association rules that had a higher Confidence and also a Support
higher than the Minimum Support (0.1 chosen), such a setting is named Strong rules. Finally,
these rules were checked with the Lift, the last column of Table 1. Then, for the Association
Rule ([2587] ⇒ [2588]) in row 6 the events of movement from cell 𝐴 to cell 𝐵 are negatively
correlated.
The left panel in Figure 7 shows the plot of every Strong Rule obtained as a point, as a value
for its Support and Confidence (the latter according to the Support). For association rules with
higher support the Confidence, that is the probability of moving to the frequently visited cell 𝐵,
decreases. The Lift and the Confidence of the Strong Rules obtained are directly proportional,
as we can see in the right panel of Figure 7. The Pearson correlation coefficient between them
is 0.9999999999999999 and this implies an exact linear relationship.
Moreover, the results tell us that the probability of transitioning from one cell with SPs to
another is high even in correspondence with the indicated flows and that different highly visited
cells having SPs belong to different flows. For each cell we have checked which taxis passed
there and which passed at a later time on other flows passing through other frequently visited
cells.
5. Conclusions
Having an educated guess on the amount of people that will gather in some place before
planning a trip can be very useful to avoid overcrowded places and to keep with the current
regulations. We have proposed an approach for predicting the probability of people moving
to some destinations when it is known that a certain amount of people is in some other place.
We use an app that senses the position of people and sends to a server such data. Then, such
an amount is useful, together with previous statistics, to estimating the amount of people in
248
Claudia Cavallaro et al. 237–251
Table 1
A set of Cells and the related Support (Sup), Confidence (Conf), and Lift, when cell B is 2588,
𝑆𝑢𝑝𝑝𝑜𝑟𝑡(𝐵) = 0.671128, and having Strong Association Rules: Minimum Confidence 60% , Mini-
mum Support 10%
another place at a later time. The experiments that we have performed on previously gathered
geographical locations have shown the viability and reliability of our approach.
The more people use the app the more the approach would give a correct estimate. To make
the approach more robust, it could be extended in order to include data available online from
other services that give indications on queues, road traffic, gatherings.
Future work will consider the geometry of stations, museums, etc. of some popular destina-
tions to compute the average distance of people given the estimated size of crowds. Moreover,
how alerts are spread will consider both the people already in some place and the people moving
towards it.
Acknowledgments
The authors acknowledge the support provided by means of a PO FSE 2014-2020 grant founded
by Regione Siciliana, and by project TEAMS–TEchniques to support the Analysis of big data in
Medicine, energy and Structures–Piano di incentivi per la ricerca di Ateneo 2020/2022.
249
Claudia Cavallaro et al. 237–251
Figure 7: The left panel shows the Support vs Confidence for Strong Rules obtained by our analysis
and given as rows in Table 1; the points show a pair of cells (𝐴 and 𝐵), or a triple of cells (for the last
three rows of Table 1). The right panel shows Lift vs Confidence in this test, as for the points shown in
the left panel.
References
[1] P. Castro, D. Zhang, S. Li, Urban traffic modelling and prediction using large scale taxi gps
traces, in: Proceedings of of International Conference on Pervasive Computing, 2012, pp.
57–72. doi:10.1007/978-3-642-31205-2_4.
[2] J. Lee, J. Han, X. Li, A unifying framework of mining trajectory patterns of various
temporal tightness, IEEE Transactions on Knowledge and Data Engineering 27 (2015)
1478–1490.
[3] Z. Wang, M. Lu, X. Yuan, J. Zhang, H. van de Wetering, Visual traffic jam analysis based
on trajectory data, IEEE Transactions on Visualization and Computer Graphics 19 (2013)
2159–2168.
[4] N. Bicocchi, M. Mamei, Investigating ride sharing opportunities through mobility data
analysis, Pervasive Mobile Computing 14 (2014) 83–94.
[5] R. Trasarti, et al., Exploring real mobility data with m-atlas, in: Proceedings of Machine
Learning and Knowledge Discovery in Databases, Springer, 2010, pp. 624–627.
[6] J. Cranshaw, R. Schwartz, J. Hong, N. Sadeh, The livehoods project: Utilizing social media
to understand the dynamics of a city, in: Proceedings of AAAI Conference on Weblogs
and Social Media, 2012.
[7] C. Berzi, A. Gorrini, G. Vizzari, Mining the social media data for a bottom-up evaluation
of walkability, in: Proceedings of International Conference on Traffic and Granular Flow,
Springer, 2017, pp. 167–175.
[8] B. P. L. Lau, M. S. Hasala, V. S. Kadaba, B. Thirunavukarasu, C. Yuen, B. Yuen, R. Nayak,
Extracting point of interest and classifying environment for low sampling crowd sensing
smartphone sensor data, in: Proceedings of IEEE Pervasive Computing and Communica-
tions, 2017.
[9] C. Cavallaro, G. Verga, E. Tramontana, O. Muscato, Eliciting cities points of interest from
people movements and suggesting effective itineraries, Intelligenza Artificiale (2020).
doi:10.3233/IA-190040.
250
Claudia Cavallaro et al. 237–251
251