SlideShare a Scribd company logo
1 of 41
The Petri Net Method
(C) Copyright 2001, Chris Ling
Introduction
First introduced by Carl Adam Petri in
1962.
A diagrammatic tool to model concurrency
and synchronization in distributed systems.
Very similar to State Transition Diagrams.
Used as a visual communication aid to
model the system behaviour.
Based on strong mathematical foundation.
(C) Copyright 2001, Chris Ling
Example: EFTPOS System (STD of an FSM)
Initial
1 digit 1 digit 1 digit 1 digit
d1 d2 d3 d4
OK
OK
pressed
Approved
Rejected
OK
OK
OK
OK
Initial state
Final state
Reject
(EFTPOS= Electronic Fund Transfer Point of Sale)
(C) Copyright 2001, Chris Ling
Example: EFTPOS System (A Petri net)
Initial
1 digit 1 digit 1 digit 1 digit
d1 d2 d3
d4
OK
OK
pressed
approve
approved
OK OK OK
OK
Reject
Rejected!
(C) Copyright 2001, Chris Ling
EFTPOS System
Scenario 1: Normal
– Enters all 4 digits and press OK.
Scenario 2: Exceptional
– Enters only 3 digits and press OK.
(C) Copyright 2001, Chris Ling
Example: EFTPOS System (Token Games)
Initial
1 digit 1 digit 1 digit 1 digit
d1 d2 d3
d4
OK
OK
pressed
approve
approved
OK OK OK
OK
Reject
Rejected!
(C) Copyright 2001, Chris Ling
A Petri Net Specification ...
consists of three types of components:
places (circles), transitions (rectangles) and
arcs (arrows):
– Places represent possible states of the system;
– Transitions are events or actions which cause
the change of state; And
– Every arc simply connects a place with a
transition or a transition with a place.
(C) Copyright 2001, Chris Ling
A Change of State …
is denoted by a movement of token(s) (black
dots) from place(s) to place(s); and is
caused by the firing of a transition.
The firing represents an occurrence of the
event or an action taken.
The firing is subject to the input conditions,
denoted by token availability.
(C) Copyright 2001, Chris Ling
A Change of State
A transition is firable or enabled when there
are sufficient tokens in its input places.
After firing, tokens will be transferred from
the input places (old state) to the output
places, denoting the new state.
Note that the EFTPOS example is a Petri
net representation of a finite state machine
(FSM).
(C) Copyright 2001, Chris Ling
Example: Vending Machine
The machine dispenses two kinds of snack
bars – 20c and 15c.
Only two types of coins can be used
– 10c coins and 5c coins.
The machine does not return any change.
(C) Copyright 2001, Chris Ling
Example: Vending Machine (STD of an FSM)
0 cent
5 cents
10 cents
15 cents
20 cents
Deposit 10c
Deposit 10c
Take 20c snack bar
Take 15c snack bar
(C) Copyright 2001, Chris Ling
Example: Vending Machine (A Petri net)
5c
Take 15c bar
Deposit 5c
0c
Deposit 10c
Deposit
5c
10c
Deposit 10c
Deposit
5c
Deposit 10c
20c
Deposit
5c
15c
Take 20c bar
(C) Copyright 2001, Chris Ling
Example: Vending Machine (3 Scenarios)
Scenario 1:
– Deposit 5c, deposit 5c, deposit 5c, deposit 5c,
take 20c snack bar.
Scenario 2:
– Deposit 10c, deposit 5c, take 15c snack bar.
Scenario 3:
– Deposit 5c, deposit 10c, deposit 5c, take 20c
snack bar.
(C) Copyright 2001, Chris Ling
Example: Vending Machine (Token Games)
5c
Take 15c bar
Deposit 5c
0c
Deposit 10c
Deposit
5c
10c
Deposit 10c
Deposit
5c
Deposit 10c
20c
Deposit
5c
15c
Take 20c bar
(C) Copyright 2001, Chris Ling
Multiple Local States
In the real world, events happen at the same
time.
A system may have many local states to
form a global state.
There is a need to model concurrency and
synchronization.
(C) Copyright 2001, Chris Ling
Example: In a Restaurant (A Petri Net)
Waiter
free
Customer 1 Customer 2
Take
order
Take
order
Order
taken
Tell
kitchen
wait wait
Serve food Serve food
eating eating
(C) Copyright 2001, Chris Ling
Example: In a Restaurant (Two Scenarios)
Scenario 1:
– Waiter takes order from customer 1; serves
customer 1; takes order from customer 2; serves
customer 2.
Scenario 2:
– Waiter takes order from customer 1; takes order
from customer 2; serves customer 2; serves
customer 1.
(C) Copyright 2001, Chris Ling
Example: In a Restaurant (Scenario 1)
Waiter
free
Customer 1 Customer 2
Take
order
Take
order
Order
taken
Tell
kitchen
wait wait
Serve food Serve food
eating eating
(C) Copyright 2001, Chris Ling
Example: In a Restaurant (Scenario 2)
Waiter
free
Customer 1 Customer 2
Take
order
Take
order
Order
taken
Tell
kitchen
wait wait
Serve food Serve food
eating eating
(C) Copyright 2001, Chris Ling
Net Structures
A sequence of events/actions:
Concurrent executions:
e1 e2 e3
e1
e2 e3
e4 e5
(C) Copyright 2001, Chris Ling
Net Structures
 Non-deterministic events - conflict, choice or
decision: A choice of either e1, e2 … or e3, e4 ...
e1 e2
e3 e4
(C) Copyright 2001, Chris Ling
Net Structures
Synchronization
e1
(C) Copyright 2001, Chris Ling
Net Structures
Synchronization and Concurrency
e1
(C) Copyright 2001, Chris Ling
Another Example
• A producer-consumer system, consist of one
producer, two consumers and one storage buffer
with the following conditions:
• The storage buffer may contain at most 5 items;
• The producer sends 3 items in each production;
• At most one consumer is able to access the storage
buffer at one time;
• Each consumer removes two items when accessing the
storage buffer
(C) Copyright 2001, Chris Ling
A Producer-Consumer System
ready
p1
t1
produce
idle
send
p2
t2
k=1
k=1
k=5
Storage p3
3 2 t3 t4
p4
p5
k=2
k=2
accept
accepted
consume
ready
Producer Consumers
(C) Copyright 2001, Chris Ling
A Producer-Consumer Example
• In this Petri net, every place has a capacity
and every arc has a weight.
• This allows multiple tokens to reside in a
place to model more complex behaviour.
(C) Copyright 2001, Chris Ling
Behavioural Properties
• Reachability
• “Can we reach one particular state from
another?”
• Boundedness
• “Will a storage place overflow?”
• Liveness
• “Will the system die in a particular state?”
(C) Copyright 2001, Chris Ling
Recalling the Vending Machine (Token Game)
5c
Take 15c bar
Deposit 5c
0c
Deposit 10c
Deposit
5c
10c
Deposit 10c
Deposit
5c
Deposit 10c
20c
Deposit
5c
15c
Take 20c bar
(C) Copyright 2001, Chris Ling
A marking is a state ...
t8
t1
p1
t2
p2
t3
p3
t4
t5
t6 p5
t7
p4
t9
M0 = (1,0,0,0,0)
M1 = (0,1,0,0,0)
M2 = (0,0,1,0,0)
M3 = (0,0,0,1,0)
M4 = (0,0,0,0,1)
Initial marking:M0
(C) Copyright 2001, Chris Ling
Reachability
t8
t1
p1
t2
p2
t3
p3
t4
t5
t6 p5
t7
p4
t9
Initial marking:M0
M0 M1 M2 M3 M0 M2 M4
t3
t1 t5 t8 t2 t6
M0 = (1,0,0,0,0)
M1 = (0,1,0,0,0)
M2 = (0,0,1,0,0)
M3 = (0,0,0,1,0)
M4 = (0,0,0,0,1)
(C) Copyright 2001, Chris Ling
Reachability
• “M2 is reachable from M1 and M4 is
reachable from M0.”
• In fact, in the vending machine example, all
markings are reachable from every marking.
M0 M1 M2 M3 M0 M2 M4
t3
t1 t5 t8 t2 t6
A firing or occurrence sequence:
(C) Copyright 2001, Chris Ling
Boundedness
• A Petri net is said to be k-bounded or
simply bounded if the number of tokens in
each place does not exceed a finite number
k for any marking reachable from M0.
• The Petri net for vending machine is 1-
bounded.
• A 1-bounded Petri net is also safe.
(C) Copyright 2001, Chris Ling
Liveness
• A Petri net with initial marking M0 is live
if, no matter what marking has been reached
from M0, it is possible to ultimately fire any
transition by progressing through some
further firing sequence.
• A live Petri net guarantees deadlock-free
operation, no matter what firing sequence is
chosen.
(C) Copyright 2001, Chris Ling
Liveness
• The vending machine is live and the
producer-consumer system is also live.
• A transition is dead if it can never be fired
in any firing sequence.
(C) Copyright 2001, Chris Ling
An Example
A bounded but non-live Petri net
p1 p2
p3
p4
t1
t2
t3 t4
M0 = (1,0,0,1)
M1 = (0,1,0,1)
M2 = (0,0,1,0)
M3 = (0,0,0,1)
(C) Copyright 2001, Chris Ling
Another Example
p1
t1
p2 p3
t2 t3
p4 p5
t4
An unbounded but live Petri net
M0 = (1, 0, 0, 0, 0)
M1 = (0, 1, 1, 0, 0)
M2 = (0, 0, 0, 1, 1)
M3 = (1, 1, 0, 0, 0)
M4 = (0, 2, 1, 0, 0)
(C) Copyright 2001, Chris Ling
Analysis Methods
• Reachability Analysis:
• Reachability or coverability tree.
• State explosion problem.
• Incidence Matrix and State Equations.
• Structural Analysis
• Based on net structures.
(C) Copyright 2001, Chris Ling
Other Types of Petri Nets
• High-level Petri nets
• Tokens have “colours”, holding complex
information.
• Timed Petri nets
• Time delays associated with transitions and/or
places.
• Fixed delays or interval delays.
• Stochastic Petri nets: exponentially distributed
random variables as delays.
(C) Copyright 2001, Chris Ling
Other Types of Petri Nets
• Object-Oriented Petri nets
• Tokens are instances of classes, moving from
one place to another, calling methods and
changing attributes.
• Net structure models the inner behaviour of
objects.
• The purpose is to use object-oriented constructs
to structure and build the system.
(C) Copyright 2001, Chris Ling
An O-O Petri Net
ready
produce
Storage
accepted
consume
ready
Producer Consumer
send accept
Producer
data: ITEM
ITEM produce( )
void send(ITEM)
Consumer
data: ITEM
ITEM accept( )
void consume(ITEM)
(C) Copyright 2001, Chris Ling
Petri Net References
 Murata, T. (1989, April). Petri nets: properties, analysis
and applications. Proceedings of the IEEE, 77(4), 541-80.
 Peterson, J.L. (1981). Petri Net Theory and the Modeling
of Systems. Prentice-Hall.
 Reisig, W and G. Rozenberg (eds) (1998). Lectures on
Petri Nets 1: Basic Models. Springer-Verlag.
 The World of Petri nets:
http://www.daimi.au.dk/PetriNets/

More Related Content

Similar to INTRODUCTION TO PETRINETS, PROCESS INVOVLED

Skr+3200+chapter+3+(kweh)
Skr+3200+chapter+3+(kweh)Skr+3200+chapter+3+(kweh)
Skr+3200+chapter+3+(kweh)
Ammar Shafiq
 
01.number systems
01.number systems01.number systems
01.number systems
rasha3
 
Pcb carolina scg_2010
Pcb carolina scg_2010Pcb carolina scg_2010
Pcb carolina scg_2010
tcoyle72
 

Similar to INTRODUCTION TO PETRINETS, PROCESS INVOVLED (20)

Skr+3200+chapter+3+(kweh)
Skr+3200+chapter+3+(kweh)Skr+3200+chapter+3+(kweh)
Skr+3200+chapter+3+(kweh)
 
F010313342
F010313342F010313342
F010313342
 
01.number systems
01.number systems01.number systems
01.number systems
 
Mathematical support for preventive maintenance periodicity optimization of r...
Mathematical support for preventive maintenance periodicity optimization of r...Mathematical support for preventive maintenance periodicity optimization of r...
Mathematical support for preventive maintenance periodicity optimization of r...
 
Tech Overview
Tech OverviewTech Overview
Tech Overview
 
Digital Data Transmission.ppt
Digital Data Transmission.pptDigital Data Transmission.ppt
Digital Data Transmission.ppt
 
An Inventory Management System for Deteriorating Items with Ramp Type and Qua...
An Inventory Management System for Deteriorating Items with Ramp Type and Qua...An Inventory Management System for Deteriorating Items with Ramp Type and Qua...
An Inventory Management System for Deteriorating Items with Ramp Type and Qua...
 
2009 worldfinalproblemset
2009 worldfinalproblemset2009 worldfinalproblemset
2009 worldfinalproblemset
 
Basic Consensus Algorithms
Basic Consensus AlgorithmsBasic Consensus Algorithms
Basic Consensus Algorithms
 
Inventory Model with Different Deterioration Rates under Exponential Demand, ...
Inventory Model with Different Deterioration Rates under Exponential Demand, ...Inventory Model with Different Deterioration Rates under Exponential Demand, ...
Inventory Model with Different Deterioration Rates under Exponential Demand, ...
 
Pcb carolina scg_2010
Pcb carolina scg_2010Pcb carolina scg_2010
Pcb carolina scg_2010
 
21EC201– Digital Principles and system design.pptx
21EC201– Digital Principles and system design.pptx21EC201– Digital Principles and system design.pptx
21EC201– Digital Principles and system design.pptx
 
Humming code error detector 7_communications.ppt
Humming code error detector 7_communications.pptHumming code error detector 7_communications.ppt
Humming code error detector 7_communications.ppt
 
01.Number Systems
01.Number Systems01.Number Systems
01.Number Systems
 
CompactDisc.ppt
CompactDisc.pptCompactDisc.ppt
CompactDisc.ppt
 
Ss
SsSs
Ss
 
Quantum Matrices Using Quantum Gates
Quantum Matrices Using Quantum GatesQuantum Matrices Using Quantum Gates
Quantum Matrices Using Quantum Gates
 
Crimson Publishers-Quantum Matrices Using Quantum Gates
Crimson Publishers-Quantum Matrices Using Quantum GatesCrimson Publishers-Quantum Matrices Using Quantum Gates
Crimson Publishers-Quantum Matrices Using Quantum Gates
 
Quantum computing
Quantum computingQuantum computing
Quantum computing
 
Direct methanol fuel cell and proton Exchange membranes i
Direct methanol fuel cell and proton Exchange membranes iDirect methanol fuel cell and proton Exchange membranes i
Direct methanol fuel cell and proton Exchange membranes i
 

More from Mani Deepak Choudhry

More from Mani Deepak Choudhry (20)

LM9 - OPERATIONS, SCHEDULING, Inter process xommuncation
LM9 - OPERATIONS, SCHEDULING, Inter process xommuncationLM9 - OPERATIONS, SCHEDULING, Inter process xommuncation
LM9 - OPERATIONS, SCHEDULING, Inter process xommuncation
 
L13 Plume Rise, types, methods, applications
L13 Plume Rise, types, methods, applicationsL13 Plume Rise, types, methods, applications
L13 Plume Rise, types, methods, applications
 
L10 Inversions in atmospheric stability, conditions
L10 Inversions in atmospheric stability, conditionsL10 Inversions in atmospheric stability, conditions
L10 Inversions in atmospheric stability, conditions
 
UNIT II - meteorology, occurrence, process
UNIT II - meteorology, occurrence, processUNIT II - meteorology, occurrence, process
UNIT II - meteorology, occurrence, process
 
L11 Wind profiles and stack plume patterns.pptx
L11 Wind profiles and stack plume patterns.pptxL11 Wind profiles and stack plume patterns.pptx
L11 Wind profiles and stack plume patterns.pptx
 
LM7 - Ambient Air Quality and Emission standards..pptx
LM7 - Ambient Air Quality and Emission standards..pptxLM7 - Ambient Air Quality and Emission standards..pptx
LM7 - Ambient Air Quality and Emission standards..pptx
 
LM16 - Gravity Separators, methods, measures
LM16 - Gravity Separators, methods, measuresLM16 - Gravity Separators, methods, measures
LM16 - Gravity Separators, methods, measures
 
LM14,15 - Air Pollution Control, measures
LM14,15 - Air Pollution Control, measuresLM14,15 - Air Pollution Control, measures
LM14,15 - Air Pollution Control, measures
 
LM9 - Fundamentals, Atmospheric stability.pptx
LM9 - Fundamentals, Atmospheric stability.pptxLM9 - Fundamentals, Atmospheric stability.pptx
LM9 - Fundamentals, Atmospheric stability.pptx
 
LM8 - Effects of meteorology on Air Pollution.pptx
LM8 - Effects of meteorology on Air Pollution.pptxLM8 - Effects of meteorology on Air Pollution.pptx
LM8 - Effects of meteorology on Air Pollution.pptx
 
LM6 - Effect of air Pollutants on Property aesthetic value and visibility.pptx
LM6 - Effect of air Pollutants on Property aesthetic value and visibility.pptxLM6 - Effect of air Pollutants on Property aesthetic value and visibility.pptx
LM6 - Effect of air Pollutants on Property aesthetic value and visibility.pptx
 
LM5 - Effect of air Pollutants on Vegetation & animals.pptx
LM5 - Effect of air Pollutants on Vegetation & animals.pptxLM5 - Effect of air Pollutants on Vegetation & animals.pptx
LM5 - Effect of air Pollutants on Vegetation & animals.pptx
 
LM4 - Classification of air pollutants and their effect on human health.pptx
LM4 - Classification of air pollutants and their effect on human health.pptxLM4 - Classification of air pollutants and their effect on human health.pptx
LM4 - Classification of air pollutants and their effect on human health.pptx
 
LM2 - Definition, Scope & Scales of Air Pollution.pptx
LM2 - Definition, Scope & Scales of Air Pollution.pptxLM2 - Definition, Scope & Scales of Air Pollution.pptx
LM2 - Definition, Scope & Scales of Air Pollution.pptx
 
LM1 - Structure & Composition of Atmosphere.pptx
LM1 - Structure & Composition of Atmosphere.pptxLM1 - Structure & Composition of Atmosphere.pptx
LM1 - Structure & Composition of Atmosphere.pptx
 
Safety Terminologies, measures, hazards and risks
Safety Terminologies, measures, hazards and risksSafety Terminologies, measures, hazards and risks
Safety Terminologies, measures, hazards and risks
 
Software Configuration Management introduction
Software Configuration Management introductionSoftware Configuration Management introduction
Software Configuration Management introduction
 
Meta Safety Data Sheets for hazardous materials
Meta Safety Data Sheets for hazardous materialsMeta Safety Data Sheets for hazardous materials
Meta Safety Data Sheets for hazardous materials
 
Personnel Protective Equipment along with measures
Personnel Protective Equipment along with measuresPersonnel Protective Equipment along with measures
Personnel Protective Equipment along with measures
 
types of testing with descriptions and examples
types of testing with descriptions and examplestypes of testing with descriptions and examples
types of testing with descriptions and examples
 

Recently uploaded

Call Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
Epec Engineered Technologies
 
Integrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - NeometrixIntegrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - Neometrix
Neometrix_Engineering_Pvt_Ltd
 
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
amitlee9823
 
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak HamilCara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Kandungan 087776558899
 

Recently uploaded (20)

Call Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
 
Integrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - NeometrixIntegrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - Neometrix
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leap
 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . ppt
 
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdf
 
Work-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxWork-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptx
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPT
 
A Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityA Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna Municipality
 
Bhosari ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For ...
Bhosari ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For ...Bhosari ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For ...
Bhosari ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For ...
 
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced LoadsFEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
 
Minimum and Maximum Modes of microprocessor 8086
Minimum and Maximum Modes of microprocessor 8086Minimum and Maximum Modes of microprocessor 8086
Minimum and Maximum Modes of microprocessor 8086
 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
 
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
 
Employee leave management system project.
Employee leave management system project.Employee leave management system project.
Employee leave management system project.
 
Introduction to Serverless with AWS Lambda
Introduction to Serverless with AWS LambdaIntroduction to Serverless with AWS Lambda
Introduction to Serverless with AWS Lambda
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
 
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak HamilCara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
 

INTRODUCTION TO PETRINETS, PROCESS INVOVLED

  • 1. The Petri Net Method
  • 2. (C) Copyright 2001, Chris Ling Introduction First introduced by Carl Adam Petri in 1962. A diagrammatic tool to model concurrency and synchronization in distributed systems. Very similar to State Transition Diagrams. Used as a visual communication aid to model the system behaviour. Based on strong mathematical foundation.
  • 3. (C) Copyright 2001, Chris Ling Example: EFTPOS System (STD of an FSM) Initial 1 digit 1 digit 1 digit 1 digit d1 d2 d3 d4 OK OK pressed Approved Rejected OK OK OK OK Initial state Final state Reject (EFTPOS= Electronic Fund Transfer Point of Sale)
  • 4. (C) Copyright 2001, Chris Ling Example: EFTPOS System (A Petri net) Initial 1 digit 1 digit 1 digit 1 digit d1 d2 d3 d4 OK OK pressed approve approved OK OK OK OK Reject Rejected!
  • 5. (C) Copyright 2001, Chris Ling EFTPOS System Scenario 1: Normal – Enters all 4 digits and press OK. Scenario 2: Exceptional – Enters only 3 digits and press OK.
  • 6. (C) Copyright 2001, Chris Ling Example: EFTPOS System (Token Games) Initial 1 digit 1 digit 1 digit 1 digit d1 d2 d3 d4 OK OK pressed approve approved OK OK OK OK Reject Rejected!
  • 7. (C) Copyright 2001, Chris Ling A Petri Net Specification ... consists of three types of components: places (circles), transitions (rectangles) and arcs (arrows): – Places represent possible states of the system; – Transitions are events or actions which cause the change of state; And – Every arc simply connects a place with a transition or a transition with a place.
  • 8. (C) Copyright 2001, Chris Ling A Change of State … is denoted by a movement of token(s) (black dots) from place(s) to place(s); and is caused by the firing of a transition. The firing represents an occurrence of the event or an action taken. The firing is subject to the input conditions, denoted by token availability.
  • 9. (C) Copyright 2001, Chris Ling A Change of State A transition is firable or enabled when there are sufficient tokens in its input places. After firing, tokens will be transferred from the input places (old state) to the output places, denoting the new state. Note that the EFTPOS example is a Petri net representation of a finite state machine (FSM).
  • 10. (C) Copyright 2001, Chris Ling Example: Vending Machine The machine dispenses two kinds of snack bars – 20c and 15c. Only two types of coins can be used – 10c coins and 5c coins. The machine does not return any change.
  • 11. (C) Copyright 2001, Chris Ling Example: Vending Machine (STD of an FSM) 0 cent 5 cents 10 cents 15 cents 20 cents Deposit 10c Deposit 10c Take 20c snack bar Take 15c snack bar
  • 12. (C) Copyright 2001, Chris Ling Example: Vending Machine (A Petri net) 5c Take 15c bar Deposit 5c 0c Deposit 10c Deposit 5c 10c Deposit 10c Deposit 5c Deposit 10c 20c Deposit 5c 15c Take 20c bar
  • 13. (C) Copyright 2001, Chris Ling Example: Vending Machine (3 Scenarios) Scenario 1: – Deposit 5c, deposit 5c, deposit 5c, deposit 5c, take 20c snack bar. Scenario 2: – Deposit 10c, deposit 5c, take 15c snack bar. Scenario 3: – Deposit 5c, deposit 10c, deposit 5c, take 20c snack bar.
  • 14. (C) Copyright 2001, Chris Ling Example: Vending Machine (Token Games) 5c Take 15c bar Deposit 5c 0c Deposit 10c Deposit 5c 10c Deposit 10c Deposit 5c Deposit 10c 20c Deposit 5c 15c Take 20c bar
  • 15. (C) Copyright 2001, Chris Ling Multiple Local States In the real world, events happen at the same time. A system may have many local states to form a global state. There is a need to model concurrency and synchronization.
  • 16. (C) Copyright 2001, Chris Ling Example: In a Restaurant (A Petri Net) Waiter free Customer 1 Customer 2 Take order Take order Order taken Tell kitchen wait wait Serve food Serve food eating eating
  • 17. (C) Copyright 2001, Chris Ling Example: In a Restaurant (Two Scenarios) Scenario 1: – Waiter takes order from customer 1; serves customer 1; takes order from customer 2; serves customer 2. Scenario 2: – Waiter takes order from customer 1; takes order from customer 2; serves customer 2; serves customer 1.
  • 18. (C) Copyright 2001, Chris Ling Example: In a Restaurant (Scenario 1) Waiter free Customer 1 Customer 2 Take order Take order Order taken Tell kitchen wait wait Serve food Serve food eating eating
  • 19. (C) Copyright 2001, Chris Ling Example: In a Restaurant (Scenario 2) Waiter free Customer 1 Customer 2 Take order Take order Order taken Tell kitchen wait wait Serve food Serve food eating eating
  • 20. (C) Copyright 2001, Chris Ling Net Structures A sequence of events/actions: Concurrent executions: e1 e2 e3 e1 e2 e3 e4 e5
  • 21. (C) Copyright 2001, Chris Ling Net Structures  Non-deterministic events - conflict, choice or decision: A choice of either e1, e2 … or e3, e4 ... e1 e2 e3 e4
  • 22. (C) Copyright 2001, Chris Ling Net Structures Synchronization e1
  • 23. (C) Copyright 2001, Chris Ling Net Structures Synchronization and Concurrency e1
  • 24. (C) Copyright 2001, Chris Ling Another Example • A producer-consumer system, consist of one producer, two consumers and one storage buffer with the following conditions: • The storage buffer may contain at most 5 items; • The producer sends 3 items in each production; • At most one consumer is able to access the storage buffer at one time; • Each consumer removes two items when accessing the storage buffer
  • 25. (C) Copyright 2001, Chris Ling A Producer-Consumer System ready p1 t1 produce idle send p2 t2 k=1 k=1 k=5 Storage p3 3 2 t3 t4 p4 p5 k=2 k=2 accept accepted consume ready Producer Consumers
  • 26. (C) Copyright 2001, Chris Ling A Producer-Consumer Example • In this Petri net, every place has a capacity and every arc has a weight. • This allows multiple tokens to reside in a place to model more complex behaviour.
  • 27. (C) Copyright 2001, Chris Ling Behavioural Properties • Reachability • “Can we reach one particular state from another?” • Boundedness • “Will a storage place overflow?” • Liveness • “Will the system die in a particular state?”
  • 28. (C) Copyright 2001, Chris Ling Recalling the Vending Machine (Token Game) 5c Take 15c bar Deposit 5c 0c Deposit 10c Deposit 5c 10c Deposit 10c Deposit 5c Deposit 10c 20c Deposit 5c 15c Take 20c bar
  • 29. (C) Copyright 2001, Chris Ling A marking is a state ... t8 t1 p1 t2 p2 t3 p3 t4 t5 t6 p5 t7 p4 t9 M0 = (1,0,0,0,0) M1 = (0,1,0,0,0) M2 = (0,0,1,0,0) M3 = (0,0,0,1,0) M4 = (0,0,0,0,1) Initial marking:M0
  • 30. (C) Copyright 2001, Chris Ling Reachability t8 t1 p1 t2 p2 t3 p3 t4 t5 t6 p5 t7 p4 t9 Initial marking:M0 M0 M1 M2 M3 M0 M2 M4 t3 t1 t5 t8 t2 t6 M0 = (1,0,0,0,0) M1 = (0,1,0,0,0) M2 = (0,0,1,0,0) M3 = (0,0,0,1,0) M4 = (0,0,0,0,1)
  • 31. (C) Copyright 2001, Chris Ling Reachability • “M2 is reachable from M1 and M4 is reachable from M0.” • In fact, in the vending machine example, all markings are reachable from every marking. M0 M1 M2 M3 M0 M2 M4 t3 t1 t5 t8 t2 t6 A firing or occurrence sequence:
  • 32. (C) Copyright 2001, Chris Ling Boundedness • A Petri net is said to be k-bounded or simply bounded if the number of tokens in each place does not exceed a finite number k for any marking reachable from M0. • The Petri net for vending machine is 1- bounded. • A 1-bounded Petri net is also safe.
  • 33. (C) Copyright 2001, Chris Ling Liveness • A Petri net with initial marking M0 is live if, no matter what marking has been reached from M0, it is possible to ultimately fire any transition by progressing through some further firing sequence. • A live Petri net guarantees deadlock-free operation, no matter what firing sequence is chosen.
  • 34. (C) Copyright 2001, Chris Ling Liveness • The vending machine is live and the producer-consumer system is also live. • A transition is dead if it can never be fired in any firing sequence.
  • 35. (C) Copyright 2001, Chris Ling An Example A bounded but non-live Petri net p1 p2 p3 p4 t1 t2 t3 t4 M0 = (1,0,0,1) M1 = (0,1,0,1) M2 = (0,0,1,0) M3 = (0,0,0,1)
  • 36. (C) Copyright 2001, Chris Ling Another Example p1 t1 p2 p3 t2 t3 p4 p5 t4 An unbounded but live Petri net M0 = (1, 0, 0, 0, 0) M1 = (0, 1, 1, 0, 0) M2 = (0, 0, 0, 1, 1) M3 = (1, 1, 0, 0, 0) M4 = (0, 2, 1, 0, 0)
  • 37. (C) Copyright 2001, Chris Ling Analysis Methods • Reachability Analysis: • Reachability or coverability tree. • State explosion problem. • Incidence Matrix and State Equations. • Structural Analysis • Based on net structures.
  • 38. (C) Copyright 2001, Chris Ling Other Types of Petri Nets • High-level Petri nets • Tokens have “colours”, holding complex information. • Timed Petri nets • Time delays associated with transitions and/or places. • Fixed delays or interval delays. • Stochastic Petri nets: exponentially distributed random variables as delays.
  • 39. (C) Copyright 2001, Chris Ling Other Types of Petri Nets • Object-Oriented Petri nets • Tokens are instances of classes, moving from one place to another, calling methods and changing attributes. • Net structure models the inner behaviour of objects. • The purpose is to use object-oriented constructs to structure and build the system.
  • 40. (C) Copyright 2001, Chris Ling An O-O Petri Net ready produce Storage accepted consume ready Producer Consumer send accept Producer data: ITEM ITEM produce( ) void send(ITEM) Consumer data: ITEM ITEM accept( ) void consume(ITEM)
  • 41. (C) Copyright 2001, Chris Ling Petri Net References  Murata, T. (1989, April). Petri nets: properties, analysis and applications. Proceedings of the IEEE, 77(4), 541-80.  Peterson, J.L. (1981). Petri Net Theory and the Modeling of Systems. Prentice-Hall.  Reisig, W and G. Rozenberg (eds) (1998). Lectures on Petri Nets 1: Basic Models. Springer-Verlag.  The World of Petri nets: http://www.daimi.au.dk/PetriNets/