# A Novel Routing Scheme for Creating Opportunistic Context-Virtual Networks in IoT Scenarios +
## 3 Situational Context  
The aim of the IoT paradigm is to improve people's lives by automating daily tasks. In order to improve how users interact with these devices and customize such automated tasks, the users' context and the information gathered by IoT devices are used to adapt the system behavior to the users' preferences in each specific situation. Therefore, the context and the gathered information have to be exchanged among the different devices in order to make that customization. Regarding devices' adaptation, different approaches, such as [30; 31], have been defined to semi-automatically adapt the devices' behavior to the user's preferences. Most of these approaches follow a server-centric architectural style (i.e., the gathered contextual information is directly uploadedto a server, where it is computed to create the user's virtual profile and shared with other devices). Later, this information is consumed by context-aware applications and smart-devices to adapt their behavior. In the last few years, the increased computing and storage capabilities of smart-devices have allowed us to propose a new context-aware computing model (which is closer to a peer-to-peer architectural style). This model, first, uses the user's mobile device to gather, store, and compute the contextual information in order to construct his/her virtual profile; and second, uses this virtual profile to adapt the behavior of IoT devices. This computing model is called situational context [10]. The situational context defines that a profile contains the following information:  
* A _basic profile_ containing the dated raw contextual information with the user's status, the relationships with other devices, its history, and other data gathered by the device's sensors. * A _social profile_ containing the results of inferences performed over the raw data. The information stored by the basic profile is processed by an inference engine to obtain high level data. * The _goals_ detailing the desired status of the environment can also be deduced from the basic and social profiles by using different inference rules. * The _skills_ or capabilities that an entity has, in order to make decisions and perform actions capable of modifying the environment and aimed at achieving goals. Considering environments in which there are different entities (things and people) and each of them has a virtual profile, the situational context can be defined as the composition of the virtual profiles of all the entities involved in a particular situation. The result of composing the virtual profiles is the combined history of the entities ordered in a single timeline, the result of high level inferences performed over the combined virtual profiles, the set of goals of the entities, and their skills. Currently, there are different programming paradigms, such as Context Oriented Programming (COP) [32], that can be used to define different behaviors of an application depending on the identification of specific contextual information. They concur that the information and/or variables triggering the adaptation are detailed within the source code of the applications. Thus, the adaptation capabilities are limited to the set of contexts defined during the system design. Instead, in the situational context, once the profiles are composed, the ways in which the entities will be coordinated to better satisfy the users' goals are identified at run-time. Thus, the situational context provides a higher level of automation of smart things with people. Figure 1 shows a simple example of a living room in which there is a small party with three people and a smart HIFI system. Each person, through his/her smartphone, has a virtual profile detailing historical contextual information (e.g., the music he/she usually plays, her/his location, etc. ), her/his preferences (e.g., her/his musical interests in each specific location), and her/his goals (e.g., listen to specific music styles).