You are on page 1of 21

From Petri Nets to

SRN
Meng-Lai Yin

1/16/2020 Petri Net Meng-Lai Yin 1


Petri Nets
“Petri net theory has developed considerably since its
beginning with by Dr. Petri’s 1962 Ph.D. dissertation.
It is becoming expected that every computer scientist
know some basic Petri net theory” - James Peterson
(author of the book “Petri Net Theory and the Modeling
of Systems”)

1/16/2020 Petri Net Meng-Lai Yin 2


Petri Net - Notation
5-tuple : (P, T, A, M, 0) Pqueue
Tarrival Tservice
A finite set of places (drawn as circles)

A finite set of transitions (drawn as bars)

A set of arcs connecting P and T


Multiplicity associated with the arcs in A
Initial marking
Marking denotes the number of tokens (drawn
as dots or a positive integer) for each place in P

1/16/2020 Petri Net Meng-Lai Yin 3


Petri Net - Graphical Presentation
 A directed graph with two disjoint types of
node: places and transitions

Pqueue
Tarrival Tservice

1/16/2020 Petri Net Meng-Lai Yin 4


Terminology & Behavior of a
Petri Net Model (1)
 Input places: places connected to a transition by
input arcs
 Output places
 Marking: marking represents the state of the model
at a particular time
 The notation #(p,) means the number of tokens in
place p in marking . If the marking is clear in
context, then notation #p is used.

1/16/2020 Petri Net Meng-Lai Yin 5


Terminology & Behavior of a
Petri Net Model (2)
 The default multiplicity is 1 (if not specified)
 A transition is enabled when each of its input
places has at least as many tokens as the
multiplicity of the corresponding inputs arc.
 A transition may fire when it is enabled.
 On firing, a number of tokens equal to the
multiplicity of the input arc are removed from each
of the input places, and a number of tokens equal
to the multiplicity of the output arc are deposited
in each of its output places.
1/16/2020 Petri Net Meng-Lai Yin 6
Terminology & Behavior of a
Petri Net Model (3)
 If two transitions are enabled in a marking, they
cannot be fired “at the same time”; a choice
must be made.
 The firing of a transition may transform a Petri-
Net from one marking to another.
 With respect to a given initial marking, the
reachability set is defined as the set of all
markings reachable from the initial marking.

1/16/2020 Petri Net Meng-Lai Yin 7


Exercise 1
 What is the reachability set of this model?

Pqueue
Tarrival Tservice

1/16/2020 Petri Net Meng-Lai Yin 8


Exercise 2
 What is the reachability set of this model?

1/16/2020 Petri Net Meng-Lai Yin 9


SPN (Stochastic Petri Net)
 SPNs are obtained by associating
stochastic and timing information to Petri
nets
 a “firing time” is attached to each
transition, representing the time that must
elapse from the instant that the transition
is enabled until the instant it actually fires

1/16/2020 Petri Net Meng-Lai Yin 10


Example 1 : Stochastic Petri Net

1/16/2020 Petri Net Meng-Lai Yin 11


SPN Example 2 : M/M/1 Queue
 

Pqueue
Tarrival Tservice

What is the corresponding Queuing model & Markov chain?


The Markov chain is called “reachability graph” in Petri Net terminology
    
0 1 2 k
    

1/16/2020 Petri Net Meng-Lai Yin 12


SPN Example 3: Poisson Process

Pqueue
Tarrival

Reachability graph
   
0 1 2 3

1/16/2020 Petri Net Meng-Lai Yin 13


Example 4: SPN of M/M/1/n queue

M/M/1/n queue: an M/M/1 queuing system


with a limited buffer space so that at most
n jobs can be in the system at any time
 

n
Pvacancy Pqueue
Tarrival Tservice

1/16/2020 Petri Net Meng-Lai Yin 14


M/M/1/n Queue Reachability Graph

  

n, 0 n-1,1 0, n

  

1/16/2020 Petri Net Meng-Lai Yin 15


SPN Example 5: M/M/n/n queue
Tarrival Tservice
n
# #: Marking dependent firing rate

Pqueue
 
Inhibitor arc: a transition cannot fire if the number of tokens in place Pqueue 
the multiplicity of the arc

  

0 1 n

 2 n
1/16/2020 Petri Net Meng-Lai Yin 16
GSPN
 GSPN (Generalized Stochastic Petri Nets)
 Transitions are allowed to be either timed
(exponentially distributed firing time, drawn as
rectangular boxes) or immediate (zero firing time,
drawn as thin bars)
 If both an immediate transition and a timed
transition are enabled at the same instant, the
immediate transition fires first

1/16/2020 Petri Net Meng-Lai Yin 17


GSPN Example
GSPN for a M/M/i/n queue
(i servers available, buffer size=n)

Pserver
i
Inhibitor arc
tquick Tservice
Tarrival n
#

Pqueue Pservice
 

Draw the corresponding queuing network and Markov chain

1/16/2020 Petri Net Meng-Lai Yin 18


SPN and GSPN: Summary
(SPN) Stochastic Petri
nets are obtained by  
associating stochastic
and timing information
to Petri nets

Pqueue
Tarrival Tservice
Pserver

 
In (GSPN) Generalized
Stochastic Petri nets,
transitions are allowed to be
either timed or immediate (zero
firing time)
Pqueue Pservice
Tarrival Tservice

1/16/2020 Petri Net Meng-Lai Yin 19


Stochastic Reward Nets (SRN)
and beyond
 SRNs are based on GSPN but extend it so
that each marking can be associated with a
reward rate
 A variety of reward-based measures can be
specified and calculated under a convenient
framework
 SAN (Stochastic Active Network) by John
Meyer
1/16/2020 Petri Net Meng-Lai Yin 20
Example : SRN Model for an
n-Multiprocessor System
Pup An SRN can represent a system with
different initial configurations. The way
n the reward rate function is specified is also
flexible so that it is easy to accommodate
different aspects of the system.
#
Trepair
Tfail Reward rate specification
  for a marking i

 1, # Pup  1
r i  0, otherwise

Pdown

1/16/2020 Petri Net Meng-Lai Yin 21

You might also like