# Cognitive Pervasive Service Composition Applied to Predatory Crime Deterrence
## 2 Related Works
### Related Service Composition Works  
Service composition systems have been developed for well over a decade now. However, only in more recent times has the service composition community begun to tackle the challenges introduced by open, dynamic environments, such as those of pervasive systems. In this section, we present some studies focused on pervasive service composition in open, dynamic environments. [PERSON] et al. [37] proposed an IoT architecture for service composition, divided into five components: the request handler; the service registration engine; the service discovery engine; the service composition and execution engine; and the service providers. The architecture performs a semantic service classification by domain. However, it is unknown whether services obtain a semantic meaning beyond this classification. This proposal also lacks any learning capability. Additionally, the architecture seems to require all IoT gateways to have all architecture components loaded, which may not be feasible in some cases. Furthermore, the services used in this work are exclusively web services, so this proposal does not take into account pervasive service composition aspects such as locality and context-awareness. The work of [PERSON], [PERSON] and [PERSON] [23] proposes a service composition system based on the opportunistic network approach to deal with pervasive network communication, and uses both orchestration and choreography strategies and a utility-based function to compare solutions. The main processes are the service discovery, guided by the hop-measured utility function, and the composition proper, done either by orchestration or by choreography. Whether the chaining is syntactical or semantic is not specified. This system lacks any capacity to learn from performed compositions, and has to start from scratch for similar scenarios. The system does not seem to have the capacity to adapt the yielded composite service, and tries to limit the impact of the open dynamic nature of pervasive systems by establishing a maximum distance (\(H_{max}\)) for participants to be considered in a composition process. GoCoMo [38] is a service composition and adaptation model which uses an AI planning algorithm based on the backward-chaining technique. In order to exploit the goal-oriented approach used in this work, the authors focus on three main issues: goal-driven service discovery, handled by the establishment of a temporary overlay network; opportunistic service execution, handled via online adaptable reasoning; and heuristic discovery checking, handled via a hop-based heuristic discovery mechanism. In this model, service matchmaking is done syntactically; the authors justify this choice by arguing that maintaining a semantic dynamic overlay network for resource-constrained devices can be very expensive. GoCoMo does not seem to have a learning mechanism, so future composition tasks do not exploit the composition's experienced solutions. [PERSON] et al. [39] proposed an adaptive pervasive service composition protocol based on the pervasive system of systems (PSoS) paradigm. It employs a distributed constraint satisfaction problem (disCSP) approach to ensure that user's requirements are satisfied, and extends it to deal with the dynamism of pervasive environments. The composition process comprises three phases: identification of potential participants through a modified Contract Net Protocol, service composition through the PSCP algorithm for solving the disCSP and service adaptation based on a heuristic named DPS that seeks to dynamically add new participants into the system. This proposal lacks any learning mechanism, so experience from yielded solutions cannot be taken into account for similar future composition scenarios. Additionally, adaptation focuses on functional requirements, leaving aside QoS requirements that could affect user experience. COPERNIC [40] is service composition and adaptation middleware for pervasive systems. Its approach uses the modeling of a cognitive agent for performing service compositions.