6.2 Incomplete State Space
6.2.2 Context Coverage Criteria
To reduce the state space to an incomplete state space, a criterion is required to select the states that are kept in the state space. Therefore, I propose to pre-plan an incomplete state space that covers certain contextual situations, which may emerge at runtime. In order to systematically control the reduction of a state space, the amount of contexts in a contextual situation may be limited. Therefore, an automatically generatable set of context combinationsC is required, describing a set of contexts combinations to denote contextual situations which may emerge at runtime.
In this regard, the power-set P(C) of the contexts C is computed to define a set of context combinations C. The power-set provides the set of all subsets of C, including the empty set ∅. Since the empty set does not contain any contexts the empty set ∅ is excluded from C. Note that C may also contain combinations of contexts, which are not satisfiable by a context-feature model. As intended by the context-feature model specification, such contextual restrictions are not coverable by the incomplete state space.
The power-setP(C)k is restricted by the parameter k, which limits the size of all subsets. With this, the limited (power-set) of context combinationsCk is denoted as follows.
Notation 6.2(Context Coverage Criterion). With a given k ∈N, the combinatorial context coverageC is denoted as a limited power-set of context combinations C+
Ck := Pk(C)\∅ = {C+ 1, . . . , C + k | C + i ⊆C with i = 1 . . . k}.
Thereby, each set of contexts C+ ∈Ck is limited in its size by k ∀C+ ∈Ck : |C+| 6 k.
Note that a coverage criterion of k always subsumes all criteria that are smaller than k, e.g., a k=2 also covers all context combinations that are covered by a k=1.
For example, an extract of a limited context combination for the Nexus DSPL is the set Ck = {{Car}, {Office}, {Home}, {Concert}, {Slow Network}, {Car, Office}, {Car, Home}, {Car, Concert}, {Car, Slow Network}, {Office, Concert}, {Office, Home}, {Office, Slow Network}, . . .} for k=2. As previously explained, this set contains context combinations, which are incompatible w.r.t. the context-feature model of the Nexus DSPL depicted in Figure 4.2, such as {Office, Concert}. In such a case, no state is derived and the combination is discarded.
A coverage of every single context, i.e., setting k=1, offers a radical reduction of the state space. In addition to this one-wise coverage of single contexts, arbitrary
R esour ce C onstraint R untime A d apt a tion
combinations of contexts, i.e., k>1, may emerge at runtime. Hence, appropriate configurations satisfying the k-wise combinations of contexts have to be provided in order to execute the respective adaptation to a changing contextual situation. Such a k-wise combinatorial context coverage criterion may restrict the compu- tation of (sub-)sets of configurations at design time, whereas configurations for uncovered combinations beyond k-wise may, again, be computed on-demand as depicted in Figure6.8(c).
A suitable trade-off between memory consumption utilized by a largeKS and computation of reconfigurations at runtime is to be found by means of an appro- priate combinatorial context parameter k. In this regard, the state space of the Nexus DSPL is reducible from 66 states to an incomplete state space of 12 states for k=2 for the cost of computing a reconfiguration for every contextual situation emerging at runtime, which consists of more than 2 active contexts.
Example 6.3 (Context Coverage).
The Nexus DSPL allows a combination of up to three contexts. For example, the contextsConcert,Slow Network, andCarrepresent a valid 3-wise combination. The constraints in the context-feature model depicted in Figure 4.2allow all of those three contexts to be active at the same time.
The power-set P for these three contexts is listed in Table 6.1, in which ev- ery active context is considered to be part of a contextual situation and every inactive context is not considered to be part of a contextual situation. To de- rive aKS with an incomplete state space for a 3-wise context coverage, every combination of active contexts () is used to compute and integrate a suitable configuration state.
Concert Slow Network Car
Table 6.1:Power-Set 3-wise Context Combination
In the Nexus DSPL all the listed contextual situations are valid w.r.t. the context-feature model. Thus, 6 states are derived at design-time to cover the contextual situations listed in Table6.1at runtime.
If a contextual situation is satisfiable by several configuration states, further reduction or optimization strategies may be applied for a more detailed selection of configuration states. For example, a set of states that satisfies the requirements imposed by a contextual situation may be reduced to one representative state with the non-functional properties, which are considered to be most suitable for the contextual situation, e.g., the state with the least energy consumption.
R esour ce C onstraint R untime A d apt a tion
In the process of deriving an incomplete state space w.r.t. a set of contextual combinations Ck it may occur that the same device configuration is applicable for different contextual situations. The reason for this is that not only a single context combination is representable by a set of configuration states, as stated on page105, but also a single configuration state may be suitable for multiple context combinations. In this regard, a given configuration γ
F ∈ Γcfm, which interprets
only the subset of features F of a context-feature model cfm ⊆ FMC∪F, may sup- port multiple combinations of active contexts C+ ∈ Ci in a configuration state si ∈ S. According to Notation 6.1, each of these context combinations may be
interpreted as a contextual situation, in which every context c ∈ C+is either inter- preted as active, γ(c) =t, or as irrelevant, γ(c) = ⊥, for that contextual situation. Thus, a state si may be suitable for multiple interpretations of a contextual situ-
ation, in which si(c) > ⊥ holds at least for every active context c ∈ C+, and si
corresponding to a valid interpretation of features siv γ
F.
Definition 6.2 (Valid Context Combinations for a Configuration State). Let cfm ⊆ FMC∪F be a context-feature model and γ
F ∈ Γcfm be a valid configuration of
the featuresF of FM.
The set of valid context combinations Ci for a configuration state si ∈ S is
characterized as follows
Ci={C+ ⊆C | ∀c ∈ C+ : si(c) > ⊥ ∧ siv γ
F},
with sirefining a given configuration γ
F of features.
Correspondingly,Ciconsists of a set of context combinations C+, which in turn
consists of a set of contexts. For example,Ci={{Home}, {Slow Network}, {Home,Slow
Network}} for the state sidepicted in Figure6.15.
The specification of a context-feature model cfm restricts the overall possibilities for a valid combination of contexts, e.g., with constraints between contexts and features θ, constraints between features ϕ, and constraints between contexts τ. Based on the previous definition of valid context combinations for a configuration state and the Notation 6.2 of limited context combinations the definition of all valid context combinations Ccfm for a context-feature model cfm is introduced. A
context combination C+ ⊆Ccfm is valid if a valid configuration γ ∈ ˆΓcfm exists, in
which every single context c ∈ C+ is active, γ(c) = t. Further, the notation for a limited combinatorial subset of all valid combinationsCkcfm that may contain up to k-context elements per combination is defined as follows.
Definition 6.3(Valid Combinatorial Context Combinations for cfm). With a given con- text-feature model cfm and a set of contextsC, the set of all valid context combina- tions C+ is denoted as follows.
R esour ce C onstraint R untime A d apt a tion
in which ˆΓcfm denotes the set of all valid configurations for cfm. Furthermore, the combinatorial subset
Ck
cfm ={C+ ∈Ccfm | k > |C+|}
denotes the set of valid k-wise combinations of contexts.
An incomplete state space has the disadvantage that a configuration state has to be derived on-demand if a contextual situation is not covered by a criterion used to reduce the state space. The next section, therefore, introduces the concept of a partial state to reduce the amount of reconfigurations by making a state more flexible w.r.t. contextual changes.