In theoretical computer science, DEVS is closed under coupling [Zeigper84] [ZPK00]. In other words, given a coupled DEVS model
N
M
N
M
M
Similar to behavior of atomic DEVS, behavior of the Coupled DEVS class is described depending on definition of the total state set and its handling as follows.
Given a coupled DEVS model
N=<X,Y,D,\{Mi\},Cxx,Cyx,Cyy,Select>
M=<X,Y,S,s0,ta,\deltaext,\deltaint,λ>
where
X
Y
S=\underset{i\inD} x Qi
Qi=\{(si,tei)|si\inSi,tei\in(T\cap[0,tai(si)])\}
i\inD
T=[0,infty)
s0=\underset{i\inD} x q0i
q0i=(s0i,0)
i\inD
ta:S → Tinfty
Tinfty=[0,infty]
s=(\ldots,(si,tei),\ldots)
ta(s)=min\{tai(si)-tei|i\inD\}.
\deltaext:Q x X → S
q=(s,te)
s=(\ldots,(si,tei),\ldots),te\in(T\cap[0,ta(s)])
x\inX
\deltaext(q,x)=s'=(\ldots,(si',tei'),\ldots)
where
(si',tei')=\begin{cases} (\deltaext(si,tei,xi),0)&if(x,xi)\inCxx\\ (si,tei)&otherwise. \end{cases}
Given the partial state
s=(\ldots,(si,tei),\ldots)\inS
IMM(s)=\{i\inD|tai(si)=ta(s)\}
i*\inD
i*=Select(IMM(s)).
\deltaint:S → S
s=(\ldots,(si,tei),\ldots)
\deltaint(s)=s'=(\ldots,(si',tei'),\ldots)
where
(si',tei')=\begin{cases} (\deltaint(si),0)&ifi=
*\\ (\delta | |
i | |
ext |
(si,tei,xi),0)&if
(λ | |
i* |
(s | |
i* |
),xi)\inCyx\\ (si,tei)&otherwise. \end{cases}
λ:S → Y\phi
s=(\ldots,(si,tei),\ldots)
λ(s)= \begin{cases}\phi&if
λ | |
i* |
(s | |
i* |
)=\phi\\ Cyy
(λ | |
i* |
(s | |
i* |
))&otherwise. \end{cases}
Given a coupled DEVS model
N=<X,Y,D,\{Mi\},Cxx,Cyx,Cyy,Select>
M=<X,Y,S,s0,ta,\deltaext,\deltaint,λ>
where
X
Y
S=\underset{i\inD} x Qi
Qi=\{(si,tsi,tei)|si\inSi,tsi\inTinfty,tei\in(T\cap[0,tsi])\}
i\inD
s0=\underset{i\inD} x q0i
q0i=(s0i,tai(s0i),0)
i\inD
ta:S → Tinfty
s=(\ldots,(si,tsi,tei),\ldots)
ta(s)=min\{tsi-tei|i\inD\}.
\deltaext:Q x X → S x \{0,1\}
q=(s,ts,te)
s=(\ldots,(si,tsi,tei),\ldots),ts\inTinfty,te\in(T\cap[0,ts])
x\inX
\deltaext(q,x)=((\ldots,(si',tsi',tei'),\ldots),b)
where
(si',tsi',tei')=\begin{cases} (si',tai(si'),0)&if(x,xi)\inCxx,\deltaext(si,tsi,tei,xi)=(si',1)\\ (si',tsi,tei)&if(x,xi)\inCxx,\deltaext(si,tsi,tei,xi)=(si',0)\\ (si,tsi,tei)&otherwise \end{cases}
and
b= \begin{cases} 1&if\existsi\inD:(x,xi)\inCxx,\deltaext(si,tsi,tei,xi)=(si',1)\\ 0&otherwise. \end{cases}
Given the partial state
s=(\ldots,(si,tsi,tei),\ldots)\inS
IMM(s)=\{i\inD|tsi-tei=ta(s)\}
i*\inD
i*=Select(IMM(s)).
\deltaint:S → S
s=(\ldots,(si,tsi,tei),\ldots)
\deltaint(s)=s'=(\ldots,(si',tsi',tei'),\ldots)
where
(si',tsi',tei')=\begin{cases} (si',tai(si'),0)&ifi=
*,\delta | |
i | |
int |
(si)=si',\\ (si',tai(si'),0)&if
(λ | |
i* |
(s | |
i* |
),xi)\inCyx,\deltaext(si,tsi,tei,xi)=(s',1)\\ (si',tsi,tei)&if
(λ | |
i* |
(s | |
i* |
),xi)\inCyx,\deltaext(si,tsi,tei,xi)=(s',0)\\ (si,tsi,tei)&otherwise. \end{cases}
λ:S → Y\phi
s=(\ldots,(si,tsi,tei),\ldots)
λ(s)= \begin{cases}\phi&if
λ | |
i* |
(s | |
i* |
)=\phi\\ Cyy
(λ | |
i* |
(s | |
i* |
))&otherwise. \end{cases}
Since in a coupled DEVS model with non-empty sub-components, i.e.,
|D|>0
q=(s,te)\inQ
s=(\ldots,(si,tei),\ldots)
\omega
\omega=\epsilon[t,
\Delta(q,\omega)=((\ldots,(si,tei+dt),\ldots),te+dt).
q=(s,ts,te)\inQ
s=(\ldots,(si,tsi,tei),\ldots)
\omega
\omega=\epsilon[t,
\Delta(q,\omega)=((\ldots,(si,tsi,tei+dt),\ldots),ts,te+dt).
Select(IMM(s))