Download presentation
Presentation is loading. Please wait.
1
Exercise class 2
2
Department of Computer Science
Coloured Petri Nets Department of Computer Science
3
The set of places, P=? The set of transitions, T=? The set of directed arc, A=?
5
Give the arc expression function for this example
6
Department of Computer Science
Arc expressions All variables must belong to V An arc expression function E : A EXPRV. Assigns an arc expression to each arc. We demand that Type[E(a)] = C(p)MS for all aA, where p is the place connected to the arc a. Arc expression must evaluate to a multiset of tokens belonging to the colour set of the connected place p a 1`(n,d) if a { (PacketsToSend, SendPacket), … } 1`n if a { (C, TransmitAck), (D, ReceiveAck) … } 1`data if a = (DataReceived, ReceivePacket) } ……… E(a) = Coloured Petri Nets Department of Computer Science
8
Give the marking M of this CPN
9
Department of Computer Science
Markings A marking is a function M mapping each place p into a multiset of tokens M(p) C(p)MS. All token values must belong to the colour set of the place The initial marking M0 is defined by M0(p) = I(p)<> for all pP. Initialisation expression has no variables. Hence it is evaluated in the empty binding Coloured Petri Nets Department of Computer Science
11
Give the initial marking M0
13
Assignment 1 Build a coloured Petri Net by modeling an example of your choice
14
Assignment 2 A driving school is trying to set up an information system to track the progress of the students training and the deployment of instructors. As a starting point for a formal process model the following description can be used. New students register with the driving school. A registered student takes one or more driving lessons, followed by an examination. Each driving lesson has a beginning and an end. Instructors give driving lessons. The driving school has five instructors. Each driving lesson is followed by either another lesson or an examination. The examination has a beginning and an end and is supervised by a driving examiner. In total there are ten driving examiners. For the outcome of an examination there are three possibilities: 1. The student passes and leaves the driving school. 2. The student fails and takes additional lessons in order to try again. 3. The student fails and gives up. Use a colored Petri net to model that one takes ten lessons before taking the exam and people will drop out if they fail three times.
15
Every token in the places begin, c1 , c2, c3, c4, c5, c5, end has a value now. For instance: A person named J. Walker, 18 years old who has taken no lessons and no exams yet is represented as: [id: 'X07'; name: 'J. Walker'; age: '18'; gender: 'male'; nof_lessons: “0”; nof_exams: “0”] The last two attributes are important to the exercise, because we want two know how many lessons and exams a person already have had. The transitions are specified as follows: register: nof_lessons: = 0 nof_exams: = 0 The transition to more and ready can be fused in one transition: more? with the following behavior: if nof_lessons < 10 then produce token for c1 else produce token for c4
16
end_lesson: nof_lessons: = nof_lessons + 1
end_exams: nof_exams: = nof_exams + 1 again has a precondition: nof_exams < 3 set the attribute nof_lessons: = 0, because one has to take another ten lessons before the next exam.
17
Assignment 3 Give more examples of real life situations which are then modeled by coloured Petri Nets.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.