ICAASE'2014 Petri Net Modeling Dynamic Context of Ambient Systems Petri Net Modeling Dynamic Context of ambient Systems Ali Sahnoun Ramdane Maamri Software and Information Technology department Software and Information Technology Department LIRE Laboratory, Constantine 2 University LIRE Laboratory, Constantine 2 University Constantine, Algeria Constantine, Algeria Sahnouna@hotmail.fr rmaamri@yahoo.fr Abstract – An ambient System is a network of tools and equipment that interacts to fulfill someone needs. This equipment should respect the context in which they act. In order to correctly fulfill their functions, we need to specify these contexts. In this paper, we propose a new approach that allows 1) to model the ambient systems as a multi agent systems, and 2) to model both local context of each component and the global context of the ambient systems. The context is modeled using petri nets to formally verify and validate the system operations. Keywords Ambient Systems, Multi Agent Systems, Local context, Global Context, Petri net 1. INTRODUCTION 2. AMBIENT SYSTEM AND CONTEXT The progress of the current computer leads 2.1. Ambient system ubiquitous computing where each object in the environment plays the role of a sensor unit, An ambient system is an invisible system present calculator or communication. However, the everywhere and anytime [2]. We are talking number and variety of smart devices raise about the system that interacts with the concerns about the amount of time and attention environment changes and behaves according to that users must spend to interact. these changes. This research is a part of the emerging field of 2.2. Context ubiquitous computing with, as a subject of study, Context is the adaptation of application to the notion of context. The objective is to arrive at changes in its environment. The context is a set a definition of the notion of context that is of information that is structured, shared, evolving operational for purposes of man-machine and used to interpretation. [3] interaction. Context is “Any information that can be used to In this paper we are trying to overcome these characterize the situation of an entity (person, deficiencies. In section 2, we introduce ambient object or physical computer). More generally any systems and their context. Section 3 presents element that may influence the behavior of an the different approaches of modeling ambient application”. [4] systems and context. In section 4, we describe BREZILLON [5] define the context by: “The our approach to model the ambient systems and context is what is not directly involved in solving context. This approach is based on multi agent a problem, but forced his resolution”. systems and petri Nets. The section 5, we try to 2.3. Changes in the context describe our approach thru an example. International Conference on Advanced Aspects of Software Engineering ICAASE, November, 2-4, 2014, Constantine, Algeria. 185 ICAASE'2014 Petri Net Modeling Dynamic Context of Ambient Systems A context is defined by its situations and pred Our approach to model the ambient systems is icates,Context = C (predicates / situations), oth based on the Multi-Agent System. Each erwise the context is defined by possible component of the system could be considered as situations of the system and the functions that an agent lead to these situations. [1] The global context will be constructed and managed by a common resource agent. C1.1, C1.2 are sub context of C1. E: event that causes the change of context. The context of the system changes if one or more context changes. C=(c1, c2, c3, …ci) / C: system context, ci: sub system’s context. 3. RELATED WORK CONTINUUM project [1] proposed a model of context the context in terms of static time, using Figure1: Multi agent system for ambient systems the functional and behavioral decomposition, 4.1. Our approach to model the context which makes the role of programmer easier, but Our approach is based on the decomposition of the work of designers increasingly difficult. a system to subsystems. The designer defines a Several researches targeted the modeling of the context C (p) by defining all entities (p) and context problem [10], [11], [12]. predicates associated with this context: Petri Nets (PN): Several graphical modeling C(p) = (Entities(p), Predicates(p)). approaches to context-aware services have This formal model (predicate, entities) not allows been proposed to implement an effective model us to see the relationship between the that specifies the acquisition and management components and the events and not to have an of the various components of the environment overall view of the system context. To overcome such as Unified Modeling Language UML [13], this problem, we modeled each local context as ORM Object Role Modeling [14] and Petri Nets. a petri net. In this section, we will focus on Petri Nets. 4.1.1. Predicate Recently, many approaches to modelling context-aware systems based on PN have been Propositional logic can essentially discuss proposed and have been recognized as grammatical connectors as of negation (¬), promising and effective models for the conjunction (∧) and disjunction (∨), composing representation of context [15] [16]. proposals from proposals data. Colored PN (CPN): Han et al., proposed a 4.1.2. Petri net model that focuses on the transition contexts The Petri net (PN) is a graphical modeling tool [17] [18]. It is able to check whether the system for discrete dynamical systems. [20] can provide service in a specific time when the context changes. 4.1.3. Nested net Silva et al., [19] proposed to combine 3D The sets N0,M0 of nets and marked nets of modeling tools with CPN for modeling 3D depth zero are defined as the sets of colored environments. In this model, the place is used to nets and marked colored nets over the universe indicate the current state of the user and U0, respectively. For each n > 0 the value components such as PDAs and screen. universe Un and the sets Nn , Mn of nets and 4. PROPOSAL APPRAOCH TO MODEL A marked nets of depth n are recursively defined CONTEXT by Un = Un −1 ∪ Mn−1 and Nn and Mn as the set of colored nets and marked colored nets International Conference on Advanced Aspects of Software Engineering ICAASE, November, 2-4, 2014, Constantine, Algeria. 186 ICAASE'2014 Petri Net Modeling Dynamic Context of Ambient Systems over Un. We set Nω = SS n≥0Nn,Mω = n≥0Mn (3)AlarmSonoreOn(DispositifAlarmeSonore [] d) checked if DAlarmSnore is active. andUω =U0∪Mω. (4)AlarmLightOn(DispositifAlarmeLumineuse [] 4.2. Modeling local context (sub system) d) checked if DAlarmLight is active. After generating the overall situation of our sub system, 5.1.3 Situation the common resources will turn in a formal model by applying transformation rules. The common resource agent will collect elements of internal contexts (predicates and states) to generate the global possible states of our system. 5.2. Modeling the local context (petri net) The common resource agent applies transforming rules to get the model of local context of I-Alarm. Figure2: Transforming rules As a result we obtain a formal model based petri net of internal context of each sub system. We illustrate with an example of a monitoring system with two sub-systems camera and door The sub-system Camera has two predicates: • Activatedcamera(): true if door is opened. Figure3: Model of context of sub system I-Alarm • Deactivatedcamera(): true if door is closed. 5.3. Modeling of overall context of the system I-Home (nested net) 4.3. Modeling global context After generating the models of local context of After generating all the internal contexts of each each sub system of I-Home, the common sub system, the common resources will resource agent will build the global model of generate the overall context of the system by context taking into account dependences and considering the addiction and relationships relations between sub systems. between sub systems. The result is a nested net of global context of I- Home given in the figure below 5. APPLICATION 5.1. Description Our application is a sub-system of the ambient system I-Home, this sub-system is called I- ALARM. [1] 5.1.1 Entities • Person: individual. Figure4: Model of context of the system I-Home • DAlarmSnore: device may emit an audible alarm. 6. CONCLUSION AND PERSPECTIVES • DAlarmLight: device capable of emitting The purpose of this paper is to present a formal light alarm. approach to model both the ambient system and 5.1.2 Predicates its dynamic context. To model the context, we used the Petri Nets (1) isHourAlarm (Person p) checked if it is time method to better fit the dynamic environment of for person to wake up. (2) IsAwake (Person p): checked if person is our system and clearly describe the event awake. causing change in context. The model we have International Conference on Advanced Aspects of Software Engineering ICAASE, November, 2-4, 2014, Constantine, Algeria. 187 ICAASE'2014 Petri Net Modeling Dynamic Context of Ambient Systems proposed has checked some property such as Revue d’intelligence Artificielle 18(4), 577– reachability and security. 606 (2004). The perspectives of this study are: [10] Strang, T., Linnhoffpopien, C.: A context I. Refining and detailing the MAS. To get a modeling survey. In: Workshop on Advanced Context Modeling, Reasoning and coherent system with regards to its Management, UbiComp 2004 (2004). context model, we are planning to use [11] Ye, J., Dobson, S., MacKeeve, S.: Situation the Agent Architecture Description identification techniques in pervasive Language (AADL) to formally specify the compu- ting: A review. Pervasive and Mobile MAS for the ambient system. Computing (8), 36–66 (2011). [12] Bettini, C., Brdiczka, O., Henricksen, K., II. Checking other properties such as Indulska, J., Nicklas, D., Ranganathan, A., integrity and compatibility with other Ribo- ni, D.: A survey of context modeling environments. and reasoning techniques. Pervasive and Mobile Computing 6, 161–180 (2010). III. Implement a complete application. [13] Bauer, J.: Identification and Modeling of Contexts for Different Information Scenarios 7. REFERENCES in Air Traffic, Diplomarbeit (March 2003). [1] Gaëtan Rey(I3S), Jean-Yves Tigli(I3S), [14] Henricksen, K., Indulska, J., Rakotonirainy, Stéphane Lavirotte(I3S), Nicolas Ferry(I3S), A.: Generating Context Management Infra- Sana Fathallah (I3S), Joëlle Coutaz(LIG), structure from High-Level Context Models. Emeric Fontaine(LIG), Fabrice Jouanot In: Industrial Track Proceedings of the 4th (LIG), Anis Benyelloul (LIG), Marie-Christine In- ternational Conference on Mobile Data Rousset(LIG), Philippe Renevier(I3S), Anne- Management (MDM 2003), pp. 1–6 (2003). Marie Pinna- Dery(I3S),Vincent Hourdin [15] Han, S., Youn, H.Y.: Petri net-based context (MobileGov), “Modélisation du Contexte et modeling for context-aware systems. Artifi- Adaptation dans Continuum“,2010. cial Intelligence Review 37, 43–67 (2011). [2] Weiser, M. (1991). The computer for the [16] Sun, J., Zhang, Y., He, K.: A Petri-Net based 21st century, Scientific context representation in smart car environ- American.URL:http://www.ubiq.com/hyperte ment. In: Bellavista, P., Chang, R.-S., Chao, xt/weiser/SciAmDraft3.html. H.-C., Lin, S.-F., Sloot, P.M.A. (eds.) GPC 2010. LNCS, vol. 6104, pp. 162–173. [3] Winograd T., Architectures for context, Springer, Heidelberg (2010). Human-Computer Interaction, 2001. [17] Han,S.,Song,S.K.,Youn,H.Y.:Modelingandan [4] Dey A. K., Salber D., Futakawa M., Gregory alysisoftimecriticalcontextawareser- vice D., Abowd An Architecture To Support using extended interval timed colored Petri Context-Aware Applications, GVU Technical nets. Tech. rep., The school of information Report GIT-GVU-99-23, 1999. and communication engineering. Sungkyunkwan University, Seoul (2010). [5] P Brezillon, L Pasquier, JC Pomerol - [18] Han, S., Song, S.K., Youn, H.Y.: Modeling European Journal of Operational Research, and verification of context-awareness 2002 service for time critical applications using [6] Ryan N., Pascoe J., Morse D., Enhanced colored petri-net. In: IEEE/WIC/ACM Reality Fieldwork: the Context- Aware International Conference on Web Archeological Assistant, V. Gaffney, M. van Intelligence and Intelligent Agent Leusen, S. Exxon, Computer Applications in Technology, WI-IAT 2008, vol. 2, pp. 71–74. Archeology, 1997. IEEE (2009). [19] Boucheneb, H.: Interval timed coloured petri [7] Oana Bucur, Philippe Beaune, Olivier net: efficient construction of its state class Boissier,“ Representing Context in an Agent space preserving linear properties. Formal Architecture for Context-Based Decision Aspects Comput. 20(2), 225–238 (2008). Making“ (2005). [20] J.P. Chemla,“A-Processus déterministes : [8] Dey, A.K., Salber, D., Futakawa, M., Abowd Les Réseaux de Petri“,Modélisation et G.D.: An Architecture to Support Context- analyse des systèmes de production Aware Applications. GVU Technical Reports Polytech’Tours département Productique (1999). 2ème année (2008). [9] Calvary, G., Demeure, A., Coutaz, J., Dâassi, O.: Adaptation des Interfaces Homme- Machine à leur contexte d’usage. International Conference on Advanced Aspects of Software Engineering ICAASE, November, 2-4, 2014, Constantine, Algeria. 188