This question asks you to provide the Petri Net (PN) model of the traffic light system that was elicited during the laboratories and which is shown on the right.
Your solution should include:
1. A graph representing your model, i.e., a screenshot showing the initial marking that represents the Default state included in the PDF AND the model as xml file submitted on eClass before the deadline. The xml file must be created with PIPE 4.3.0 that can be downloaded from
https://sourceforge.net/projects/pipe2/files/PIPEv4/PIPEv4.3.0/ Try to make your model as neat as possible.
2. A description of all transitions used in the graph
1. List all transitions and describe what each of them does
The answer to the following three questions
2. Is your model conservative? Explain why.
3. Can we have a deadlock in your model?
4. Can we have a starvation in your model? If yes then show an example corresponding cycle and list the transitions that will starve. Discuss if this starvation could happen in the actual live traffic lights system, and if yes, explain in words how to prevent it.
Your system will use the following definition of states to derive the PN model:
Inputs 1 2 3 G1 G3 P1 P2 P3 M C T1 T2 B3* S2** Valid states for given G, G, G, G, G, G,
input R, R, R, On, On, On, D, On, On, On, On,
System states Off FR FR Off Off OffR, OffR, OffR, Off N Off Off Off Off
Default G R R Off Off R G R Off D On Off Off Off
DefaultB3 G R R Off Off R G R Off D On Off On Off
DefaultS2 G R R Off Off R G R Off D On Off Off On
DefaultB3S2 G R R Off Off R G R Off D On Off On On GreenP3 G R R Off Off R G G Off D Off On On Off GreenP3S2 G R R Off Off R G G Off D Off On On On GreenG1 R R R On Off G R R Off D Off On Off Off GreenG1S2 R R R On Off G R R Off D Off On Off On Green3 R R G Off On R R R Off D Off On Off Off Green3S2 R R G Off On R R R Off D Off On Off On
Green2and3 R G G Off Off R R R Off D Off On Off Off
Emergency Off FR FR Off Off Off Off Off On D/N Off Off Off Off
Night Off FR FR Off Off Off Off Off Off N Off Off Off Off
M denotes malfunction flag; C clock (day vs. night); T1 and T2 are timers
* “B3 = On” only if B3 was pressed before leaving the Default state
** “S2 = On” only if S2 was active before leaving the Default state
The transitions between the states are described by the following transition function table:
IMPORTANT NOTES
• The Petri Net model has to follow the below assumptions
◦ Places represent the objects, not the states of the entire system (in contrast to the Finite State Machine model), e.g. you will have a place for traffic lights 1, traffic lights 2, etc. See below for the list of places that are in the model.
◦ Each transition is enabled based on its input places
▪ You may need to define multiple (duplicate) transitions that will model the same physical input that changes system state, e.g. for the timer in the default state, but which will be enabled in different states
◦ Inputs from the two sensors (B3 and S2) are considered/acknowledged only in the Default state; columns B3 and S2 represent the state of the inputs as read in the Default state. If they were not triggered in Default but became triggered in a subsequent state, then they are not going to be acted upon until after the Default states. It is possible that both inputs, one of the inputs, or none of the inputs are triggered. They are activated (set to On) one at the time, i.e., never at the same time. At the time when Timer1 (T1) expires, the possible configurations are that both inputs, one of the inputs, or none of the inputs are triggered. ◦ The switch to the Night state is possible only in the “Default” states (including Default, DefaultB3, DefaultS2 and DefaultB3S2). Your model has to reset the values in the B3 and S2 columns (set them to Off) when you transition out of the Default state, i.e., when the Night time input is read.
◦ To simplify the model, the Emergency state is disregarded (shadowed cells in the tables above should be ignored). Other than that, the Petri Net model must represent the complete behavior of the system
◦ It is not allowed to modify the above physical representation of the system states (colors of the lights, setup of the timers, malfunction input, etc.)
◦ Remember to list any additional assumptions about your model, if you make any
◦ Use the input and input state abbreviations, as defined in the above table, in your model. Renaming will result in deductions.
◦ Use PIPE 4.3.0
◦ Remember that Petri Nets are nondeterministic
▪ They fire one of the enabled transitions non-deterministically
▪ You do not have the control of which one
▪ One of the enabled transitions is selected randomly, which means that you need to simulate and verify all possibilities