4.3 Tools
5.2.2 Reasoner
Out of the set of reasoner features exploited by KAS (described in 4.3.1), the SAR problem domain makes use of two:
Subsumption. This is exploited by KT during discretisation and by the MAPE monitor component. The KT algorithm asserts a direct Entity subconcept for every monitored input (in the case of SAR, they are TimeOfDay, Focus and Battery, as shown in Fig. 5.3). To illustrate subsumption, let us analyse the TimeOfDay hierarchy, obtained by discretising the M2 monitored input and comprising concepts EarlyMorning, LateMorning, EarlyAfternoon and LateAfternoon. Initially, these last four concepts are asserted under Entity, however, the reasoner is able to infer that they are, logically, subconcepts of TimeOfDay. Indeed, given the formal definitions of TimeOfDay and EarlyMorning (Fig. 5.4), it is straihforward to conclude that the latter refers to a subcategory of TimeOfDay instances, namely certain hours of the day in certain months of the year. The process is graphically illustrated in Fig 5.6, where earlyMorning is asserted as a direct subclass of Entity but inferred as a direct subclass of TimeOfDay.
Fig. 5.6:TheEntityhierarchy before (Asserted) and after (Inferred) subsumption (Protege ontology view, where hierarchies are displayed as indented lists)
The monitor component exploits subsumption while asserting ontology concepts for newly read input values. Let us continue relating to M2 and assume the current time is 10 am in November. Even though CurrentTime (Fig. 5.7) is initially asserted (by KT) as a direct subclass of Entity, the reasoner will infer its appropriate place in the hierarchy, namely under EarlyMorning (Fig. 5.6). This has an important impact on KAS’s capacity of processing knowledge, as it allows the system to “understand”, without being explicitly “told”, that 10 am on a November day qualifies as early morning, whereas in July, the same time belongs to the late hours of the morning.
Sensor data verification. Let us assume that the sensor reading M2 values is defective and returns hour -1 (the month is irrelevant for this example). The currentTime concept in Fig. 5.7 is asserted with filler [>=-1 <= -1] for property hasTime, which does not match any of the TimeOfDay class definitions. Consequently, CurrentTime will be inferred under OWLThing (the base of the OWL concept hierarchy). The current state of the system will therefore violate the definition of the State (Fig. 5.5)
Class: <SARonto#CurrentTime> EquivalentTo: <SARonto#Entity>
and (<SARonto#hasTime> some xsd:integer[>= 10 , <= 10]) and (<SARonto#hasDate> some xsd:integer[>= 11 , <= 11])
Fig. 5.7:TheCurrentTimeconcept definition
class (since the hasTimeOfDay filler is OWLThing instead of a subclass of TimeOfDay), thus making the State concept unsatisfiable. Sensor data validation is not an implicit feature of the resoner, instead it is facilitated by the structure of the ontology (provisioned with a State hierarchy with the appropriate property restrictions).
5.2.3 Policy
The SAR policy document contains all three sections described in 4.2.2.
Utilities. The domain expert (and author of the policy document) may express preference towards SAR system states by assigning numeric utilities to each of them, as shown in Table 5.2. Monitored input M2 is not taken into account, as the time of day when the document is shown to the audience does not directly influence the quality of the presentation (it does so, indirectly, as illustrated by the policy heuristics). Hence, the same utility is assigned to a group of four states to account for all discrete categories of M2 values (early/late morning/afternoon). The goal states are s33-s36, corresponding to high audience focus and high levels of battery charge, which are assigned the maximum utility. Note that Table 5.2 is not the only way to associate utilities to states, as, in some other practical scenario, it may be the case that states s5-s8 are more valuable than states s13-s16 and their utilities should be swapped.
Table 5.2: SAR policy document - state utilities
State M1 (focus) M3 (battery) Utility
s1 - s4 low low 1 s5 - s8 low medium 2 s9 - s12 low high 3 s13 - s16 medium low 4 s17 - s20 medium medium 5 s21 - s24 medium high 6 s25 - s28 high low 7 s29 - s32 high medium 8 s33 - s36 high high 9
Actions. Given the two effectors presented in 5.1, the autonomic manager may alter the managed resource by carrying out the actions in Table 5.3. The set of actions was compiled under the following assumptions:
• decreasing the font size will not enhance audience focus nor impact battery charge levels, therefore this operation is not included in any of the actions
• increasing brightness may increase audience focus at the cost of accelerating battery depletion
• decreasing brightness will likely decrease audience focus yet slow down the battery depletion speed.
Admittedly, the assumptions may change from one domain expert to another (it is, after all, plausible to expect a smaller font size and a dim display to entice the audience to focus more). However, the list given above is not intended to cover all possible scenarios, but merely to illustrate this section of the policy document and to highlight the fact that the two components of the goal (s9 in Fig. 5.2) are conflicting, that is, aiming for high audience focus will most likely reduce battery charge levels.
Table 5.3:SAR policy document - plan actions
Action E1 (font) E2 (brightness) a1 increase increase a2 increase maintain a3 increase decrease a4 maintain increase a5 maintain maintain a6 maintain decrease
Heuristics. This section of the policy document contains high level knowledge used to simplify the analysis and planning stages of the MAPE loop. To illustrate, let us consider the two heuristics given in Table 5.4 (in ECA format).
Table 5.4: SAR policy document - heuristics
(a) heuristic 1 When focus is low event AND
the time is late morning condition 1 OR
the time is early afternoon condition 2 THEN
exclude a2, a3, a5 and a6. action
(b) heuristic 2 When battery is low event THEN
exclude a1 and a4. action
When the level of light in the environment is high (in the late morning and early afternoon), that may interfere with the display, therefore decreasing or maintaining the brightness will compromise the visibility of the document. Heuristic 1 eliminates those actions from the list of candidates to consider when formulating plans. Also, when the battery is low, increasing brightness will only drain it faster. To preserve battery levels, heuristic 2 eliminates all actions implying an increase in screen brightness. Note that, should both heuristics be simultaneously activated (in case audience focus is low and so is the battery charge level), there would be no actions left to consider during planning. To prevent the system from going idle, the heuristics are prioritised: in the provided example, heuristic 2 takes precedence over heuristic one.