Presentation is loading. Please wait.

Presentation is loading. Please wait.

Ch8. Analysis Joosung, Ko.

Similar presentations


Presentation on theme: "Ch8. Analysis Joosung, Ko."— Presentation transcript:

1 Ch8. Analysis Joosung, Ko

2 outline Introduction What do we want to analyze? Reachability analysis
Structural analysis Place invariants Transition invariants Automated calculation of invariants Simulation Example the taxi company simulation using CPN Tools Classical Petri nets Vs High level Petri nets

3 1. Introduction It is reasonable to make such a process model.
Making a process model can help us to understand it better. A Petri-net-based process model can be used as a specification or a design of a system to be developed. A Petri-net-based process model can also be used for the analysis of a system. In this chapter, we study how to use Petri nets for the purpose of analysis.

4 2. What do we want to analyze?
We can ask some questions to know about some systems. Two question types : qualitative and quantitative questions. If you answer, ‘yes’ or ‘no’ -> qualitative If you answer, ‘number, frequency’ -> quantitative There are two reasons to distinct these questions

5 3. Reachability Analysis
In reachability analysis, the reachability graph of a Petri net is analyzed. With this graph of the Petri net, we can answer a number of qualitative Questions. By inspecting the reachability graph Of a high-level Petri net, we can gain insight into the occupation rates, efficiency, performance and costs of the modeled situation.

6 A model for two traffic lights.
rg1 rg2 r1 r2 go1 go2 g1 g2 or1 or2 o1 o2 x A model for two traffic lights.

7 4. Structural Analysis The number of nodes in the reachability graph on the initial state. It is difficult to use reachability analysis when you have unlimited reachable states. start_production start_consumption producer free consume wait product end_production end_consumption Producers and consumers

8 a. Place Invariants A place invariants assigns to each place a weight, in such a way that no transition can change the weighted token sum. A place invariant represents a kind of preservation law. man woman couple marriage divorce A classical Petri net

9 A business process involving a specialist
free docu end wait done start change busy inside A business process involving a specialist

10 rg1 rg2 g2 g1 r2 r1 go1 x go2 o1 o2 or1 or2 Two traffic lights

11 b. Transition invariants
We use transition invariants to prove that a Petri net returns to the initial state after a certain series of firings A transition invariant assigns each transition t a weight wt in such a way that firing each transition t wt times does not change the state. The weight of a transition is not allowed to be a negative number. A transition invariant does not indicate in which order the transition should fire. Only the number of firings per transition is fixed. Transition invariants are the counterparts of place invariants. We can use invariants in two ways We can verify whether previously determined properties indeed apply. We can derive invariants and subsequently check which properties they represent.

12 A classical Petri net The four seasons winter p1 p4 p2 p3 man couple
divorce marriage woman winter p1 p4 spring autumn The four seasons p2 p3 summer

13 c. Automated calculation of invariants
Place and transition invariants are structural techniques, and the invariants can be checked and calculated efficiently. We can simply describe how invariants can be computed. It is important to note that a Petri net can be represented by a matrix having a row for each place and a column for each T. The incidence matrix of a Petri net can be used for all kinds of analysis. It is not difficult to calculate a basis and there are many techniques to obtain the most interesting invariants.

14 5. Simulation The purpose of simulation is to avoid too costly or dangerous experiments. We study the simulation in the sense of experimenting with a high-level Petri net representing processes of reality. We can run the simulation through the reachability graph. To clarify things we need to discuss the concept “probability distribution” since these are typically used to specify delays in a simulation model. During the simulation all kinds of things can be measured. To determine the reliability of the measurements, the simulation run is often divided into a number of subruns.

15 A uniform distribution of probability for service durations
0.3 0.2 0.1 2 4 6 8 10 duration (min) 2 4 6 8 10 duration (min) 0.1 0.2 0.3 probability A negative exponential probability distribution for the time in between two arrivals

16 a. Example: The Taxi Company
color Car=string arrive Car environment gas_station drive_on depart HS HS Page main modeling the gas station and its environment

17 fun len(q:Queue) = if q=[] then 0
ln arrive Car drive_on c [len(q)<3] put_in_queue queue Queue q^^[c] q [] start () Pump pump_free TCar end out depart c::q fill_up color Car = string; color Pump = until; color TCar = Car timed; color Queue = list Car; var c:Car; var q:Queue; fun len(q:Queue) = if q=[] then 0 else 1+len(tl(q)); Page gas_station

18 b. simulation using cpn tools

19 Page gas_station in CPN Tools
ln arrive c [len(q)<3] [len(q)>=3] c Car put_in_queue q drive_on q^^[c] q [] queue q 1 1’0 Queue q c::q start () () c fill_up Car pump_free Pump c () 1 end c depart drive_on out out Car Car Page gas_station in CPN Tools

20 Page environment in CPN Tools.
1 1 (“car_”^Int.toString(i),IntInf.toInt(time())) i counter create arrive out Car percentage 1 1’0 (i*100)div(i+1) INT 1 1’0 i+1 k i c count_do drive_on record_depart_on in INT Car 1 1’0 count_d INT 1 1’0 i average_d i+1 k INT 1 1’0 i I div(i+1) (cid,t) j sum_do depart record_drive_do in INT Car Page environment in CPN Tools.

21 The top level of the simulation model
arrive Car environment gas_station drive_on depart gas_station environment The top level of the simulation model

22 The effect of adding three extra places to the waiting space.

23 6. classical petri nets Vs high-level petri nets
The classical Petri net allows for many types of analysis and many questions are tractable To gain insight into applicability of analysis methods to high level nets we discuss each f the three extensions and their effect on analysis The extension with color increases the expressive power of Petri nets considerably. The extension with time adds a dimension to the Petri net The extension with hierarchy allows for the construction of large and complex models but does not complicate analysis.

24 Definition of top-level page five _philosopher
left = CS2 right = CS1 color BlackToken = unit; var b:BlackToken HS () CS2 () CS1 BlackToken BlackToken PH1 HS PH2 PH5 philosopher left = CS1 right = CS5 HS philosopher left = CS3 right = CS2 CS5 CS3 () () BlackToken BlackToken CS4 () PH4 PH3 HS HS philosopher left = CS5 right = CS4 philosopher left = CS4 right = CS3 BlackToken Definition of top-level page five _philosopher

25 Thank you


Download ppt "Ch8. Analysis Joosung, Ko."

Similar presentations


Ads by Google