Petri Nets An Overview IE 680 Presentation April 30, 2007 Renata Kopach- Konrad.

Post on 22-Dec-2015

217 views 1 download

Tags:

Transcript of Petri Nets An Overview IE 680 Presentation April 30, 2007 Renata Kopach- Konrad.

Petri NetsAn Overview

IE 680 PresentationApril 30, 2007

Renata Kopach- Konrad

Overview

• The building blocks of Petri Nets• An example• Analysis tools• Extensions• Elements of steady-state

simulation theory for SPNs

What are Petri Nets?

• Mathematical modeling tools that capture operational dynamics of discrete event systems

• Graphical Representation• Modeling Language• State-transition mechanism• Event Scheduling

mechanism

Not this kind of Petri!

Applications

• Software design• Workflow management• Data Analysis• Reliability Engineering

Suitable for Modeling

• Concurrency• Synchronization• Precedence• Priority• Bottom up and top-down modeling

Modeling Tool: Petri Nets

• Supports modularity and abstraction• Supports system simulation• Supports formal analysis for operational

properties such as boundedness, liveness, reachabiltiy, etc.

• Petri Nets have a rich research literature

What is a Petri Net?

System State: Tokens and Net Marking

Initial State: (1,1,2,1)

t2 is enabled

Fire t2, New State: (1,0,3,2)

Fire t3, New State: (2,0,2,2)

Fire t1, New State: (1,2,2,2)

Fire t4, New State: (1,3,2,0)

In the context of DES

• Marking of the SPN = state of the system

• Firing of a transition = occurrence of an event

Notation…

A Petri net is a 5-tuple , where• S is a set of places• T is a set of transitions • F is a set of arcs s.t.• M0 is an initial marking

• W is the set of arc weights/transition matrix/incidence matrix

…allows for many things

The state of a net is an M vector so

State equations are possible

• Where is how many times each transition fires

• WT state transition matrix

• S={p1,p2,p3,p4} T={t1,t2,t3,t4}

• F={(p1,t1) (p2,t2) (p3,t3) (p4,t4) (t1,p2)(t2,p3)(t2 p4) (t3,p1) (t4,p2)}

2010

0110

1012

0101

CW

M0 Initial state (1,1,2,1)σ Firing sequence (t2 t3 t1 t4)Mn Final state (1,3,2,0)

Analysis Techniques

• Reachability: used to find erroneous state (Karp and Miller, Hack)

• Liveness: related to deadlock• Boundedness: if the # of tokens in

any place cannot exceed k. (Covering)

• Fairness: will there be an infinite sequence?

1

1

1

1

*

2010

0110

1012

0101

1

2

1

1

0

2

3

1

Reachability

How do we get there? What

sequence of event firings will get us to

the final state?

Final State

Starting State (Initial

Marking)

Reachability Example• Obtain the min sequence of events

(transition firings) from an initial state to a final state

• MIP Problem: solved multiple times• Constraints: State Equations• Objective Function: minimize the

difference between the final and the intermediate state

An example

Part 1: Min number of events – Finding the Parikh Vector

• Min

my

y

y

...

...2

1

m

...

...2

1

mn

......

...

...

...11

nx

x

x

...

...2

1

+

n

jjx

1

S.t.

X j>= 0 j Є J, Є Zwhere,αi >= 0 initial marking (given) i Є I yi >= 0 final marking (given) i Є I, ZФij- coefficient on the Incidence Matrix for place i, transition j; i Є I, j Є J,

x is the number of times transition j fires j Є J

=

Part 2: Identifying the Sequence of Events using

MIPConstraint (i) state equationConstraint (ii) limits the transitions

per sequence to 1. Constraint (iii) enforces the total

number of times a transition can fire across all sequences to be equal to the PV

Many extensions are possible

• Coloured • Hierarchy• Prioritized• Timed Petri Nets

• Stochastic

The Stochastic Element

• Clocks

• X(t) is the marking process of an SPN

Ref: Haas, 2004 page 102

A Queuing Example

The SPN of the model is

Ref: Haas, 2004 page 103

2 Service Centers

N(>2) jobs

p: rework at Center 1

Stability and Simulation

• Interested in performance characteristics

• Typically interested in terms of the marking process

• Can apply• Regenerative Simulation Method

][

][

NE

LE

Expected value of data collected in regenerative interval

Expected number of data

Concerns:

How do you find regenerative point in an SPN?

Key Assumptions

There exists • a marking• set of transitions

Such that the marking process probability restarts whenever the marking is and the transitions in fire simultaneously.

s

E

s

E

Regenerative method for the Marking Process

1. Select a sequence of regeneration points for the process 2. Simulate the process and observe a

fixed number n of cycles defined by the random times

3. Compute the length of the kth cycle and the quantity

4. Form the strongly consistent point estimate (e.g. using jackknife method)

5. Haas (2004) provides the theorem for defining the sequence of regeneration points for a marking process

0:)( ttX

0: kTk

0:)( ttX

0: kTk

k

k

T

T

k duuXffY1

))(()(

Challenges

• Difficult to identify regeneration points in practice

• Can be long intervals/ high utilization

• Haas suggests using Standardized Time Series

Software

• STNPlay• CPNTools (Colored PNs)• Petri Net Kernel (in Java)• YASPER (workflow analysis)

Summary

• Petri Nets are a powerful modeling tool

• Many extensions are possible• Allows for rigorous formulalism

References

• J. Peterson. Petri Net Theory and the Modeling of Systems. Prentice Hall. 1981

• T. Murata, “Petri nets: Properties, Analysis And Applications”, Proc. Of The IEEE, Vol. 77 No.4, pp. 541-580, April 1989.

• C. Cassandras. Discrete Event Systems: Modeling and Performance Analysis. Homewood, IL: Richard D. Irwin, Inc., and Aksen Associates, Inc., 1993.

• P. Haas, “Stochastic Petri Nets for Modelling and Simulation,” Proc. Of the 2004 Winter Simulation Conference, Washington, D.C, pp. 101-112, December 2004.