1 / 20

Modeling

Modeling. Modeling. Simulation needed: build models. Start with concepts, then select appropriate tool. Conceptual modeling: Petri nets. Implementation: Arena, CPN tools. Conceptual modeling: objects. To be modeled: dynamic system , possessing

marenm
Download Presentation

Modeling

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Modeling

  2. Modeling Simulation needed: build models. Start with concepts, then select appropriate tool. Conceptual modeling: Petri nets Implementation: Arena, CPN tools

  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. choice dispose create

  4. Resources 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. 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 11:52 11:56 stamp: 11:56 delay: 5

  6. System System state: many case objects in various object states with various time stamps. System state change by creation / disposal / update of single object. 11:55 11:56

  7. Alternative models Model with different (sub)classes.

  8. Moment of choice 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").

  9. Reduction Removal of redundant transition. Here too?

  10. Queue model Object needing server resource for 5 time units. 11:55 12:00 free constant delay: 5 Start activity Ready after 5 time units

  11. Queue Object needing resource for 5 time units. 11:55 12:00 11:58 free constant delay: 5 Start activity More arrivals, resource still occupied First ready at 12:00, second at 12:05

  12. Two server queue Object needing one resource for 5 time units. 11:55 12:00 11:58 free constant delay: 5 Start activity More arrivals, another resource available First ready at 12:00, second at 12:03

  13. delay Ferry model Get on/off board should be restricted. Resource: free place on ferry. Give examples of incorrect behavior.

  14. Improved ferry model A2B and B2A have lower priority than other transitions.

  15. Conceptual model analysis Abstract from timing. Resource invariants (per resource type) Case invariants (per case type) N

  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.

More Related