SOCA (2008) 2:167–185 DOI 10.1007/s11761-008-0030-7 ORIGINAL RESEARCH PAPER A hierarchical, agent-based service oriented architecture for smart environments Ivan Marsa-Maestre · Miguel A. Lopez-Carmona · Juan R. Velasco Received: 14 September 2007 / Revised: 1 July 2008 / Accepted: 27 July 2008 / Published online: 26 August 2008 © Springer-Verlag London Limited 2008 Abstract Service Oriented Architectures, which allow for the integration of different subsystems and of applications running on different devices and platforms, may be very suit- able to solve the problem of service personalization in large smart environments like cities, where the number of potential users and potentially available services is rapidly growing. Taking this into account, we have designed an agent-based service oriented architecture for smart spaces. Two of the greatest challenges in the design of such a solution are pro- viding effective device, service and context federation and composition mechanisms and handling user mobility. For the first challenge, we have designed a hierarchical archi- tecture and developed a set of inheritance, aggregation and access mechanisms for devices, services and context. To han- dle user mobility, we have followed three different strategies, using stationary, mobile or nomadic agents. In this paper, we describe the main aspects of our architecture and perform an experimental evaluation to determine the advantages and drawbacks of the different strategies. Keywords Service personalization · Service oriented architectures · Smart environments · Mobile agents · Nomadic agents 1 Introduction We can define a smart environment as one that is able to acquire and apply knowledge about its inhabitants and its surroundings in order to adapt to the inhabitants and meet the goals of comfort and efficiency [1]. These goals are normally I. Marsa-Maestre (B ) · M. A. Lopez-Carmona · J. R. Velasco Departamento de Automatica, Universidad de Alcala, Madrid, Spain e-mail: ivmarsa@aut.uah.es; ivan.marsa@uah.es directed to adapt the environment to the user preferences, to increase the performance of the users in their day-to-day tasks, and to optimize the energy consumption of the sys- tem involved. This paper focuses on service personalization, which may be seen as the ability of the system to tailor ser- vice provision to the preferences and circumstances of the user requesting the service. Customized contents, automated interface adaptation for impaired people or unified messaging are examples of personalized services which could be pro- vided by smart environments. To achieve this goal, relying on an underlying service oriented architecture is paramount. In our previous work [2], we designed and implemented an agent-based software architecture for smart homes. We are now extending this architecture to make it applicable to other smart environments. In particular, we are interested in urban computing environments [3], as there are significant challenges in the automatization of such environments. One of these challenges is to cope with the high number and diver- sity of available services. To make possible that inhabitants of an urban environment make use of the available services in an efficient way, an architecture must be developed that allow for the integration of different subsystems and of applica- tions running on different devices and platforms. Moreover, mechanisms need to be defined to allow users (or entities rep- resenting the users) to find the service provider which most suits user preferences, if any. Taking this into account, we have developed a hierarchical, agent-based service oriented architecture for smart spaces, which we call Smart Environ- menT Hierarchy (SETH). The architecture can be deployed in layers, which allows to create complex smart environments by combining, for instance, a certain number of smart rooms to create a smart building and a certain number of smart buildings and smart outdoor spaces to create a smart city. Two are the key concepts behind our architecture design. One is the hierarchical arrangement of smart spaces, which 123