27.03.2014 Views

SEKE 2012 Proceedings - Knowledge Systems Institute

SEKE 2012 Proceedings - Knowledge Systems Institute

SEKE 2012 Proceedings - Knowledge Systems Institute

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

executing a continuous transition, it i s actually acting as a<br />

whole, which means the continuous updates of variables in the<br />

mode are described by the constraints contained in itself and<br />

all its active sub-modes.<br />

B. The Extension of HybridUML<br />

1) The Stereotype for Classes::Kernel::Expression<br />

In order to deal with varying number of CPS network<br />

members and properly express the co-evolution of all members,<br />

first-order function symbols are used to parameterize primitive<br />

state variables, for example, x(i) denotes the location of car i,<br />

and quantifiers and a type system are introduced to quantify<br />

over all objects of a given type, for example, ∀i:C, which<br />

represents all car members of type C. Correspondingly, an<br />

extension of Expression named QuantifiedExpression is<br />

introduced. Its Subclasses include QDifferentialExpression,<br />

such as ∀i:C!x(i)″=a(i), QAlgebraicExpression, such as<br />

∀i:C!x(i):=a, and QBooleanExpression, such as ∀i,j:C far(i,j),<br />

in which far(i,j) expresses a constraint.<br />

2) The Stereotype for Classes::Kernel::Constraint<br />

Corresponding to the extension of Expression, a Stereotype<br />

named QuantifiedConstraint for Constraint is given, endowing<br />

Constraints with quantified features. QuantifiedConstraint<br />

includes quantified differential constraints, which contain<br />

QDifferentialExpression instances expressing flow constraints,<br />

and quantified invariant constraints containing instances of<br />

type QBooleanExpression describing invariant constraints.<br />

3) The Stereotype for CommonBehaviors::Comunications::<br />

Signal<br />

To express the signal that new members emerge in CPS<br />

network, NewObjectSignal is introduced as an extension for<br />

Signal in UML. To express the type of the new member, a new<br />

attribute named agentType is added in each NewObjectSignal.<br />

4) The Stereotype for CommonBehaviors::Comunications::<br />

SignalEvent and ChangeEvent<br />

Corresponding to the extension of Signal, NewSignalEvent,<br />

a stereotype for SignalEvent, is introduced. A NewSignalEvent<br />

happens when a new member appears in the CPS network and<br />

it contains a NewObjectSignal instance inside. Considering the<br />

extension of Boolean expression, extending the ChangeEvent<br />

of UML becomes essential. As the profile of ChangeEvent, a<br />

QChangeEvent contains a QBooleanExpression representing<br />

the condition triggering events when it becomes true.<br />

5) The Stereotype for CommonBehaviors::Comunications::<br />

Trigger<br />

As only very limited event types are used in our paper, it<br />

becomes essential to restrict the event types that a Trigger<br />

contains. A profile of Trigger named ModeTrigger is proposed<br />

and the event types a ModeTrigger contains are confined to<br />

NewSignalEvent and QChangeEvent.<br />

6) The Stereotype for ModeUpdateActivity<br />

Due to the extension of algebraic expression,<br />

QUpdateActivity, a stereotype for ModeUpdateActivity, is<br />

given to d escribe discrete updates on variables of all CPS<br />

network members, and it c ontains a QAlgebraicExpression<br />

expressing discrete update behaviors.<br />

III.<br />

TOP-LEVEL MODE MODEL TO QHP CODE TRANSLATION<br />

A. Metamodel of Hierarchical Hybrid StateMachine-Mode<br />

Figure 1. Metamodel of Hierarchical Hybrid StateMachine-Mode<br />

Definition 1. (Mode) A Mode is a tuple: < VS:{DataType},<br />

SM:{Mode}, ES:{ModePseudostate}, XS:{ModePseudostate},<br />

T:{ModeTransition}, Cons:{Mode!Constraint}> [14] , where VS<br />

is the variable set, SM represents all sub-modes, ES represents<br />

all entry pseudostates, XS denotes all exit pseudostates, T<br />

represents all ModeTransition instances contained in the<br />

Mode’s region and Cons denotes all constraints contained in<br />

the Mode. A Mode without a parent Mode is called a top-level<br />

Mode and the one without sub-modes is called a leaf<br />

Mode.ModeTransition can be divided into t hree types:<br />

EntryTransition (s∈ES), InternalTransition (s∈XS SM , t∈ES SM ),<br />

ExitTransition (t∈XS). As for other element, see Figure 1.<br />

Figure 2. The Hierarchical Hybrid StateMachine-Mode model for DATS<br />

roundabout collision avoidance protocol<br />

Being a Hierarchical Hybrid StateMachine, an active toplevel<br />

Mode actually contains more than one active sub-modes<br />

inside. All such active Mode instances actually form a path<br />

starting from the top-level Mode down to the innermost active<br />

leaf Mode. Such a path is called a StateConfiguration. As<br />

shown in Figure 2, th e Mode path DATC:agree:entry:Circle<br />

forms a StateConfiguration when Circle is active.<br />

A Mode acquires control through an EntryStep seen as a<br />

path that starts from an entry pseudostate of the Mode to the<br />

entry pseudostate of the to-be-active innermost leaf Mode. As<br />

shown in Figure 2, ( init, t 1 , free) is the EntryStep of Mode<br />

DATC. A Mode relinquishes control via an ExitStep, which is<br />

a path starting from the exit pseudostate of the innermost<br />

active leaf Mode to an exit pseudostate of the Mode, for<br />

240

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!