Generating Behavioral Model of Coupled SP-DEVS



Moon Ho Hwang Dept. Electrical and Computer Engineering, Wayne State University, Detroit, MI, 48098 , USA [email protected] Keywords: Discrete Event System Specification(DEVS), Timed Behavior, Abstract Simulation, Behavior of Coupled DEVS

To provide quantitative analysis functionality as well as qualitative one, a class of DEVS, called schedule-preserved DEVS (SP-DEVS), has been designed such that it is able to have a set of finite states [5]. The main modification of the proposed DEVS is that the external state transition does not change its next schedule of internal state transition. This kind of restriction leads the DEVS to preserve the schedule so that the remaining times to the next schedule are invariant even if there are external inputs. Also, finiteness of the state space is guaranteed in the coupled DEVS so we can say that the class of DEVS is closed under coupling operation. Even though it has been proven that there exists an atomic SP-DEVS model behaving equivalently to a given SP-DEVS network [5], achieving the behavioral model is still an open problem. Thus this paper introduces an algorithm generating the behavior model based-on abstract simulation algorithms of two SP-DEVSs, atomic one and coupled one. To introduce a generating method of behavioral model from SP-DEVS networks, first we introduce SPDEVS in terms of two formalism, atomic SP-DEVS and coupled DEVS in Chapter 2. Then abstract simulation algorithms and the generating way of behavior of SP-DEVS networks are explained in Chanter 3. Chapter 4 illustrates the implementation of the algorithms and two experimental results. Conclusion and further research are summarized in Chapter 5.

Abstract This paper proposes a method generating the behavioral model of networks of schedule-preserved DEVSs. Even though it has been proven that there exists an atomic SP-DEVS model which has its finite state space and behaves equivalently to a given SP-DEVS network [5], the algorithm achieving the behavioral model is still an open problem. Thus this paper introduces an algorithm generating the behavioral model based-on abstract simulation algorithms of two SPDEVSs, atomic one and coupled one. Finally, performance of the proposed algorithm implemented in the C++ language is also illustrated with two examples in this paper.

1

Introduction

Discrete Event System Specification(DEVS) is a promising formalism for modelling and analysis of discrete event systems and especially it has been accepted as a powerful simulation model [11]. However, simulation is a generating way of one possible trace of system and sometimes repetition of simulation run is not enough to verify the whole behavior of the target system. Related to verification of DEVS in terms of behavior, the previous researches [2],[4],[6] have used the concept of untimed behavior in which times of event occurrences are ignored so the only thing considered is the order of event sequences. This might be enough to clarify the qualitative properties such as existence of deadlock and/or livelock. But the quantitative properties, for example, frequency of a certain event sequence within a time duration, cannot be verified in such an approach.

2

Schedule-Preserved DEVS

2.1

Atomic SP-DEVS

An atomic SP-DEVS specifies the dynamic behavior. Definition 1 (Atomic SP-DEVS) An model of SP-DEVS is a 9-tuple,

atomic

M =< X, Y, S, ta, δx , δτ , λ, S0 , SF >

∗ This work was partially supported by the Post-doctoral Fellowship Program of Korea Science & Engineering Foundation (KOSEF).

where, 90

ISBN: 1-56555-290-8

• X is a finite set of input events.

• The time base T = R≥0 ∪ {∞} (the set of nonnegative real numbers with infinity) .

• Y is a finite set of output events.

• The input (output) segments is the input (output) event segments, that is, XG = X(YG = Y ).

• S is a non-empty and finite states set. S can be partitioned into two sets: rescheduling states set Sτ whose states reschedule their remaining time, and continued scheduling states set Sc whose states preserve their remaining time. Relations between Sτ and Sc are Sτ ∩ Sc = ∅ and Sτ ∪ Sc = S.

• The set of allowable input segments Ω is the set of all timed input sequences over X, that is, Ω = ΩX = (T, X ∗ ) where X ∗ is the Kleene closure of X [3] which is a set of finite length of sequence over X. For example, if X = {a, b} then X ∗ = {², a, b, aa, ab, bb, aaa, aba, abb, . . .}.

• ta : S → Q+,∞ is the maximum sojourning time 0 to the next scheduled state where Q+,∞ denotes a 0 set of non-negative rational numbers with infinity.

• The states set Q is the total states set of M , that is, Q = {(s, r)|s ∈ S, 0 ≤ r ≤ ta(s)}

• δx : S × X → Sc is the external transition function.

• The total state transition trajectory ∆ : Q×ΩX → Q; For (s, r) ∈ Q, ω1 , ω2 ∈ ΩX and x ∈ X ² and t ∈ T , ∆((s, r), ω1 ) = ( δ((s, r), x) for ω1 = (x, t) (2) δ(∆((s, r), ω2 ), x) for ω1 = ω2 (x, t)

• δτ : S → Sτ is the internal transition function. • λ : S → Y ² is the internal output function where Y ² means Y ∪ {²}. • S0 ⊆ Sτ is a set of initial states.

• The total output function Λ : Q → Y ² is that for (s, r) ∈ Q then ( λ(s) for r = 0 (3) Λ(s, r) = ² otherwise

• SF ⊆ S is a set of acceptable states. Notice that δx δτ and λ are partial functions that are not defined as all values of each domain.1 Definition 2 (Behavior of atomic SP-DEVS) Given M =< X, Y, S, ta, δx , δτ , λ, S0 , SF >, the total states set Q = {(s, r)|s ∈ S, 0 ≤ r ≤ ta(s)} considers the remaining time r at s ∈ S. Based on the total state set, the state transition function δ : Q × X ² → Q is represented by two state transition functions: for (s, r) ∈ Q, x ∈ X ² , δ((s, r), x) = (s0 , r0 ) =   if x ∈ X ∧ δx (s, x) ⊥ (δx (s, x), r) (δτ (s), ta(δτ (s))) if x = ² ∧ r = 0 ∧ δτ (s) ⊥ (1)   (s, r) otherwise

2.2

SP-DEVS Network and Its Behavior

Definition 3 (Structure of SP-DEVS Network) A SP-DEVS network is a 7-tuple, N =< X, Y, C, Zxx , Zyx , Zyy , select > where • X(Y ) is the finite set of input (output) events.

Notice that the remaining time at the new state generated δx is preserved in SP-DEVS and the new state is a member of Sc . This is the reason why the DEVS is named as schedule-preserved. For describing the dynamics of SP-DEVS, we can use a general I/O system formalism [11]. Given M =< X, Y, S, ta, δx , δτ , λ, S0 , SF > is a SP-DEVS, then its dynamics is defined as follows.

• C = {Mi |Mi =< Xi , Yi , Si , tai , δxi , δτ i , λi , S0i , SF i >} is the finite set of sub-component SPDEVSs which can be atomic SP-DEVS or coupled SP-DEVS models. It is assumed that all of the leaf nodes are atomic SP-DEVS models and hierarchical depth to all leaf notes are finite. S • Zxx ⊆ X × Xi is the external input coupling

G =< T, XG , YG , Ω, Q, ∆, Λ >

Mi ∈C

relation.

where

S

• Zyx ⊆

1 In

this paper, for any partial function f (. . .), f (. . .) ⊥ denotes that f (. . .) is defined. For example, δx (s, x) ⊥ means that δx (s, x) is defined.

Mi ∈C

relation. 91

Yi ×

S

Xi is the internal coupling

Mi ∈C

ISBN: 1-56555-290-8

S

• Zyy =

Definition 5 Suppose that N =< X, Y, C, Zxx , Zyx , Zyy , select > is a SP-DEVS network and MN =< X, Y, S, ta, δx , δτ , λ, S0 , SF > is its global behavior. Let (si , ri ) ∈ Qi , Mi ∈ C. Then s = (. . . , (si , ri ), . . .), s0 = (. . . , (s0i , ri0 ), . . .) ∈ S, s is time-abstracted equivalent to s0 , denoted by s ∼ =t s0 , if ∀Mi ∈ C, si = s0i 0 0 and ri − r = ri − r where r = M inimum ri and

Yi → Y is the external output cou-

Mi ∈C

pling function. • select : 2C − ∅ → C is a tie-breaking function which is used to resolve the situation that there are more than one sub-models whose remaining times are identical.

Mi ∈C

Definition 4 (Behavior of SP-DEVS Network)

r0 = M inimum ri0 .

Given a SP-DEVS network, N =< X, Y, C, Zxx , Zyx , Zyy , select >, the global behavior of N called a coupled SP-DEVS model is

m m m m m MN =< X, Y, S m , tam , λm τ , δx , δτ , S0 , SF > is t ∼ said to be = time-abstracted from MN if S m = {s ∈ S|∀s0 ∈ S s.t. s ∼ =t s0 , ta(s) ≥ 0 m m ta(s )}. ta := ta|S m →Q+,∞ ; λτ = λ|S m →Y ² ; δxm = 0 δx |S m ×X ² →Scm where Scm = S m ∩ Sc ; δτm = δτ |S m →Sτm where Sτm = S m ∩ Sτ ; S0m = S0 ∩ S m , SFm = SF ∩ S m

Mi ∈C

MN =< X, Y, S, ta, δx , δτ , λ, S0 , SF > where

Theorem 1 The behavior of a SP-DEVS network is equivalent to the atomic SP-DEVS model which is time-abstracted one. Proof of Theorem 1 [5]

• X(Y ) is the set of input events (output events) defined in N • S = {(. . . , (si , ri ), . . .)|(si , ri ) ∈ Qi , Mi ∈ C}.

3

• ta : S → Q0+,∞ ; ta(s) = ta((. . . , (si , ri ), . . .)) = M inimum ri Mi ∈C

For getting the atomic SP-DEVS which is timeabstracted one from a SP-DEVS network, we use the concept of abstract simulation algorithm. The abstract simulation algorithms for atomic DEVS and couple DEVS have been proposed by [9] and [10] such that algorithms or controls can be described separately and independently from associated DEVS models or data. With same manner, this paper introduces two algorithms for simulation of each SP-DEVS.

Let the set of imminents, IM M (s) = {Mi |Mi ∈ C ∧ ri = ta(s)}. Imminents are the set of components that have minimum remaining time qi .r and Mi∗ = select(IM M (s)). • λ : S → Y ² is defined by λ((. . . , (si , ri ), . . .)) = Zyy (λi∗ (si∗ )). • δx : S × X → S is defined as follows. 0 0 δx ((. . . , (s( i , ri ), . . .), x) = (. . . , (si , ri ), . . .) where (δxi (si , xi ), ri ) if (x, xi ) ∈ Zxx (s0i , ri0 ) = (si , ri ) otherwise

3.1

Simulator of atomic SP-DEVS

Algorithm 1 illustrates a class, called Simulator, which is for abstract simulation of atomic SP-DEVS. Theorem 2 Algorithm 1 simulates behavior of atomic SP-DEVS M =< X, Y, S, ta, δτ , δx , λ, S0 , SF >. Proof of Theorem 2. Since SP-DEVS is a kind of DEVS and DEVS is time-invariant [11], SP-DEVS can be initialized anytime at t with initial state s0 ∈ S0 . So when the simulator receives the initialization message (s0 , t), state s is changed into s0 , remaining time r is updated as ta(s0 ), last-scheduled time tl is assigned by t, and next-scheduled time is scheduled as t + ta(s0 ) (see lines 6 to 10 of Algorithm 1). When current time t reaches to next-scheduled time tn, t should be equal to tn (if not, it is an error of bad synchronization). At that time, as mentioned in Definition 2, SP-DEVS generates output (y := λ(s)) and update its state according to internal state transition (s := δτ (s)), remaining time (r := ta(s)),

• δτ : S → S is defined as follows. δτ ((. . . , (si , ri ), . . .)) =

Generating the behavioral model from SP-DEVS networks

(. . . , (s0i , ri0 ), . . .)

where (s0i , ri0 ) =  (δτ i∗ (si∗ ), tai∗ (δτ i∗ (si∗ ))) if Mi = Mi∗  (δxi (si , xi ), ri ) if (λi∗ (si∗ ), xi ) ∈ Zyx   (si , ri ) otherwise • S0 = {(. . . , (si , tai (si )), . . .)|∀Mi ∈ C, si ∈ S0i }. • SF = {(. . . , (si , ri ), . . .)|∀Mi ∈ C, (si , ri ) ∈ QF i }. Unfortunately, the number of states in the behavior of a SP-DEVS network is infinite because its state consists of its sub-models’ total states. But fortunately, we can achieve the behaviorally equivalent model for every SP-DEVS network when applying time abstraction as follows. 92

ISBN: 1-56555-290-8

Algorithm 1 Simulator of Atomic SP-DEVS

gorithm 1). By contrast, r-message means roll-back so when the simulator receives r-message(s0 , r0 , tl0 , t), s, r, tl are updated by s0 , r0 , tl0 , respectively and tn is also assigned by tl + r (see lines 25 to 27).

SP-DEVS-Simulator 1 variables: 2 parent // parent coordinator 3 tl // time of last-scheduled time 4 tn // time of next-scheduled time 5 M =< X, Y, S, ta, δτ , δx , λ, S0 , SF > 6 when receive 0-message (s0 , t) 7 if s0 6∈ S0 8 ERROR: Invalid Input; 9 s ← s0 and r ← ta(s0 ); 10 tl ← t and tn ← t + ta(s0 ); 11 when receive *-message (∗, t) 12 if (t 6= tn) then 13 ERROR: Bad Synchronization 14 y ← λ(s); 15 send y-message (y, t) to parent s ← δτ (s) and r ← ta(s); 16 17 tl ← t and tn ← t + ta(s); 18 when receive x-message (x, t) 19 if not (tl ≤ t ≤ tn) then 20 ERROR: Bad Synchronization 21 s ← δx (s, x); 22 when receive s-message (s0 , r0 , tl0 , t) 23 s0 ← s and r0 ← tl + ta(s) − t; 24 tl0 ← tl; 25 when receive r-message (s0 , r0 , tl0 , t) 26 s ← s0 and r ← r0 ; 27 tl ← tl0 and tn ← t + r; End SP-DEVS-Simulator

3.2

Coordinator of Coupled SP-DEVS

Algorithm 2 illustrates a class, called Coordinator, which is for abstract simulation of coupled SP-DEVS. Algorithm 2 Coordinator of Coupled SP-DEVS SP-DEVS-Coordinator 1 variables: 2 parent // parent coordinator 3 tl // time of last-scheduled time 4 tn // time of next-scheduled time 5 N =< X, Y, C, Zxx , Zyx , Zyy , select > 6 when receive 0-message ((. . . , (s0i ), . . .), t) 7 ∀Mi ∈ C 8 send 0-message(s0i , t) to simulatori 9 tl ← M ax {tli } and tn ← M in {tni }; Mi ∈C

Mi ∈C

Mi ∈C

Mi ∈C

Mi ∈C

Mi ∈C

Mi ∈C

Mi ∈C

10 when receive *-message (*, t) 11 if (t 6= tn) then 12 ERROR: Bad Synchronization 13 Mi∗ ← select{Mi |tni = tn} 14 send *-message(*,t) to simulatori∗ 15 tl ← M ax {tli } and tn ← M in {tni }; 16 when receive x-message (x, t) 17 if not (tl ≤ t ≤ tn) then 18 ERROR: Bad Synchronization 19 ∀Mi ∈ {Mj |Zxx (x, xMj )} 20 send x-message(xMi , t) to simulatori 21 when receive y-message (yd , t) 22 if Zyy (yd ) = 6 ² then 23 send y-message(Zyy (yd ), t) to parent 24 ∀Mi ∈ {Mj |Zyx (yd , xMj )} 25 send x-message(xMi , t) to simulatori 26 tl ← M ax {tli } and tn ← M in {tni };

last-scheduled time (tl := t) and next-scheduled time (tn := t + ta(s)) (see lines 11 to 17). When external event x arrives to the simulator at time t, time t should be in the range [tl, tn]. If not, it is another synchronization error. And if time t is valid, the only thing happens is updating its state using the external transition function (s := δx (s, x))(see lines 18 to 21). Recall that we don’t need to update timerelated variables such as r, tl and tn because that SPDEVS preserves its schedule from an external input event (see Definition 2). Since functions related to 0-message, *-message and x-message describe all possible behavior in the time horizon, SP-DEVS-Simulator simulates the behavior of atomic SP-DEVS. ¥

27 when receive s-message ((. . . , (s0i , ri0 , tli0 ), . . .),t) 28 ∀Mi ∈ C 29 send s-message (s0i , ri0 , tli0 , t) to simulatori 30 when receive r-message ((. . . , (s0i , ri0 , tli0 ), . . .)) 31 ∀Mi ∈ C 32 send r-message (s0i , ri0 , tli0 ) to simulatori 33 tl ← M ax {tli } and tn ← M in {tni }; End SP-DEVS-Coordinator

Theorem 3 Algorithm 2 simulates the behavior of coupled SP-DEVS N =< Y, Y, C, Zxx , Zyx , Zyy , select >. Proof of Theorem 3. By definition of behavior of coupled SP-DEVS (see Definition 4), its state consists of states of sub-components such as (. . . , (si , ri ), . . .). So if we want to initialize N as (. . . , (si0 , tai (si0 )), . . .) at time t, we need to pass

And there are additional two types of messages, s-message and r-message, which are not directly associated with simulation of SP-DEVS but related to generating the behavior of SP-DEVS network. s-message means storage so when the simulator receives s-message(s0 , r0 , tl0 , t), the current state, the remaining time, and the last-scheduled time are stored into s0 , r0 and tl0 , respectively (see lines 22 to 24 in Al93

ISBN: 1-56555-290-8

and tli0 , respectively (see lines 27 to 29 in Algorithm 2). By contrast, when the coordinator receives r-message((. . . , (s0 , r0 , tl0 ), . . .), t), each state (s0i , ri0 ) of Mi ∈ C is updated by calling r-message(s0i , ri0 , tli0 ). The updating tl and tn are performed by assigning maximum and minimum value of tli and tni for all Mi ∈ C as their definitions (see lines 30 to 33).

(. . . , (si0 , . . .) and t (Here, tai (si0 ) is determined if si0 is given). Thus when the coordinator receives the initialization message ((. . . , (si0 , . . .), t), it should distributes 0-message(si , t) to its simulatori and it need to updates its latest-scheduled time and next-schedule time (see lines 6 to 9 of Algorithm 2). When current time t reaches to next-scheduled time tn, t should be equal to tn (if not, it is an error of bad synchronization). At that time, as mentioned in Definition 4, Mi∗ is selected among the imminent sub-components and *-message is sent to the simulator of Mi∗ . Recall that last-scheduled time tl should be equal to the most-recent last-scheduled time while next-scheduled time tn equal to the most-urgent nextscheduled time. Thus tl is updated as the maximum of tli and tn as the minimum of tni , for all Mi ∈ C, respectively (see lines 10 to 15). When external event x arrives to the simulator at time t, time t should be in the range [tl, tn]. If not, it is another synchronization error. And if time t is valid, the only thing happens is updating its state in SP-DEVS. To update the state of coupled SP-DEVS N by an external event x-message(x, t), we transmit (xMi , t) to each influenced sub-component Mi by using the external input coupling relation Zxx (x, xMi ) (see lines 16 to 20). Notice that we don’t need to update time-related variables such as tl and tn because that SP-DEVS preserves its schedule from an external input event (see Definition 2). When output event yd from Md ∈ C arrives to the coordinator at time t, by definition of λ in Definition 4, it should be translate Zyy (yd ) ∈ Y to outside if Zyy (yd ) 6= ². Thus line 22 of Algorithm 2 satisfies the output behavior of coupled SP-DEVS N . Moreover, for each Mi which is influenced by yd of Md in terms of internal coupling relation Zyx (yd , xMi ), we need to translate (xMi , t) to the simulator of Mi . We can see that lines 24 and 25 meet the state transition caused by internal coupling which can be originally caused when an internal event is scheduled (see the internal state transition of Definition 4). Since functions related to 0-message, *-message, x-message and y-message describe all possible behavior in the time horizon, SP-DEVS-Coordinator simulates the behavior of coupled SP-DEVS. ¥

3.3

Generating Behavior of SP-DEVS Network

Based-on the abstract simulation algorithms of SPDEVS, we can generate the behavioral model of a given SP-DEVS network. The model generated to be behaviorally equivalent to the SP-DEVS network is the time-abstracted atomic SP-DEVS defined in Definition 5. Algorithm 3 introduces a class generating the behavioral model of a SP-DEVS network. The main function is make_behavior and two subsidiary functions are update_states and when_receive_y-message. Following theorem proves that class SP-DEVS-Behavior-Generator makes the behavior model. Theorem 4 make_behavior of Algorithm 3 genm erates the time-abstracted SP-DEVS MN =< m m m m m m m X, Y, S , ta , λτ , δx , δτ , S0 , SF > of coupled SPDEVS N =< X, Y, C, Zxx , Zxy , Zyy , select >. Proof of Theorem 4. By Definition 5, if s = (. . . , (si , ri ), . . .), s0 = (. . . , (s0i , ri0 ), . . .) ∈ S m then s ∼ 6 t s0 . In other words, ∀Mi ∈ C, si 6= s0i or = ri − r 6= ri0 − r0 where r = M in ri and r0 = M in ri0 . Mi ∈C

Mi ∈C

Let’s check times which are considered to be associated with s ∈ S m . For initial states, we don’t need to apply all varying time t ∈ R≥0 ∪{∞} but only 0 because SP-DEVS is time invariant (line 8 in Algorithm 3). For state s0 generated by internal state transition of s, by Definition of 2 and 4, current time t should be equal to next-scheduled time tn (line 16). Even though state s0 generated by external state transition of s and x can occurs at time t ∈ [tl, tn], since all next schedules are preserved in SP-DEVS, if s0 = δx (s, x) at t0 ∈ [tl, tn] and s00 = δx (s, x) at t00 ∈ [tl, tn], then s0 ∼ =t s00 . Thus we don’t need to generate s0 = δx (s, x) at all t ∈ [tl, tn] but only at t = tl (line 23). Every time we need to roll-back the state of N as (. . . , (si , ri , tli ), . . .), we should send r-message to the coordinator of N . These cases are before sending *-message and x-message (line 13, 21, respectively). After initial state generation, internal state transition, or externa state transition are performed (line 8, 13, and 23, respectively), called is update_states (line 9, 17 and 24) in which the total state information

Similar to Simulator of atomic SP-DEVS, two more functions of Coordinator are defined for storage and roll-back, which are related to generating the behavioral model from SP-DEVS network. When the simulator receives s-message((. . . , (s0 , r0 , tl0 ), . . .), t), the current state, the remaining time, and the lastscheduled time of Mi ∈ C are stored into s0i , ri0 94

ISBN: 1-56555-290-8

Algorithm 3 Generating Behavior of SP-DEVS Network SP-DEVS-Behavior-Generator 1 variables: 2 N =< X, Y, C, Zxx , Zyx , Zyy , select >; 3 child // Coordinator of N ; 4 make behavior() 5 M =< X, Y, S, ta, δτ , δx , λ, S0 , SF >; 7 ∀Mi ∈ C, ∀si0 ∈ Si0 6 B // a set of (. . . , (si , ri , tli ), . . .) 8 send 0-message((. . . , (si0 ), . . . ), 0) to child; 9 update states(M, B, (. . . , (si0 , tai (si0 ), 0), . . .),0) 10 add (. . . , (si0 , tai (si0 )), . . .) to S0 ; 11 while(|B| > 0) 12 (. . . , (si , ri , tli ), . . .) ← B.pop front(); 13 send r-message((. . . , (si , ri , tli ), . . .)) to child; 14 tn = child’s tn; 15 if tn 6= ∞ then 16 send *-message (*, tn) to child; 17 update states(M, B, (. . . , (s0i , ri0 , tli0 ), . . .), tn); 18 δτ ((. . . , (si , ri ), . . .)) ← (. . . , (s0i , ri0 ), . . .); 19 λ((. . . , (si , ri ), . . .)) ← y; 20 ∀x ∈ X then 21 send r-message((. . . , (si , ri , tli ), . . .)) to child; 22 tl = child’s tl; 23 send x-message (x, tl) to child; 24 update states(M, B, (. . . , (s0i , ri0 , tli0 ), . . . , ), tl); 25 δx ((. . . , (si , ri ), . . .), x) ← (. . . , (s0i , ri0 ), . . .); 26 return M ; 27 update states(M, B, (. . . , (si , ri , tli ), . . . , ), t) 28 send s-message((. . . , (si , ri , tli ), . . . )),t) to child; 29 if (. . . , (si , ri ), . . .) 6∈ S then 30 add (. . . , (si , ri ), . . .) to S; 31 if ∀Mi ∈ C, si ∈ SFi then 32 add (. . . , (si , ri ), . . .) to SF ; 33 add (. . . , (si , ri , tli ), . . .) to B; 34 when receive y-message (yd , t) 35 y ← Zyy (yd ); End SP-DEVS-Behavior-Generator

(. . . , (si , ri , tli ), . . .) is stored by sending s-message (line 28). Moreover, if state (. . . , (si , ri ), . . .) is newly generated, that is, (. . . , (si , ri ), . . .) 6∈ S (line 29) then (. . . , (si , ri ), . . .) is added to S (line 30) and if all si ∈ SiF then (. . . , (si , ri ), . . .) should be also an element of SF by Definition 4 (line 31 and 32). Finally, we store (. . . , (si , ri , tli ), . . .) into B in order to rollback to the newly-registered state (line 33). After generating (. . . , (s0i , ri0 ), . . .) from (. . . , (si , ri ), . . .) by internal state transition, relations δτ ((. . . , (si , ri ), . . .)) := (. . . , (s0i , ri0 ), . . .) and λ((. . . , (si , ri ), . . .)) := y are generated in M (line 18 and 19, respectively). Here y is calculated in when receive y-message(yd , t) (line 34 and 35), which can be called by a child simulator of coordina-

tor of N when *-message is sent to child (see when receive *-message of Simulator and Coordinator). Similarly, after generating (. . . , (s0i , ri0 ), . . .) from (. . . , (si , ri ), . . .) by external state transition of x, relations δx ((. . . , (si , ri ), . . .), x) := (. . . , (s0i , ri0 ), . . .) is constructed in M (line 25). Let’s check that make_behavior is terminated. Since this state tracing is performed from each distinguished initial states (. . . , si0 , . . .) for all Mi ∈ C and for all si0 ∈ Si0 (line 7) and |S0 | = |{(. . . , si0 , . . .)|Mi ∈ C, si0 ∈ Si0 }| is finite because |Si0 | is finite, the number Q of tracings from each initial state is bounded to |Si0 |. Inside of tracing Mi ∈C

loop, there is another loop for tracing from a newlygenerated state from line 11 to 25. By Lemma 2 ofQ[5], the P number of state |S| of M+ is bounded to ( c(si )) where c : Si → Q0 such that for

Mi ∈C si ∈Si

si ∈ Si ,

  if tai (si ) = 0 1 c(si ) = 1 if tai (si ) = ∞   tai (si )/g + 1 otherwise

and g ∈ Q+ divisor such that 0 is the greatest common S Si where nsi ∈ N+ g ∗ nsi = tai (si ) for all si ∈ 0 Mi ∈C

(non-negative natural numbers). the state P Q Therefore, c(si ))). ¥ ( tracing is terminated with O( Mi ∈C si ∈Si

4

Implementation and Experiments

4.1

Implementation

To implement the environment of modeling, simulation(execution) and formal verification of SP-DEVS, we used the C++ programming language [8]. In particular, for the basic data structure such as vector, list, ordered set, map, multi-map, hash and so on, we used standard template library (STL) [1]. And we implemented it with Microsoft VC++.Net [7].

4.2

Experimental Results

Our hardware platform was Presario, X1000, Compaq with 1 GHz Intel centrinoTM CPU and 1 GByte RAM. Using the machine, we tested two examples to see performance of generating behavior for each case. 4.2.1

Cross-road Traffic Light

Figure 1 shows one example of cross-road traffic system in which there are two atomic SP-DEVS models, green light (G) and walk light (W ), are connected each other. To evaluate the generated number of states and transition (edges) as the response time of W and G 95

ISBN: 1-56555-290-8

Figure 1: SP-DEVS Network for Cross Road Circles denote states(solid: s ∈ Sτ and dashed: s ∈ Sc ), double circles indicate acceptable states, a number inside a state s is ta(s), arcs are state transitions(solid: internal, dashed: external) with ?(!) which indicates an input (output) event.

Figure 2: |S| and |E| in Traffic-Light Behavior Table 2: Generating Machining Center Behavior QP

TableQ1:PGenerating Traffic-Light Behavior

1/ta(s)

c(si )

|S|

|E|

Time

Mem.

1 10 100 1000

7.963E+3 2.015E+5 2.015E+7 2.015E+9

100 691 6316 62556

131 993 9318 92568

3.E-5 2.E-4 2.E+0 3.E+1

20.3 38.8 1397.3 13870.8

c(si )

|S|

|E|

Time

Mem.

1 5 10 20

702000 40625712 1572655392 33578883072

3877 33053 102058 348518

6130 48606 145036 482346

3 31 149 975

903.7 7294.8 21959.3 73539.8

we evaluate the performance of its behavior generation as varying time advance values of some states. In Figure 3, circles with ta(s) denotes the set of states whose ta(s) varies in this test. Table 2 summarizes the results of test varying 1/ta(s) as 1, 5, 10 and 20. All convention and units are the same as the cross-road traffic system. In this experiment, we can see that the changing trend of |S| and |E| are more drastical than linear as shown in Figure 4.

are changed, we try to increas the scanning speed of d and r of W and G, respectively. Let’s speed up the scanning time of d of W and r of G as 10 times (0.1 time unit), 100 times (0.01), 1000 times (0.001), respectively. Table 1 illustrates the experimental results of generatingQbehavior of cross-road system. In the P Q traffic P table, c(si ) means c(si ) and units of Mi ∈C si ∈Si

time and memory (Mem.) required in the computation are second and KByte, respectively. Time and memory required are proportional to the number of states |S| and the number of state transitions |E|. Figure 2 shows graphs of |S| and |E| according to 1/ta(s) and they look linear lines.

4.2.2

1/ta(s)

5

Conclusion and Further Research

Given a SP-DEVS network, to show that we can achieve the time-abstracted atomic SP-DEVS behaving equivalently to a given network model, we first introduced the abstract simulation algorithms for atomic and coupled SP-DEVSs, respectively. And based on those algorithm, we provided one generating algorithm of an atomic SP-DEVS from a coupled SPDEVS, which guarantees that the generated atomic model is the time-abstracted SP-DEVS from the given SP-DEVS network. However, Q P the complexity of generating model is O( ( c(si ))) which is exponential with the

Machining Center

Let’s consider a machining center which consists of an input buffer, a working table, an output buffer, and a controller. Between the input buffer and the working table as well as the working table and the output buffer, there are material flows in which time delay exist. Figure 3 shows a SP-DEVS network for the machining center. Like in the cross-road traffic system,

Mi ∈C si ∈Si

number of model and its states. Thus efficient state minimization and symbolic analysis can be further di96

ISBN: 1-56555-290-8

Figure 4: |S| and |E| in Machining Center Behavior Simulation Conference, pages 173–178, San Jose, CA, 2004. SCS. [6] Tag G. Kim, S.M. Cho, and W.B. Lee. Framework for systems development: Unified specification for logical analysis, performance evaluation and implementation. In H.S. Sarjoughian and F.E. Cellier, editors, Discrete Event Modeling and Simulation Technologies, pages 131–166, New York, 2001. Springer-Verlag.

Figure 3: SP-DEVS Network for Machining Center rection for scalable application within this approach.

References

[7] Microsoft. Visual C++. Net. http://msdn.microsoft.com/visualc/, 2002.

[1] Silicon Graphics. Standard Template Library Programmer’s Guide. http://www.sgi.com/tech/stl, 1993-2004.

[8] Bjarne Stroustrup. The C++ Programming Language. Addison Wesley, New York, third edition, 2002.

[2] G.P. Hong and T.G. Kim. A framework for verifying discrete event models whithin a devs-based system development methodology. Transactions of The Society for Computer Simulation, 13:19– 34, 1996.

[9] B.P. Zeigler. Multifacetted Modeling and Discrete Event Simulation. Academic Presse, London,Orlando, first edition, 1984.

[3] J.E. Hopcroft, R. Motwani, and J.D. Ullman. Introduction to Automata Theory, Languages, and Computation. Addison Wesley, second edition, 2000.

[10] B.P. Zeigler. Hierarchical, modular discreteevent modelling in an object-oriented environment. SIMULATION, 49(5):219–230, 1987. [11] B.P. Zeigler, H.Praehofer, and T.G. Kim. Theory of Modelling and Simulation: Integrating Discrete Event and Continuous Complex Dynamic Systems. Academic Press, London, second edition, 2000.

[4] M.H. Hwang. Identifying equivalence of devss: Language approach. In In A. Bruzzone and M. Itmi, editors, Proceedings of 2003 Summer Computer Simulation Conference, pages 319–324, Montreal, Canada, 2003. SCS. [5] M.H. Hwang and S.K. Cho. Timed analysis of schedule preserved devs. In A.G. Bruzzone and E. Williams, editors, 2004 Summer Computer 97

ISBN: 1-56555-290-8

Generating Behavioral Model of Coupled SP-DEVS

Our hardware platform was Presario, X1000, Com- paq with 1 GHz Intel centrinoTM CPU and 1 .... Systems. Academic Press, London, second edi- tion, 2000. 97.

481KB Sizes 1 Downloads 223 Views

Recommend Documents

Generating Behavioral Model of Coupled SP-DEVS
considers the remaining time r at s ∈ S. Based on the total state set, the state transition ..... Programmer's Guide. http://www.sgi.com/tech/stl. [Zeigler et al., 2000] ...

Generating Behavioral Model of Coupled SP-DEVS
troduction to Automata Theory, Languages, and. Computation. Addison Wesley, second edition,. 2000. [4] M.H. Hwang. Identifying equivalence of devss:.

a model for generating learning objects from digital ...
7.2.9 Tools for generating Learning Objects. ....................................................... ... 9 Schedule of activities . ..... ones: Collaborative Notebook (Edelson et. al. 1995) ...

Coupled Snakelet Model for Curled Textline ...
using coupled snakes and external energies of neighboring ... Figure 1: Curled textline definition .... on the data set used in the CBDAR 2007 document image.

a model for generating learning objects from digital ...
In e-Learning and CSCL there is the necessity to develop technological tools that promote .... generating flexible, adaptable, open and personalized learning objects based on digital ... The languages for the structuring of data based on the Web. ...

A Simple Stochastic Model for Generating Broken ...
Jan 5, 2009 - cloud-top height retrieved from the Moderate Resolution Imaging Spectroradiometer (MODIS). .... data. Schmidt et al. (2007) used cloud fields simulated by the last ..... President's program Leading Scientific Schools (Grant.

Electricity Generating
Dec 4, 2017 - จากการไม่มีก าลังการผลิตใหม่ๆในปี 2561 การเติบโตก าไรของ. บริษัทจึงไม่น่าตื่นเต้นมากนà

Electricity Generating - Settrade
Mar 6, 2018 - Hong Kong. 41/F CentralPlaza, 18 Harbour Road, Wanchai, Hong Kong ... KGI policy and/or applicable law regulations preclude certain types ...

Distribution of Networks Generating and Coordinating Locomotor ...
Distribution of Networks Generating and Coordinating Locomotor. Activity in the Neonatal Rat Spinal Cord In Vitro: A Lesion Study. Ole Kjaerulff and Ole Kiehn.

Automatica Synchronization of coupled harmonic ...
Jul 26, 2009 - virtual leader, one of the followers should have the information of the virtual leader in a fixed network (Ren, 2008b). Stimulated by Reynolds' model (Reynolds, 1987), flocking algorithms have been proposed by combining a local artific

Magnetism in systems of exchange coupled nanograins
plane, z− neighbours in plane i − 1 and z+ neighbours in ..... cent study on Nd2Fe14B/α-Fe nanocomposite materials,. Lewis and ... Such domain wall widths are ...

Magnetism in systems of exchange coupled nanograins
magnets [1] or ultra soft FeBSiCu alloys [2], which ... The molecular field Bi acting on atom i is ex- ... The (µi)T 's and Bi's can be calculated self-consistently.

Generating Wealth Through Inventions
Oct 28, 2016 - Office, intellectual property-based businesses and entrepreneurs drive ... trademark cancellations and domain name disputes; and preparing ...

Generating Wealth Through Inventions
Oct 28, 2016 - new business model for businesses that cannot realistically compete, or that do not wish to ... A patent creates a legal barrier preventing entry into the technology segment it defines. ... barrier to entry provides many benefits:.

Generating Decompilers
It is of utility in the validation or verification of code in safety- ... 23:diff. 24:eqc(0). 25:ldl(5). 26:and. nop. 28:cj(9). 29:ldc(-2). nop. 31:stl(0). 32:ldlp(0). 33:ldc(2).

Impact of transfer of Employment generating technologies ... - Chennai
Abstract: Various employment generating technologies like mushroom cultivation, fruits and vegetable preservation and preparation of home made products ...

Impact of transfer of Employment generating technologies on ...
employment-generating technologies were able to earn an income of Rs.750/- and ... in India cannot be accomplished through anti- .... The educational level.

Generating Google™ maps - Mark McClure
complete information is presented at the Google Maps™ API reference [2]. ... and display a Google map: an HTML file for the webpage and a javascript file that ...

Design and modeling of waveguide-coupled microring ...
E-mail address: [email protected] (A. Belarouci). 0022-2313/01/$ - see front ... mainly due to extrinsic bulk and surface scattering. Surface scattering is ...