## 4 Generic Context Aware Cross-Layer Framework
### Ontology-Based AmI Context Model
#### 4.3.2 Scenario-Based Customization  
In this section, we illustrate how the proposed ontology-based context model can be customized for the motivating AmI scenario outlined in Section 3. The following assumptions have been made:  
* All location information is represented in the form of relative node location defined according to the Anchor-Free Localization (AFL) algorithm [22], _i.e.,_ in terms of hop counts to 4 corner reference  
\begin{table}
\begin{tabular}{p{113.8 pt} p{113.8 pt} p{113.8 pt} p{113.8 pt}} \hline \hline
**AmI System** & **User-Event to Detect** & **Context Expression** & **Follow-Up Action** \\ \hline \multirow{4}{*}{An ontology- and logical rule-based smart home automation system [18]} & A vocal order from user to turn on a suitable light when he/she wakes up at night. & & Turn on bedside (not ceiling) \\  & A vocal order from user to turn on a suitable light when he/she wakes up at night. & eventLocation (Bedroom) \(\wedge\) eventTime (Night) \(\wedge\) activityType (Sleeping) & lamp after a vocal order is received to avoid hurting the user’s eyes at that moment. \\ \cline{2-3}  & A user going to bed with main door unlocked. & eventLocation (Bedroom) \(\wedge\) activityType (Sleeping) \(\wedge\) eventObject (MainDoor, Unlocked) & Alert user to lock the main door. \\ \hline \multirow{4}{*}{An energy saving mechanism for smart office environments [19]} & A user working with PC. & eventLocation (Office) \(\wedge\) activityType (Sitting) \(\wedge\) eventObject (Chair, SeatedOn) \(\wedge\) eventObject (Keyboard, Manipulated) & If user-event NOT detected, switch PC and LED screen to sleep mode. \\ \cline{2-3}  & A user at social corner under eventLocation (SocialCorner) \(\wedge\) poor natural light condition (e.g. due to weather) & eventLocation (SocialCorner) \(\wedge\) eventSize (NaturalLightSensor, LowLightIntensity) & Turn on ceiling lamp and adjust its level to provide just enough light. \\ \hline \multirow{4}{*}{A context-aware and agent-based system for outdoor smart lighting [20]} & A user walking or standing around a sharp corner of a street with car approaching (TaflleSensor, OncomingCar) & eventLocation (Street) \(\wedge\) eventRadius (SharpCorner) \(\wedge\) activityType (SharpCorner) \(\wedge\) activityType (SharpCorner) \(\wedge\) activityType (SharpCorner) \(\wedge\) activityType (SharpCorner) \(\wedge\) eventObject (SharpCorner) \(\wedge\) eventRadius (SharpCorner) \(\wedge  
nodes. A user's smart device is also capable of determining the AFL-based location of the events or users. * To simplify the context design, personal attributes of a user are represented in terms of a high or low vulnerability state. For instance, both children and elderly are commonly considered as vulnerable individuals in AmI scenarios and therefore are represented with a high vulnerability state in the age-associated attribute. On the other hand, individuals of other ages are represented with a low vulnerability state in this attribute. Disability is another common personal attribute in AmI. People with certain disability types can be more vulnerable than those with other disabilities in a particular AmI scenario. For instance, people with vision or walking impairments are at greater risk in the outdoor scenario presented in Section 3. Therefore, they can be represented with a high vulnerability state in the disability-associated attribute, while those with other disabilities or otherwise healthy can be represented with a low vulnerability state in this attribute. * Each sensor node has a simple ontology-based context module for performing simple context reasoning tasks. The objective of this reasoning is to determine the importance of the sensor data to the context inference process of the intelligent agents.