Roberta Calegari and Enrico Denti
DISI, ALMA MATER STUDIORUM Univ. of Bologna,
Smart spaces [1, 2] refer to a variety of environments (apartments, offices, museums, hospitals, schools, malls, outdoor areas) enabled for the cooperation of smart objects and systems, and for the ubiquitous interaction with visitors. Computer systems seamlessly integrate into people’s everyday lives, providing services and information “anywhere, anytime” [3, 4], combining dimensions and behaviour from pervasive, distributed, situated and intelligent computing .
The development of the Internet of Things [5, 6, 7, 8] is further pushing scenarios where appliances and devices of virtually any sort are networked together, possibly embedding some form of (usually limited) intelligence—as shown by recent proposal by major players such as Google’s ‘Works With Nest’ , Samsung SmartThings , Apple’s Home Kit , Windows 10 IoT Core , Amazon’s Smart Home shop ; personal assistants with natural language capabilities, like Google Now , Siri , Cortana , are also developing suggestion capabilities based on the user’s context and habits.
The result is a special kind of Socio-Technical System (STS)—the kind of systems that arise “when cognitive and social interaction is mediated by information technology, rather than by the natural world (alone)” .
To design and build smart spaces that go beyond the mere remote-control of appliances and more generally the “gadget”-like approach of some current prototypes, two key preconditions seem to be (i) the availability of an effective interaction and coordination middleware, going beyond the basic support to interoperability, and (ii) an effective support to distributed intelligence  and situatedness, intended as awareness of the environment and possible reactivity to changes—so as to spread intelligence “when and where needed”, including
the middleware; in turn, this calls for an “intelligence-ready” coordination layer. In this scenario, Multi-Agent Systems (MAS)  are a natural source of models, infrastructures and methodologies that appear to be inherently well suited to Smart Spaces—in particular, as concerns the infrastructure intelligence.
Home Manager [26, 27] is an agent-based platform for the implementation of Smart Spaces in Smart Home contexts, specifically in IoT-aware environments, shaped from the Butlers for Smart Spaces framework , in its turn rooted in the Butlers vision : the basic idea is to provide advanced services to users immersed and situated in time and space, who interact with their surrounding environment—in particular, trying to anticipate the users’ needs whenever possible, reasoning on potentially any kind of relevant data grabbed both from users’s preferences and from other sources. The platform is built on top of the TuCSoN [30, 31] multi-agent coordination infrastructure, which enables intelligence to be spread not only on agents, but also on coordination artifacts, thanks to the underlying tuProlog [32, 33] technology.
Being light-weight and Java-based, tuProlog effectively supports the development of both declarative (Prolog) and imperative (Java,C#) agents, as well as hybrid Java+Prolog agents ; at the same time, it powers TuCSoN artifacts, paving the way to bring reasoning also at the infrastructure level.
In this paper we discuss how Home Manager can support the design and development of Smart STS, focussing in particular on the reasoning aspects enabled by the Butlers for Smart Spaces framework and, more generally, on the relationships among agent intelligence, infrastructure intelligence and system policies. Our goal is to show that this approach not only makes it natural to spread and coordinate distributed, situated intelligence in smart spaces but also supports the integration of heterogeneous (possibly legacy) components in spite of the differences in design paradigm, implementation language and platform, data representation, communication and coordination language, thus helping to bridge the gap between the infrastructure level and the situated interaction patterns that are typically found in Smart Spaces contexts.
We move from Butlers for Smart Spaces  – the specialisation of the Butlers
framework  to the Smart Spaces context – to discuss first its re-shaping to the
Home Manager case, where IoT technologies (communication-enabled sensors,
meters, actuators, etc.) and and platforms (e.g. Raspberry PI) are taken into account
in the context of the TuCSoN middleware, and then show how a Smart Space can be designed and deployed on top of the resulting platform.
The reference scenario consists of a smart house immersed in a smart living context, with devices (air conditioners, lights, etc.) and users of different categories and roles . At the basic operation level, the goal is to satisfy the users’ desires (e.g. room light, temperature) while respecting some global constraints (e.g. energy saving, temperature range, etc.): at a higher level, however, the goal is more ambitious—to anticipate the user’s needs by reasoning on the user’s habits and on any user-related information, including the environment where he lives, travels, purchases goods, etc.
More precisely, our case study considers a smart kitchen made of a Smart Oven, a Smart Fridge, a Smart Pantry, a Smart Mixer, integrated with a Smart Shopper butler aimed at managing the food supply, as follows:
- the Smart Oven is aimed at supporting the user’s food cooking—in principle, exploiting any available technology to identify and cook the food;
- the Smart Fridge monitors the availability and quantity of food in the fridge;
- the Smart Pantry is supposed to to the same for the whole kitchen;
- the Smart Mixer manages the recipe instructions, interacting both with the Smart Fridge (to check for ingredients’ availability) and with the Smart Oven (to check its ability to cook that food and synthesise the control instructions): the fridge content is checked to generate the shopping list;
- the Smart Shopper butler, in charge of opportunistic behaviour, handles the shopping list, e.g. sending the order to the “appropriate” market for delivery.
This scenario clearly calls for “proper chunks” of intelligence spread where needed—in particular, to reason on the available information based on specific policies, which can be – in principle – as complex as desired: for instance, policies could guarantee that at least two bottles of milk are always present, that the total of the shopping list reaches a minimum threshold to exploit free home delivery, that the list is compared against multiple markets to find the most convenient one, taking into account fidelity cards and special offers, etc. The user’s location could also be exploited to find a nearby market, minimising hassle and fuel consumption, suggest an alternative market to avoid traffic jams, etc.
In Home Manager, the above architecture takes the form of a TuCSoN MAS: suitable agents take care of the Basic Fridge/Pantry/Oven Services, while ReSpecT reactions implement both the basic mechanisms and the social intelligence. In the current (highly experimental) prototype, the Smart Oven and the Smart Pantry are simulated in software, while the Smart Fridge  integrates software-only and software+Raspberry PI hardware, coupled with display, sensors, LEDs, and an RFID tag reader. Every time an RFID tagged product is moved through the fridge, a read event is generated: a beep is produced, a led is lit, and information about the product appear on the LCD display. All the information about the kitchen state, including the fridge content, is reified in suitable tuple centres as proper tuples, so that both agents and further reactions can exploit it for further reasonings. In particular, the Smart Shopper – based on its own shopping policies – consumes the order information, compiles the shopping list and contacts the “proper” (currently: the pre-defined) vendor via the “proper” means (currently: by email), with the list of products and quantities to be purchased.
Summing up, while most approaches focus on the development of standard
frameworks, APIs, infrastructures, interoperability protocols, or move from a specific need or application area, the Butlers for Smart Spaces framework tries to define a technology-neutral reference for Smart Spaces in pervasive IoT contexts, exploitable as an effective design guideline. The Home Manager platform concretises the approach by suitably integrating three technologies – the TuCSoN middleware for MAS coordination, ReSpecT for situated intelligence, tuProlog for light-weight intelligent agents: the designers’ freedom is emphasised, thanks to the chance of delegating the infrastructure to bridge among the diverse agents’ ontologies, APIs, knowledge representations, etc. in a declarative way.
The result shows the essential role of a declarative approach in supporting i) the coordination of heterogeneous agents, ii) the injection of intelligence in the infrastructure level (with high-level symbolic capabilities), and more generally iii) in building and natively integrating intelligent agents in the system nodes.
 Wang, X., Dong, J.S., Chin, C., Hettiarachchi, S., Zhang, D.: Semantic space: An infrastructure for smart spaces. IEEE Pervasive Computing 3(3) (2004) 32–39
 Chen, H., Finin, T., Joshi, A., Kagal, L., Perich, F., Chakraborty, D.: Intelligent agents meet the semantic web in smart spaces. Internet Computing, IEEE 8(6) (Nov 2004) 69–79
 Satyanarayanan, M.: Pervasive computing: vision and challenges. Personal Communications, IEEE 8(4) (Aug 2001) 10–17
 Saha, D., Mukherjee, A.: Pervasive computing: a paradigm for the 21st century. Computer 36(3) (Mar 2003) 25–31
 Schaffers, H., Komninos, N., Pallot, M., Trousse, B., Nilsson, M., Oliveira, A.: The future internet. Springer-Verlag, Berlin, Heidelberg (2011)
 Rothensee, M.: User acceptance of the intelligent fridge: Empirical
results from a simulation. In Floerkemeier, C., Langheinrich, M., Fleisch,
E., Mattern, F., Sarma, S., eds.: The Internet of Things. Volume 4952 of
LNCS. Springer (2008) 123–139
 Microsoft: The internet of your things. https://dev.windows.com/en-us/iot/ (2015)
 Google: Works with Nest. http://techcrunch.com/2014/06/23/google-makes-its-nest-at-the-center-of-the-smart-home/ (2014)
 Amazon Smart Home. https://www.amazon.com/smarthome-home-automation/b?ie=UTF8&node=6563140011 (2016)
 Microsoft Cortana. https://microsoft.com/en-us/mobile/experiences/cortana/ (2016)
 Baresi, L., Shahzada, A.: An architecture-centric approach for dynamic smart spaces. In Weyns, D., Mirandola, R., Crnkovic, I., eds.: Software Architecture. Volume 9278 of LNCS. Springer Int Pub (2015) 277–284
 Ricci, A., Omicini, A., Denti, E.: Engineering agent societies: A case study in smart environments. In: Proceedings of the First International Joint Conference on Autonomous Agents and Multiagent Systems: Part 3. AAMAS ’02, New York, NY, USA, ACM (2002) 1064–1065
 Zambonelli, F., Omicini, A., Anzengruber, B., Castelli, G., Angelis,
F.L.D., Serugendo, G.D.M., Dobson, S., Fernandez-Marquez, J.L., Ferscha, A., Mamei, M., Mariani, S., Molesini, A., Montagna, S., Nieminen, J., Pianini, D., Risoldi, M., Rosi, A., Stevenson, G., Viroli, M., Ye, J.: Developing pervasive multi-agent systems with nature-inspired coordination. Pervasive and Mobile Computing 17, Part B (2015) 236 –
 Whitworth, B.: Socio-technical systems. In: Encyclopedia of Human Computer Interaction. Hershey: Idea Group (2006) 533–541
 Zambonelli, F.: Toward sociotechnical urban superorganisms. Computer 45(8) (2012) 76–78
 Jennings, N.R., Moreau, L., Nicholson, D., Ramchurn, S., Roberts, S., Rodden, T., Rogers, A.: Human-agent collectives. Com. ACM 57(12)
(November 2014) 80–88
 Jennings, N.R., Sycara, K., Wooldridge, M.: A roadmap of agent research and development. Autonomous Agents and Multi-Agent Systems 1(1) (January 1998) 7–38
 Denti, E., Calegari, R.: Butler-ising HomeManager: A pervasive multi-agent system for home intelligence. In Loiseau, S., Filipe, J., Duval, B., Van Den Herik, J., eds.: 7th Int. Conf. on Agents and Artificial Intelligence (ICAART 2015), Lisbon, Portugal, SCITEPRESS (10–12 January 2015) 249–256
 Denti, E., Calegari, R., Prandini, M.: Extending a smart home multi-agent system with role-based access control. In: 5th Int. Conf. on Internet Tech & Society, Taipei, Taiwan, IADIS Press (10–12 December 2014) 23–30 Best Paper Award.
 Calegari, R., Denti, E.: The Butlers framework for socio-technical
smart spaces. In Bagnoli, F., Satsiou, A., Stavrakakis, I., Nesi, P., Pacini,
G., Welp, Y., Tiropanis, T., DiFranzo, D., eds.: Internet Science. 3rd International Conference (INSCI 2016). Volume 9934 of LNCS., Springer (2016) 306–317
 Denti, E.: Novel pervasive scenarios for home management: the Butlers architecture. SpringerPlus 3(52) (January 2014) 1–30
 Omicini, A., Zambonelli, F.: Coordination for Internet application development. Autonomous Agents and Multi-Agent Systems 2(3) (September 1999) 251–269
 Denti, E., Omicini, A., Ricci, A.: tuProlog: A light-weight Prolog for Internet applications and infrastructures. In Ramakrishnan, I., ed.: Practical Aspects of Declarative Languages. Volume 1990 of LNCS. Springer (2001) 184–198
 Denti, E., Omicini, A., Calegari, R.: tuProlog: Making Prolog ubiquitous. ALP Newsletter (October 2013)
 Home Manager. http://apice.unibo.it/xwiki/bin/view/Products/HomeManager (2014)
 Omicini, A., Zambonelli, F.: Tuple centres for the coordination of Internet agents. In: 1999 ACM Symposium on Applied Computing (SAC’99), ACM (1999) 183–190
 Omicini, A., Denti, E.: Formal ReSpecT. Electronic Notes in Theoretical Computer Science 48 (June 2001) 179–196
 Omicini, A.: Towards a notion of agent coordination context. In Marinescu, D.C., Lee, C., eds.: Process Coordination and Ubiquitous Computing. CRC Press, Boca Raton, FL, USA (October 2002) 187–200
 Omicini, A.: Formal ReSpecT in the A&A perspective. Electronic Notes in Theoretical Computer Science 175(2) (June 2007) 97–117
 Casadei, M., Omicini, A.: Situated tuple centres in ReSpecT. In Shin, S.Y., Ossowski, S., Menezes, R., Viroli, M., eds.: 24th Annual ACM Symposium on Applied Computing (SAC 2009). Volume III., ACM (8–12 March 2009) 1361–1368
 Casadei, M., Omicini, A.: Programming agent-environment interaction for mas situatedness in respect. The Knowledge Engineering Review (January 2010)
 Casadei, M., Omicini, A.: Situated tuple centres in respect. In: Proceedings of the 2009 ACM symposium on Applied Computing, ACM (2009) 1361–1368
 Marzaduri, L.: Windows 10 IoT su Raspberry Pi 2: multi-paradigm programming tra Java e C# (2016) Bachelor’s Thesis – Scuola di Ingegneria e Architettura, Alma Mater Studiorum-Università di Bologna. http://amslaurea.unibo.it/10299/.
 Omicini, A., Ricci, A., Zaghini, N.: Distributed workflow upon linkable coordination artifacts. In Ciancarini, P., Wiklicky, H., eds.: Coordination Models and Languages. Volume 4038 of LNCS. Springer (June 2006) 228–246
 Omicini, A., Denti, E.: From tuple spaces to tuple centres. Science of Computer Programming 41(3) (November 2001) 277–294
 Carano, M.: Sperimentazione di tecnologie raspberry in contesti di home intelligence. Bachelor’s Thesis – Scuola di Ingegneria e Architettura, Alma Mater Studiorum-Università di Bologna (2015)
 Paolini, D.: Geolocalizzazione di servizi in un sistema di home intelligence. Bachelor’s Thesis – Scuola di Ingegneria e Architettura, Alma Mater Studiorum-Università di Bologna (2015)
 Bevilacqua, S.: Home intelligence & social network in the butlers perspective. Bachelor’s Thesis – Scuola di Ingegneria e Architettura, Alma Mater Studiorum-Università di Bologna (2015)
 Zappavigna, V.: Butler vision nella home intelligence: un caso di studio. Bachelor’s Thesis – Scuola di Ingegneria e Architettura, Alma Mater Studiorum-Università di Bologna (2015)
 Ahmad, A., Paul, A., Rathore, M.M., Chang, H.: Smart cyber society: Integration of capillary devices with high usability based on cyber–physical system. Future Generation Computer Systems 56 (2016) 493 – 503