Biomedical Engineering Reference
In-Depth Information
event function executes and any guard of this event is
false
, then this function
returns
false
to indicate that this event function is not executed.
/
∗
In the
'
C
'
Language
∗
/
/
∗
In the Java language
∗
/
private boolean EventFun
()
{
if (Cond
1
)
{
if (Cond
2
)
{
...
Assignment Expr.
...
BOOL EventFun
()
{
if (Cond
1
)
{
if (Cond
2
)
{
...
Assignment Expr.
...
return TRUE
;
return true
;
}
}
}
}
return FALSE
;
return false
;
}
}
∪
∩
\
) in the action predicate is also func-
tion of two arguments similar to the guards predicates, which use some inter-
mediate steps according to the C++, Java and C# programming languages. The
translation of set based expression is translated as follows in the action's part:
Set expression
: The set operators (
,
,
/
∗
In the
'
C
++'
Language
∗
/
BOOL SetFun
()
{
...
set < int > tset
4
;
set
_
union(A.begin(), A.end(), B.begin(), B.end(),
inserter(tset
4
, tset
4
.begin()))
;
C.clear()
;
/
∗
clear data of assignee set C
∗
/
C
=
tset
4
;
/
∗
Transfer all sets elements into C
∗
/
.
EVENT SetFun
...
WHEN
...
THEN
act1
/
∗
In the Java language
∗
/
private boolean SetFun
()
{
...
C.clear()
//clear data of assignee set C
//Transfer all sets elements into C
C
;
:
C
:=
A
∪
B
.
=
unionSet(A, B)
;
.
/
∗
In the C
#
language
∗
/
private boolean SetFun
()
{
...
C.clear()
;
//clear data of assignee set C
//Transfer all sets elements into C
C
=
A.UnionWith(B)
;
.
Search WWH ::
Custom Search