Modeling Worldviews Activity Scanning – Petri Nets and Event Graphs Event Scheduling – Event Graphs State Machines Process Interaction –Block Flow Diagrams.

Slides:



Advertisements
Similar presentations
An Introduction to Petri Nets
Advertisements

Introduction to Petri Nets Hugo Andrés López
A university for the world real R © 2009, Chapter 3 Advanced Synchronization Moe Wynn Wil van der Aalst Arthur ter Hofstede.
Based on: Petri Nets and Industrial Applications: A Tutorial
Interaction Modeling for Testing We would generate the test cases based on our understanding of the interactions that may happen. The source is, again,
IE 469 Manufacturing Systems
Synthesis of Embedded Software Using Free-Choice Petri Nets.
10. Petri Nets Prof. O. Nierstrasz. Roadmap  Definition: —places, transitions, inputs, outputs —firing enabled transitions  Modelling: —concurrency.
Petri Nets Overview 1 Definition of Petri Net C = ( P, T, I, O) Places P = { p 1, p 2, p 3, …, p n } Transitions T = { t 1, t 2, t 3, …, t n } Input.
CS447/ECE453/SE465 Prof. Alencar University of Waterloo 1 CS447/ECE453/SE465 Software Testing Tutorial Winter 2008 Based on the tutorials by Prof. Kontogiannis,
CP — Concurrent Programming 12. Petri Nets Prof. O. Nierstrasz Wintersemester 2005 / 2006.
1 Petri Nets H Plan: –Introduce basics of Petri Net models –Define notation and terminology used –Show examples of Petri Net models u Calaway Park model.
FunState – An Internal Design Representation for Codesign A model that enables representations of different types of system components. Mixture of functional.
Models of Computation for Embedded System Design Alvise Bonivento.
Ref: Peter Haas’ book on Stochastic Petri Nets – resets all timers each scan, prob. deposit Remove on Fire rule – vs Remove on enable (Ref: Fishwick) Simulation.
1 Petri Nets Marco Sgroi EE249 - Fall 2001 Most slides borrowed from Luciano Lavagno’s lecture ee249 (1998)
Petri Net Modeling for dynamic MM composite Object.
Modeling Worldviews Event Scheduling – Event Graphs State Machines Activity Scanning – Event Graphs and Petri Nets Process Interaction – Event Graphs and.
Lab 01 Fundamentals SE 405 Discrete Event Simulation
Mapping Petri Nets into Event Graphs. Alternative Implementations Activity World View Petri Net Formalism: Simple fundamental elements and behavior Concurrent.
Petri Nets An Overview IE 680 Presentation April 30, 2007 Renata Kopach- Konrad.
Time, Clocks, and the Ordering of Events in a Distributed System Leslie Lamport (1978) Presented by: Yoav Kantor.
程建群 博士(Dr. Jason Cheng) 年03月
CHP-4 QUEUE.
Modeling with ordinary Petri Nets Events: Actions that take place in the system The occurrence of these events is controlled by the state of the system.
ETM 607 – Discrete Event Simulation Fundamentals Define Discrete Event Simulation. Define concepts (entities, attributes, event list, etc…) Define “world-view”,
Network Design and Analysis-----Wang Wenjie Queueing System IV: 1 © Graduate University, Chinese academy of Sciences. Network Design and Analysis Wang.
CY2003 Computer Systems Lecture 7 Petri net. © LJMU, 2004CY2003- Week 72 Overview Petri net –concepts –Petri net representation –Firing a transition –Marks.
Modeling. Conceptual modeling: Petri nets Implementation: Arena, CPN tools Simulation needed: build models. Start with concepts, then select appropriate.
Data Structures Using C++ 2E Chapter 8 Queues. Data Structures Using C++ 2E2 Objectives Learn about queues Examine various queue operations Learn how.
Chapter 2 – Fundamental Simulation ConceptsSlide 1 of 46 Chapter 2 Fundamental Simulation Concepts.
Interconnect simulation. Different levels for Evaluating an architecture Numerical models – Mathematic formulations to obtain performance characteristics.
Generalized stochastic Petri nets (GSPN)
Hardware Design and The Petri Net Abhijit K. Deb SAM, LECS, IMIT, KTH Kista, Stockholm.
Petri Nets Lecturer: Roohollah Abdipour. Agenda Introduction Petri Net Modelling with Petri Net Analysis of Petri net 2.
Modelling by Petri nets
Ch5: Software Specification. 1 Petri Nets  Introduced by C. Adams Petri in  Widely used in the modeling and analysis of computer systems.  Basic.
School of Computer Science, The University of Adelaide© The University of Adelaide, Control Data Flow Graphs An experiment using Design/CPN Sue Tyerman.
1 Copyright  2001 Pao-Ann Hsiung SW HW Module Outline l Introduction l Unified HW/SW Representations l HW/SW Partitioning Techniques l Integrated HW/SW.
CSCI1600: Embedded and Real Time Software Lecture 11: Modeling IV: Concurrency Steven Reiss, Fall 2015.
School of Computer Science & Software Engineering
CAP 4800/CAP 5805: Computer Simulation Concepts
1 Petri Nets Ina Koch and Monika Heiner. 2 Petri Nets(1962) Carl Adam Petri.
DEVS-based Modeling and Simulation References: 1.B. P. Zeigler, Hessam S. Sarjoughian, Introduction to DEVS Modeling and Simulation with JAVA: Developing.
High Performance Embedded Computing © 2007 Elsevier Chapter 1, part 3: Embedded Computing High Performance Embedded Computing Wayne Wolf.
Review n System dynamics : A sequence of state transition n model : A set of rules for state transition System S X Y Discrete event system FSM (Automata)
/faculteit technologie management PN-1 Petri nets refresher Prof.dr.ir. Wil van der Aalst Eindhoven University of Technology, Faculty of Technology Management,
High Performance Embedded Computing © 2007 Elsevier Lecture 4: Models of Computation Embedded Computing Systems Mikko Lipasti, adapted from M. Schulte.
Petri-Nets and Other Models
Simulation Examples And General Principles Part 2
Discrete-Event System Simulation in Java. Discrete Event Systems New dynamic systems New dynamic systems Computer and communication networks Computer.
Week 8 Computational Level
Modeling for Testing Interactions
Data Structures Using C++ 2E
Advantages of FSM Their simplicity make it easy for inexperienced developers to implement with little to no extra knowledge (low entry level)
Dr. Eng Amr T. Abdel-Hamid
Clockless Computing COMP
Model-Based Testing Model the system
Week 8 Computational Level
COT 5611 Operating Systems Design Principles Spring 2014
Concurrent Systems Modeling using Petri Nets – Part II
CAP 4800/CAP 5805: Computer Simulation Concepts
CAP 4800/CAP 5805: Computer Simulation Concepts
CSCI1600: Embedded and Real Time Software
COT 5611 Operating Systems Design Principles Spring 2012
Queueing Theory Chapter 1
CAP 4800/CAP 5805: Computer Simulation Concepts
Petri Net :Abstract formal model of information flow Major use:
Chapter 4: Simulation Designs
CSCI1600: Embedded and Real Time Software
Presentation transcript:

Modeling Worldviews Activity Scanning – Petri Nets and Event Graphs Event Scheduling – Event Graphs State Machines Process Interaction –Block Flow Diagrams and Event Graphs

Petri Nets: Definition and Behavior Bipartite Directed Graph with Place (balls) and Transition (bars) Nodes Marking: Multiple Tokens at Places (Indicate State of Resident Entities)

Petri Nets: Definition and Behavior Firing Rule: A transition “fires” when ALL of its input places are marked. A token is removed from each input place and added to each output place.

Petri Nets: Definition and Behavior How might we keep Net Alive?

PN Enrichments for Simulation Non-Zero (Random) Firing Times: Random process indices Colored Tokens: Different classes of transient entities - change colors? Input and Output Counts: Analytical and aggregation production Inhibitor arcs: Prevents firing...resource priorities

When a transition is enabled, a timer starts. After it times out, the transition fires. Remove on Fire rule = remove and deposit tokens when the transition fires. Remove on Enable rule = remove tokens when timer starts, deposit tokens when it times out (used here to save space). Non-Zero (Random) Firing Times: Random process indices

PN Example: G/G/1 Queue s T a T (Random Firing Times) Number in Queue Number of Idle Servers

Petri Nets Example: Tandem queue with limited input t 2 1 t Q A 100

Activity Modeling View Time = Duration of Activity... Things needed to START Activity What you get when FINISH Activity

s T Q 2 s T S S Q B Tandem Queue with Buffer – Production Blocking What about Communication Blocking ?

T a T 1 T PN Enrichments for Simulation Transition Input and Output Counts

PN Enrichments for Simulation Inhibitor Arcs (Fail/Repair Model) t f r t Working Machines Failed Machines

Time Bound Sequence 12 T1T1 T2T2 TcTc Job must start step 2 within T C of finishing step 1. Give a Petri Net for this system? T a between arrivals

Time Bound Sequence...Error? TaTa (timer running) TcTc (timer expired) T1T1 T2T2 (scrap)

Time Bound Sequence...Error? TaTa (timer running) TcTc (timer expired) T1T1 T2T2 (scrap)(kill timer)

Time Bound Sequence...Error? TaTa (timer running) TcTc (timer expired) T1T1 T2T2 (scrap)(kill timer) What if there are no tokens at Q 2 and 1 active transition in T c ? (“Timer expired” place may grab next part from Q 2 early!) Q2Q2

Time Bound Sequence... TaTa (timer terminator) TcTc (timer expired) T1T1 T2T2 (scrap)(kill timer) (zero-time transition) (inhibitor arc) Q1Q1 Q2Q2 R2R2 R1R1 Note: need to set transition priorities to make killing the timer have priority if resource R 2 becomes idle simultaneously with the timer expiring.

Petri Nets - Summary Modeling:  Concurrency and contention (Simultaneous Resource Usage) Analysis:  Reachability tree, CTMC Analysis, and much more!

Mapping Petri Nets into Event Graphs

Alternative Implementations Activity World View Petri Net Formalism: Simple fundamental elements and behavior Concurrent resource usage and contention Event Scheduling View Event Graph Formalism: Simple fundamental element and behavior Concurrency and contention - large model representations

Transitions become timed edges Places become conditional edges PN->EG MAPPING

PN->EG Mapping: eg. G/G/s queue PN: Q s T a T S A

PN->EG Mapping: eg. G/G/s queue PN: EG: Q s T a T S A {A--} {A++, Q++} {Q--, S--} {S++} T s a T

PN->EG Mapping: eg. G/G/s queue PN: EG: Q s T a T S A (S&Q) (A) (S&Q) {A--} {A++, Q++} {Q--, S--} {S++} T s a T

PN->EG Mapping: eg. G/G/s queue (S&Q) (A) (S&Q) {A--} {A++, Q++} {Q--, S--} {S++} T s a T Variable A is unnecessary!

PN->EG Mapping: eg. G/G/s queue (S&Q) { Q++} {Q--, S--} {S++} T s a T Empty Vertex is unnecessary!

PN->EG Mapping: eg. G/G/s queue (S&Q) { Q++} {Q--, S--} {S++} T s a T S&Q conditions redundant too...

PN->EG Mapping: eg. G/G/s queue (Q) (S) { Q++} {Q--, S--} {S++} T s a T Result: a conventional G/G/s queue EG model

P = set of Places, T = set of transitions in PN d(t) = delay time (RV) for transition t  T {Ip(t),Op(t)}= Set of Input and Output Places for t  T {It(p),Ot(p)}= Set of Input and Output Transitions for p  P Step 0.  p  P: define an integer state variable, X(p). Step 1.  t  T: create an edge (O(t), D(t)) with delay d(t). Step 2.  p  P with unique (It(p),Ot(p)) pair: create the edge (D(It(p)),O(Ot(p))) with the condition that all p  Ip(Ot(p)) are marked. (For inhibitor arcs these places must not be marked.) Step 3. Add State changes: for O(t), decrement X(p)  p  Ip(t); for D(t), increment X(p)  p  Op(t). PN  EG MAPPING Advanced homework: Confirm this or find a counter example.

Analytical Methods and Conditions PNs Reachabilty, decidability, liveness, and deadlock EGs State definition, event reduction, priorities, equivalence, boundary conditions, resource deadlock, MIP representations

COMMUNICATIONS BLOCKING (R1 needs empty buffer to Start) R1,R2 = Number of idle resources Q1,Q2 = Number of waiting jobs B = Number of empty buffer spaces... t a,t s1,t s2 = Arrival and processing times...

COMMUNICATIONS BLOCKING: Petri Net AQ1 R1 tata t s1 Q2 R2 B t s2 0 W Q1 = number of jobs waiting in queue 1 Q2 = number waiting in queue 2 R1 = idle resources for step 1 R2 = idle resources for step 2 B = available buffer slots

Each transition becomes a timed edge... tata AQ1 R1 tata t s1 Q2 R2 B t s2 0 W t s1 0t s2

Next, each place becomes a conditional edge... (ALL input places marked is condition) AQ1 R1 tata t s1 Q2 R2 B t s2 0 W (A) (Q1&R1&B) tata t s1 0t s2 ~ ~ ~ ~ ~ ~ ~ (Q1&R1&B) (Q2&R2) (W)

tata Mapping Petri Net to Event Graph Finally, increment and decrement tokens as state changes {A++, Q1++} {Q1--, R1--. B--} {A--}{R1++, Q2++} {R2-- Q2--} {R2++} AQ1 tata t s1 Q2 B t s2 0 W tata t s1 0t s2 ~ ~ ~ ~ ~ ~ ~ (Q1&R1&B) (Q2&R2) (W) R1R2 {W++ B++} {W--} (Q1&R1&B) (A)

{A++, Q1++} {Q1--, R1--. B--} {A--}{R1++, Q2++} {R2-- Q2--} {R2++} tata t s1 0t s2 ~ ~ ~ ~ ~ ~ ~ (Q1&R1&B) (Q2&R2) (W) {W++ B++} {W--} (Q1&R1&B) (A) Final Event Graph: How can this be simplified? (ref: Seila, et. al. Text)

{Q1++} {Q1--, R1--. B--} {R1 ++, Q2++} {R2-- Q2-- B++} {R2++} tata t s1 t s2 ~ ~ ~ ~ ~ (R1&B) (Q1&B) (R2) (Q2) (Q1&R1) A Simplified Event Relationship Graph

Implications PN analysis of Event Graphs State reachability Liveness Deadlock EG analysis of Petri Nets State space Model reduction Equivalence Boundary Conditions Resource Deadlock

Petri Net Simulator

EG -> PN Mapping Remove-on-Fire Rule Remove-on-Enable Rule

Ref: Peter Haas’ book on Stochastic Petri Nets – resets all timers each scan, prob. deposit Remove on Fire rule – vs Remove on enable (Ref: Fishwick) Simulation – Activity Scanning algorithm. (Cancel if transition is disabled!) Inhibitor arc Examples of Petri Net Models – Activity Scanning Models

Multiple server queues?

Note: is an “event graph” – one out-transition per place State dep deposit to d 11 or d 12...

tFtF M B “failing” – need “new” machine get broken machine M,R R,B tRtR “fixing” – need broken machine and repairman get good machine and repairman “Modeling Activities with ERGs” “Implied ERG” tFtF M B R,M B,R tRtR {M--} {B++} M = “new” machines B = broken machines waiting R = idle repairmen {R--, B--} {R++, M++} ~ ~ (B) (R)

“Implied ERG” tFtF M B R,M B,R tRtR {M--} {B++} M = “new” machines B = broken machines R = idle repairmen {R--, B--} {R++, M++} ~ ~ (B) (R) “Reduced ERG – M is not tested” tFtF B R B,R tRtR {B++} {R--, B--} {R++} ~ ~ (B) (R) Exercise: can you further reduce this? hint: assume more machines than repairmen. Define new variable(s).

tFtF B R B,R tRtR {B++} {R--, B--} {R++} ~ ~ (B) (R) tFtF tRtR {B++} {B--} ~ (B<=R) Fix ~ (B>=R) Fail R = total number of repairmen (const.) B = number of broken machines (incl in rep.)

Colored Petri Nets (transitions are enabled by color or tokens)

d 1,i,j = part i waiting Or processing on mach j

GSMP->EGM Mapping (Computer Network) Prop. Reset New Packet Clear End Trans Obs. End Tran. Start Tran

Need Pg 397….

e1 deposits in d2 or d5 with equal probabilty Transition has two times – e 3 or e 5 with 50/50 probs.

NEED PAGE 137 for this example

1 Inhibitor arcs are note strictly necessary (but very convenient!) Add d2 had token iff d1 empty And no tokens if d1 has any.

Measuring Delays Need Example 1.4 of Chapter 2

Need figure 9.2 of section 2.6 without colors