• No results found

Presentation schedule generation

In document Mobile Multimodal User Interfaces. (Page 104-108)

3 UIAF system design

3.3 Use case design

4.2.3 Presentation schedule generation

As mentioned in the section before, the presentation schedule as input for the decision process needs to be calculated from the presentation description tree structure. At the end of the presentation schedule generation each media must have its position in the presentation schedule assigned. This relates to interaction sequence step 3. This section starts with the definition of the tree, its nodes (media item, <par/>, <seq/>), related node sets and their basic characteristics. So be:

N : set of tree nodes in the presentation description tree S : set of sequence nodes (<seq/>)

p : set of parallel nodes (<par/>)

C : set of content nodes (media items) Then it is assumed that:

S , P , Cœ N

\ f c G C ,c = leafn ode

\/s E S ^ f p e P . s , p = in te r n a ljn o d e

Leaf nodes and internal nodes are structural elements in a tree structure. The construction of the presentation schedule is based on a self defined recursive algorithm for a given presentation description tree. During the algorithm tree traversal is performed using a specific pattern. The nature of the <seq/> element indicates that the first content node of a sub-tree is first in a sequence. Consequently the traversal into the tree structure is performed with a left orientation. That means left sub-tress will be visited first during recursion.

Typical to recursion, the algorithm consists of breaking conditions, the calculation of initial schedule values for each content node, and calculation of final schedule values for each content node. The calculation of initial values is performed by the algorithm when traversing down in the tree, while the calculation of final values is performed when reversing. For internal nodes (s, p) temporary values are calculated, supporting the calculation of the presentation schedule position of the content nodes. They are not appearing in the final presentation schedule anymore. The definitions used for the algorithm functions (AFs) are introduced in Table 6.

Function number

Function name Function description

(AF-1) p o s itio n ( n) Defines the (%,y) position of a tree node n e in the presentation schedule and temporary position values for

U e S , P as shown in Figure 25. % denotes time dependency and y denotes the parallel relationship as described earlier. (AF-2) isChildij\,n2) Defines that n^E N is the child node of Mg E 5", f ,

whereas Mj can be an internal or leaf node, can only be an internal node.

(AF-3) isfirstChUd («i, ^ ) Defines that M^E A^is the left most or first child node of Mg G S , P .

(AF-4) isLastChild{i\,ri2) Defines that MjG A^is the right most or last child node of

MgG .

(AF-5) p il(n ) Every internal node has two or more child nodes. p iK jl) defines the position of these child nodes in counting their position from left to right. E.g., a sequence node has two content child nodes, then for the first content node

p i l {co n ten t 1) = 1 and for the second content node

p i l (c o n te n t!) = 2 .

(AF-6) isLeftNei^bomifi]^, Mg ) Defines that n^E N is the left neighbour of MgE A^. (A link to the AF-4 function is given right below the table)

(AF-7) x P o sitio n (n) Defines the x position of a tree node n e N in the presentation schedule and temporary position. values for

HE S , P as shown in Figure 25.

(AF-8) y Position (n) Defines the y position of a tree node n e N in the presentation schedule and parallel relationship values for

UE S ,P as shown in Figure 25.

(AF-9) hasHighest X ( N ) Defines the highest x position in a set of tree nodes. (AF-10) hasHighest Y ( N ) Defines the highest y position in a set of tree nodes.

Table 6: Algorithm functions (AFs)

In order to clarify the (AF-5) isLeftNeig hbour (w^/îj) relation, the following definition based on the (AF-4) pil (n) is given in (0):

\/j\,r i2 e N . p i l ( j \ ) < pil(n2) A \ p il( n ^ ) - p il( n 2 ) \= l- ^ isLeftNeighbour(j\ , yzg ) (0)

With the given algorithm functions (AF), a detailed algorithm is provided and explained in the following. The recursion is starting with the highest tree node, typically a sequence node (<seq/> element). The recursive function for the calculation of the media items schedule positions is defined as (1):

traverseTr ee(internal _ node) (1)

If the function is entered the first time, the position of the given internal node is set to its default

position (internal_node) = (0, 0). Then the function fetches the list of child nodes of the given

internal node. This list itself can contain leaf nodes (therefore content nodes) or internal nodes. Independent from its type, the leftmost child node for each sequence or parallel node is assigned its initial position, being the position of its parent internal node.

This is described in (2) using AF-3 and AF-1 :

Vf E 5,P.V m g N isFirstC hi ld(n,i) position (n) = position (i) (2)

In the next step the algorithm iterates over the list of child nodes. The right node of two nodes, starting from the first node, is assigned its position based on its left neighbour. This is dependent on the parent node being a <seq/> or <par/> node. For the child nodes of a <seq/> node, 3.1 and 3.2 apply using AF-2, AF-6, AF-9 and AF-10:

G 5.Vmj 2 isC hild (Mj , 5) a isChild(«2,5) a

isLeftNeighbour(n^,n2) xPosition(n2) = xPosition(n^) + 1

\ / s G SX/n^ 2-isChild(n^,s) a isC hild(« 2, s) a

isLeftNeighbour(n^ ,^2) —> yPosition(n2 ) = yPosition(n^ )

The x-position implies a time wise dependency. Logically, this means that content nodes in the list following other content nodes are placed later in the schedule. Therefore a content element with a left neighbour takes this neighbours position plus one additional position (see 3.1). The y- position stays the same, since all media items are part of the same sequence and are played one after each other, but not in parallel (see 3.2). Analogue to the previous <seq/> node definition, for the child nodes of the <par/> nodes the following applies:

V/7 G P.Vmi 2.isChild (n^, p) a isChild (n2,p ) a

\fp G P.Vm^ 2 -isChild {n^, p ) a isChild («2 ^ p ) a

isLeftNeig hbour (n^, «2 ) —> xPosition (^ 2 ) = xPosition (Mj )

In difference to <seq/> nodes, the y-position takes an increment of one, since this depicts the parallel relationship in the presentation schedule (see 4.1), Contrary, the x-position is the same (see 4.2) compared to the left content node.

The final node position calculation for neighbouring nodes is done when the left neighbour has its final position value assigned. Therefore in the case of sequence and parallel child nodes being the left neighbours, their sub tree is entered first, in order to calculate final values of the neighbouring node. This is the step when the next recursion step is entered, by calling the recursion function (1) repeating the steps explained until here. Base breaking conditions define the end of each recursion. Their concluding calculations are explained in the following.

Three base condition cases have been identified. In case one, the deepest level of the recursion is reached, this is when the internal <seq/> and <par/> nodes are provided to the recursion function (1) and only have child content nodes. Then the value of this internal node is calculated as in (5) using AF-1 and AF-4:

V /g P ,5 .V c e C.isLastChild{cft)

p o sitio rii) = p o sitio ric)

This means that the final position of the internal node is calculated, by taking the position of the last child node in the list, and assigns its own position. At that point a breaking condition of the recursion function is reached and the final value calculation continues one hierarchy level up in the recursion. This is where cases two and three apply. Case two defines the end value calculation for a <par/> node containing content and <seq/> child nodes as shown in 6.1 and 6.2, using AF- 2, AF-4, AF-7, AF-8 and AF-9:

VpG P .\/s e S.isC hild(s, p ) A h a sH ig h esK (S ) —> x P o sitio ft p ) = x P o sitio fts)

VpG P.3mg N .isLastChild(n, p )

For the calculation of the x-position, the highest x-position of all sequence child nodes is taken. This ensures that the x-position values calculated for the <seq/> nodes are delivered for further calculations in the higher hierarchy level. The concluding y-position is carried over from the last child node regardless of being a leaf (content) or internal (<seq/>) node. Case three is defined for calculating the end value for a <seq/> node having content and <par/> child nodes as shown in 7.1 and 7.2, using AF-2, AF-4, AF-7, AF-8 and AF-10:

V5 e 5.Vp e P .isC h ild (p , s) a hasH ighestY(P)

(7.1)

yP osition{s) - yP o sitio n ip )

Vj" e S B n e N.isChild(n, s) a isLastChild(n, s)

(7.2)

x P o sitio fts) = xPositiorifi)

In this calculation the highest y-position of <par/> child nodes is carried forward to the upper hierarchy level for the same reason as in the <seq/> calculation. The x-position is carried over from the last child node regardless of being a content or <seq/> node. Based on the definition of the presentation tree structure all base conditions have been taken into account and addressed accordingly in the calculation. This means the recursion is deterministic for presentation description trees, which fulfil the definition as provided in the beginning of this section. The result is the presentation schedule as shown in Figure 25. Since at the final instance only the schedule positions of content nodes are needed, the end values of the internal <seq/> and <par/> are not of particular interest, although they provide an interesting characteristic. The (x, y) coordinates of the highest <seq/> element for example defines the maximum span of parallel contents and the overall length of the presentation schedule sequence. An overall activity diagram for the presentation schedule generation can be found in annex A.2. With the prepared presentation schedule the next section continues with the preparation of the presentation schedule for the multimedia adaptation decision preparation.

In document Mobile Multimodal User Interfaces. (Page 104-108)