# Novel Semantic-Based Probabilistic Context Aware Approach for Situations Enrichment and Adaptation
## 5 The Prototype  
### Prototype Implementation  
We implemented a desktop prototype on NetBeans IDE and integrated it on Kali-Smart platform. The prototype may manage several customizable options according to user preferences. The ontology-based context-aware situation probabilistic recommendation process is the main module of our prototype, which is in charge of filtering and recommending suitable rules from the rule repository and then adapting these rules to available devices. The prototype enables a semantic matching between the current user context and the recommended situation rules based on the similarity function (Equation (6)), considering three-context similarities by using implicit and explicit preferences and Bayesian probability. Figure 5 shows the screenshots of main GUI.  
The Java-based prototype can:  
1. Create and save a novel profile with its preferences in the profile configuration file.
2. Manage any user's preferences, which has several customizable options according to user preferences. For example, the user can select between locations, roles to either worker or others. The weight for the recommendation processes can be also customized by the user, selecting a value among [0, 1] in the GUI.
3. Recommend relevant rules according to profile configuration.
4. Adapt actions services based on the device's characteristics information.  
Figure 6 shows how the GUI specifies the preferences of a user and selects the requested values of his preferences. Indeed, the system calculates the weights of explicit attributes according to Equation (3) and selects the relevant situation rules with the best score among available situations rules. The score for each rule item is calculated based on Equation (6). Therefore, if the user changes its preferences, the system selects the new rules directly from the current context configuration set without performing phase 1.  
The prototype is developed for situations enrichment and management by end-users and the administrator in smart environments. It allows an administrator to manage the rules repository by domain (_security_, _demotic_, _health_, _study_, _work_, _tourism_ or _shopping_) and control the recommendation parameters according to user situation. It also helps end-users to profit from rich and dynamic user experiences.  
Initially, when launching the prototype, the user should provide his social accounts (Facebook or Google Calendar) to enable the recommender to extract his/her interests and propose new situations rules. Since the user needs to exploit different available services in his smart domain, he has to define his preferences. After defining his preferences and daily situations, the recommender starts to suggest the user's relevant rules and appropriate services. To define the situations easily, we propose a mobile application GUI enabling to define daily situations and/or to subscribe to external sources for a richer and more dynamic application. The user can select a preferred device to run recommended services. To respond to user situations, the prototype needs to be aware of his context at all times and continues suggesting new situations rules according to his current location, preferences and needs.  
Figure 5: Main GUI of our recommendation and adaptation approach.