Download presentation
Presentation is loading. Please wait.
Published byAntonia Logan Modified over 9 years ago
1
Modeling
2
Conceptual modeling: Petri nets Implementation: Arena, CPN tools Simulation needed: build models. Start with concepts, then select appropriate tool.
3
Conceptual modeling: objects To be modeled: dynamic system, possessing a state composed of objects from various classes. Two types of classes: case and resource classes. The life cycle of a case object contains object states with transitions in between. Petri net: state machine with source / sink transitions. create dispose choice
4
Resource objects are not created or disposed of. They may be needed for state change of case objects. The start activity may claim one or more free resources. End activity: release some or all resources claimed. A resource can be used by only one case object at a time. Resources Place invariant for each resource type
5
Time dependency Transition of object may take time. Simulation clock indicates current time. Objects possess time stamp indicating availability time. After transition, an object may be unavailable for a while, due to a delay. 11:51 stamp: 11:56 11:5211:56 delay: 5
6
System state: many case objects in various object states with various time stamps. System state change by creation / disposal / update of single object. System 11:5511:56
7
Model with different (sub)classes. Alternative models
8
The two models are trace equivalent; they differ in the moment of choice. This difference is relevant for dynamic systems, but not for simulation models ("batch processing"). Moment of choice
9
Removal of redundant transition. Reduction Here too?
10
Object needing server resource for 5 time units. Start activity Queue model 11:5512:00 constant delay: 5 free Ready after 5 time units
11
Object needing resource for 5 time units. Start activity Queue 11:5512:00 constant delay: 5 free First ready at 12:00, More arrivals, resource still occupied 11:58 second at12:05
12
Object needing one resource for 5 time units. Start activity Two server queue 11:5512:00 constant delay: 5 free More arrivals, another resource available 11:58 First ready at 12:00,second at12:03
13
Ferry model Get on/off board should be restricted. Resource: free place on ferry. Give examples of incorrect behavior. delay
14
Improved ferry model A2B and B2A have lower priority than other transitions.
15
Conceptual model analysis Resource invariants (per resource type) Case invariants (per case type) N Abstract from timing.
16
Liveness analysis Avoid resource locks. The depicted sequence results in a resource lock. No release possible, since all depend on extra claim. It is dangerous to depend on timing to avoid this. Solution: preserve option to terminate before claiming.
17
Resource lock prevention If a resource lock is possible, add test arcs as shown. Last case is able to release claimed resources. No lock!
18
Conclusion (conc. model) Conceptual model: Petri net Places represent case stages and resources. Transitions reflect state changes of case /resource. Checks: place invariants and absence of locks.
19
Classwork A hospital has three treatment rooms and five doctors. Patients needing treatment go to the waiting room and wait there until a doctor is available. The patient and the doctor then have a consultation. In 50% of the cases, a treatment is required. In this case, the patient and doctor need a treatment room to finish the consultation. If there is none, the doctor and patient wait together. In a second model, the patient waits alone. If a room becomes available, the patient is installed there (e.g. by a nurse) and the doctor joins him/her (with priority) when he is available again. Analysis and conceptual model asked
20
Homework If needed, study appendix A of lecture notes and do additional exercises 2,3 on page 17. Assignment Make conceptual model(s) for DCT case. Indicate invariants and show your model to be lock-free.
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.