Discrete-Event Systems and Generalized Semi-Markov Processes - - PowerPoint PPT Presentation

discrete event systems and generalized semi markov
SMART_READER_LITE
LIVE PREVIEW

Discrete-Event Systems and Generalized Semi-Markov Processes - - PowerPoint PPT Presentation

Discrete-Event Systems and Generalized Semi-Markov Processes Reading: Section 1.4 in Shedler or Section 4.1 in Haas Peter J. Haas CS 590M: Simulation Spring Semester 2020 1 / 27 Discrete-Event Systems and Generalized Semi-Markov Processes


slide-1
SLIDE 1

Discrete-Event Systems and Generalized Semi-Markov Processes

Reading: Section 1.4 in Shedler or Section 4.1 in Haas Peter J. Haas CS 590M: Simulation Spring Semester 2020

1 / 27

slide-2
SLIDE 2

Discrete-Event Systems and Generalized Semi-Markov Processes Discrete-Event Stochastic Systems The GSMP Model Simulating GSMPs Generating Clock Readings: Inversion Method Markovian and Semi-Markovian GSMPs

2 / 27

slide-3
SLIDE 3

Discrete-Event Stochastic Systems

Stochastic state transitions occur at an increasing sequence

  • f random times

t X(t)

How to model underlying process

  • X(t) : t 0
  • ?

I Generalized semi-Markov processes (GSMPs) I Basic model of a discrete-event system

3 / 27

slide-4
SLIDE 4

GSMP Overview

I Events associated with a state “compete” to trigger next

state transition

I Each event has own distribution for determining the next state I New events

I Associated with new state but not old state, or I Associated with new state and just triggered state transition I Clock is set with time until event occurs (runs down to 0)

I Old events

I Associated with old and new states, did not trigger transition I Clock continues to run down

I Canceled events

I Associated with old state, but not new state I Clock reading is discarded

I Clocks can run down at state-dependent speeds

4 / 27

slide-5
SLIDE 5

Clock-Reading Plot

5 / 27

for

a given

clock

:

← cancellation

"

i

:*'

. eject occurs

slide-6
SLIDE 6

GSMP Building Blocks

I S: a (finite or countably infinite) set of states I E = {e1, e2, . . . , eM}: a finite set of events I E(s) ✓ E: the set of active events in state s 2 S I p(s0; s, E ⇤): probability that new state = s0 when events in E ⇤

simultaneously occur in s

I Write p(s0; s, e⇤) if E ⇤ = {e⇤} (unique trigger event)

I r(s, e): the nonnegative finite speed at which clock for e runs

down in state s

I Typically r(s, e) = 1 I Set r(s, e) = 0 to model “preempt resume” service discipline

I F( · ; s0, e0, s, E ⇤): cdf of new clock-reading for e0 after state

transition s

E ⇤

  • ! s0

I µ: initial distribution for state and clock readings

I Assume initial state s

D

⇠ ν and clock readings

D

⇠ F0( · ; e, s)

6 / 27

slide-7
SLIDE 7

New and Old Events

7 / 27

slide-8
SLIDE 8

Example: GI/G/1 Queue

  • Assume that interarrival-time dist’n Fa and service-time

dist’n Fs are continuous (no simult. event occurrences)

  • Assume that at time t = 0 a job arrives to an empty system

X(t) = # of jobs in service or waiting in queue at time t Can define (X(t) : t 0) as a GSMP:

I S = I E = I E(s) = I p: I F(x; s0, e0, s, e⇤) : I r(s, e) = I Initial dist’n:

8 / 27

{

, I , b

  • r - I

{ er, ed

e,

"

"arrival "

, ee "completion of service

sell it s

  • o; EG

e Sei

, en} if s> 0

plsti ; s

,e.)

  • I ,

pls

  • l; s, edel ,

pest; s

, e) =o otherwise

faux) if E's e,

and fix) ite

'
  • ez

I

for all

s

, e

VCD= I

, Wako Hs#

to

sea , s) : Falk)

  • f. ex;

I fix)

slide-9
SLIDE 9

A More Complex Example: Patrolling Repairman

See handout for details

I Provides an example of how to concisely express GSMP

building blocks Specifying a GSMP can be complex and time-consuming, so why do it?

I Direct guidance for coding (helps catch “corner cases”) I Communicates model at high level (vs poring through code) I Theory for GSMPs can help in establishing important

properties of the simulation

I Stability (i.e., convergence to steady state), so that

steady-state estimation problems are well defined

I Validity of specific simulation output-analysis methods, so that

estimates are correct

9 / 27

slide-10
SLIDE 10

GSMPs and GSSMCs

GSMP formally defined in terms of GSSMC

  • (Sn, Cn) : n 0
  • I Sn = state just after nth transition

I Cn = (Cn,1, Cn,2, . . . , Cn,M) = clock readings just after nth

transition

I See Haas or Shedler books for definition of P

  • (s, c), A
  • and µ

10 / 27

events

E

  • fei ,
  • u , en)
slide-11
SLIDE 11

GSMP Definition

Define

I Holding time: t⇤(s, c) = min{i:ei2E(s)} ci/r(s, ei) I nth state-transition time: ζn = Pn1 k=0 t⇤(s, c) I # of state transitions in [0, t]: N(t) = max{n 0 : ζn  t}

Let ∆ 62 S and set

X(t) = ( SN(t) if N(t) < 1; ∆ if N(t) = 1

11 / 27

clock

reading

for ei

I

slide-12
SLIDE 12

GSMP Definition in a Picture

ζ0 = 0 ζ1 S1 S0 S3 S2

t S C *( , ) t S C *( , )

1 1

t S C *( , )

2 2

ζ2 ζ3 ζ4 t

N t ( ) = 0 N t ( ) = 1 N t ( ) = 2 X t S ( ) = 3 N t ( ) = 3

t S C *( , )

3 3

12 / 27

= Such

slide-13
SLIDE 13

Discrete-Event Systems and Generalized Semi-Markov Processes Discrete-Event Stochastic Systems The GSMP Model Simulating GSMPs Generating Clock Readings: Inversion Method Markovian and Semi-Markovian GSMPs

13 / 27

slide-14
SLIDE 14

Sample Path Generation

GSMP Simulation Algorithm (Variable Time-Advance)

  • 1. (Initialization) Select s D

⇠ ν. For each ei 2 E(s) generate a clock reading ci

D

⇠ F0( · ; ei, s). Set ci = 0 for ei / 2 E(s).

  • 2. Determine holding time t⇤(s, c) and set of trigger events

E ⇤ = E ⇤(s, c) = {ei : ci/r(s, ei) = t⇤(s, c)}.

  • 3. Generate next state s0 D

⇠ p( · ; s, E ⇤).

  • 4. For each ei 2 N(s0; s, E ⇤), generate c0

i D

⇠ F( · ; s0, ei, s, E ⇤).

  • 5. For each ei 2 O(s0; s, E ⇤), set c

i = ci t⇤(s, c) r(s, ei).

  • 6. For each ei 2 (E(s) E ⇤) E(s0), set c0

i = 0

(i.e., cancel event ei).

  • 7. Set s = s0 and c = c0, and go to Step 2.

(Here c = (c1, c2, . . . , cM) and similarly for c0.)

14 / 27

slide-15
SLIDE 15

Sample Path Generation, Continued

Algorithm generates sequence of states (Sn : n 0), clock-reading vectors (Cn : n 0), and holding times

  • t⇤(Sn, Cn) : n 0
  • Transition times (ζn : n 0) and continuous-time process
  • X(n) : n 0
  • computed as described previously

Use usual techniques to estimate quantities like E ⇥ f

  • X(t)

  • r even

α = E 1 t Z t f

  • X(u)
  • du
  • = E

" 1 t N(t)1 X

n=0

f (Sn)t⇤(Sn, Cn) + f (SN(t))

  • t − ζN(t)
  • !#

Flow charts and diagrams can be helpful (see Law, p. 30–32 for an example)

15 / 27

tt

slide-16
SLIDE 16

Discrete-Event Systems and Generalized Semi-Markov Processes Discrete-Event Stochastic Systems The GSMP Model Simulating GSMPs Generating Clock Readings: Inversion Method Markovian and Semi-Markovian GSMPs

16 / 27

slide-17
SLIDE 17

Generating Clock Readings: Example

Exponential distribution with rate (intensity) λ

f (x; λ) = ( λeλx if x 0; if x < 0 and F(x; λ) = ( 1 eλx if x 0; if x < 0

Mean = 1/λ

Claim:

If U D ⇠ Uniform(0, 1) and V = ln U

λ

, then V D ⇠ exp(λ) Proof:

17 / 27

HEE

'

de

pdf

cdf

Ptv > x) =P(

  • ¥

"

⇒ x)

  • Pan using

= Pcu

  • ein): e-tx
slide-18
SLIDE 18

The Inversion Method: Special Case

Spose that cdf F(x) = P(V  x) is increasing and continuous

Claim:

If U D ⇠ Uniform(0, 1) and V = F 1(U), then V D ⇠ F Proof:

18 / 27

FT'm

pcvsx)

  • Pff
  • 'latex)=PfrCf"CUD

xD

Plus Fox ))

FIX)

slide-19
SLIDE 19

Example: Exponential Distribution

F(x) = 1 eλx F 1(u) =

19 / 27

I - EdX=U

U'II- U

e-H

  • I
  • U
  • bull
  • u)
  • Helmuth)

T

x .

  • braid

=

  • lulu

')

t

f

special

case of

inversion method

slide-20
SLIDE 20

The Inversion Method: General Case

Generalized inverse

F 1(u) = min{x : F(x) u} F(x) x

u F (u)

  • 1

Claim still holds: F 1(u)  x , u  F(x) by definition Exercise: Show that inversion method = naive method for discrete RVs

20 / 27

X

w co
slide-21
SLIDE 21

Discrete-Event Systems and Generalized Semi-Markov Processes Discrete-Event Stochastic Systems The GSMP Model Simulating GSMPs Generating Clock Readings: Inversion Method Markovian and Semi-Markovian GSMPs

21 / 27

slide-22
SLIDE 22

Markovian GSMPs

Properties of the Exponential Distribution

If X D ∼ exp(λ) and Y D ∼ exp(µ) then

  • 1. min(X, Y ) D

∼ exp(λ + µ) [indep. of whether min = X or Y ]

  • 2. P(X < Y ) =

λ λ+µ

  • 3. P(X > a + b | X > a) = eλb [memoryless property]

Properties 1 and 2 generalize to multiple exponential RVs

Simple GSMP event e0

F(· ; s0, e0, s, E ⇤) ≡ F(· ; e0) and F0(· ; e0; s) ≡ F(· ; e0)

22 / 27

pdf

""E

" "EEE r.

'

'Ii

,

in

↳xx

slide-23
SLIDE 23

Markovian GSMPs, Continued

Suppose that all events in a GSMP are simple with exponential clock-setting distn’s Key observation: By memoryless property, whenever GSMP jumps into a state s, clock readings for events in E(s) are mutually independent and exponentially distributed

Simplified Simulation Algorithm (No clock readings needed)

  • 1. (Initialization) Select s D

∼ ν

  • 2. Generate holding time t⇤ D

∼ exp(λ), where λ = λ(s) = P

ei2E(s) λi

  • 3. Select ei ∈ E(s) as trigger event with probability λi/λ
  • 4. Generate the next state s0 D

∼ p( · ; s, ei)

  • 5. Set s = s0 and go to Step 2

23 / 27

slide-24
SLIDE 24

Markovian GSMPs, Continued

Structure of a Markovian GSMP

I Sequence (Sn : n ≥ 0) is a DTMC with transition matrix

R(s, s0) = P

ei2E(s) p(s0; s, ei)(λi/λ) I Given (Sn : n ≥ 0), holding times are mutually independent

with holding time in Sn

D

∼ exp

  • λ(Sn)
  • Often, occurrence of ei in s causes state to change to a

unique state yi = yi(s) with probability 1

Super-Simplified Simulation Algorithm

  • 1. (Initialization) Select s D

∼ ν

  • 2. Generate holding time t⇤ D

∼ exp(λ), where λ = P

ei2E(s) λi

  • 3. Set s0 = yi(s) with probability λi/λ
  • 4. Set s = s0 and go to Step 2

24 / 27

Sni state after nth

transition

slide-25
SLIDE 25

Markovian GSMPs, Continued

A GSMP

  • X(t) : t ≥ 0)
  • with simple, exponential transitions

is a continuous-time Markov chain (CTMC) [Ross, Ch. 6]

I Finite or countable state space I Continuous-time Markov property

P

  • X(t + u) = s | X(s) : 0 ≤ s ≤ t
  • = P
  • X(t + u) = s | X(t)
  • All CTMCs have foregoing structure

I State sequence is a DTMC I Holding times mutually independent and exp

  • λ(s)
  • in state s

Q: What can go wrong if events are not simple?

25 / 27

slide-26
SLIDE 26

Example of Markovian GSMP: Poisson Process

Definition of Poisson process

  • N(t) : t ≥ 0
  • with rate λ

I S = {0, 1, 2, . . .} I Single exp(λ) event I p(s + 1; s, e) = 1

Can show that

P

  • N(t + s) = m + n | N(t) = m
  • = e-λs(λs)n

n!

Examples: # arrivals to a queue, # of lightbulb replacements

26 / 27

Nlt)

9

3

  • TO
a-0

¥E→t

pugs:3

.n

E

slide-27
SLIDE 27

Semi-Markovian GSMPs

GSMP

  • X(t) : t ≥ 0
  • with simple events such that |E(s)| = 1

for all s ∈ S is a semi-Markov process Definition of semi-Markov process

I Discrete state space S I State sequence (Xn : n ≥ 0) is a DTMC with transition

matrix, say, R

I Holding time in s D

∼ F( · ; s)

I “Markov property holds only at state-transition times”

Example: Renewal counting process

I S = {0, 1, 2, . . .} I R(s, s + 1) = 1 for all s ∈ S I F( · ; s) ≡ G( · ) for some G

27 / 27