Docsity

Assignment 3: Simulation of Stochastic DEVS | ECE 575, Assignments of Electrical and Electronics Engineering

Toggle sidebar
bg1
Class: ECE575 of Fall 2006
Lecturer: Moon Ho Hwang, Ph.D. (email: [email protected])
Assigned Date: 10/25/06
Due Date: 11:59 PM, 11/01/06
Homework 3: Simulation of Stochastic DEVS (40 pts)
1. Figure 1 shows the state transition diagram of an atomic Stochastic DEVS model for
smoking-addiction process. The state set is S = {N (Never-Smoker), I (Initiator), S (Self-stopper),
E (Experimenter), A (Addicted Smoker), Q (Quitter)}. In this model, all state transitions are
internal transitions. Each possibility of a state transition is denoted as a number on each arc in
Figure 1.
Let’s assume the initial age is 20. For the sake of simplicity, we assume ta(s)=1 year for all s in
S. Get the state at age 60 by run 40 times and collect each result of the final state.
Figure 1. Smoking Addiction Process
Submit source codes with the project file using ODEVS (code logic: 10 pts), as well as
the following reports (10 pts):
1) Each final state when age is 60 year old for each run (for 20 runs)
2) Calculate possibility P[X=s]=Ns/20 where Ns is the number of frequency that final state
is s in S={N,I,S,E,A,Q}.
Hint: We don’t have to simulate this example using real-time so let’s define ta(s)=0.1 sec in ODEVS. We
need to perform 40-times transition for a run. Thus simulation ending time should be 0.1*40=4 and we can
control it using pause_at 4.1. Then we can get the result of a simulation run by 4 seconds.
To determine the next stat according to each transition’s probability, we should use inverse transformation
of pmf (see Chapter 8 of Lecture Note).
N, ta(N) I, ta(I) E, ta(E)
S, ta(S) A, ta(A)
Q, ta(Q)
!oy1, 0.23
!oy2,
0.80
!oy4,
0.15
!oy1,
0.05
!oy1, 0.21
!oy4,
0.79
!oy4,
0.77
!oy4,
1.0
!oy4,
0.055
!oy4,
0.055
!oy3,
0.945
!oy3,
0.945
pf2

Partial preview of the text

Download Assignment 3: Simulation of Stochastic DEVS | ECE 575 and more Assignments Electrical and Electronics Engineering in PDF only on Docsity!

Class: ECE575 of Fall 2006

Lecturer: Moon Ho Hwang, Ph.D. (email: [email protected])

Assigned Date: 10/25/

Due Date: 11:59 PM, 11/01/

Homework 3: Simulation of Stochastic DEVS (40 pts)

1. Figure 1 shows the state transition diagram of an atomic Stochastic DEVS model for

smoking-addiction process. The state set is S = {N (Never-Smoker), I (Initiator), S (Self-stopper),

E (Experimenter), A (Addicted Smoker), Q (Quitter)}. In this model, all state transitions are

internal transitions. Each possibility of a state transition is denoted as a number on each arc in

Figure 1.

Let’s assume the initial age is 20. For the sake of simplicity, we assume ta(s)=1 year for all s in

S. Get the state at age 60 by run 40 times and collect each result of the final state.

Figure 1. Smoking Addiction Process

Submit source codes with the project file using ODEVS (code logic: 10 pts), as well as

the following reports (10 pts):

1) Each final state when age is 60 year old for each run (for 20 runs)

2) Calculate possibility P [ X = s ]= N s/20 where N s is the number of frequency that final state

is s in S= {N,I,S,E,A,Q}.

Hint: We don’t have to simulate this example using real-time so let’s define ta(s)=0.1 sec in ODEVS. We

need to perform 40-times transition for a run. Thus simulation ending time should be 0.1*40=4 and we can

control it using pause_at 4 .1. Then we can get the result of a simulation run by 4 seconds.

To determine the next stat according to each transition’s probability, we should use inverse transformation

of pmf (see Chapter 8 of Lecture Note).

N, ta(N) I, ta(I)^ E, ta(E)

S, ta(S) (^) A, ta(A)

Q, ta(Q)

!oy1, 0.

!oy2,

!oy4,

!oy1,

!oy1, 0.

!oy4,

!oy4,

!oy4,

!oy4,

!oy4,

!oy3,

!oy3,

  1. Consider the triangular pdf as shown in Figure 2. By using inverse transformation,

we want to generate its random variant X for the following U~U[0, 1]. (20 pts = 4 * 5

pts)

(a) U=0.2, (b) U=0.4, (c) U=0.6, (d) U=0.

Figure 2. Triangular pdf

Hint: Recall the inverse transformation procedure is (1) Make F(x) and (2) Make F

  • ( U ). See inverse

transformation for U[a,b] from U[0,1] in Chapter 8 of Lecture Note.

Thanks for doing your best!

(^1 )

1

x

f(x)