Professional Documents
Culture Documents
DiCesare1994 Chapter TheApplicationOfPetriNetsToThe
DiCesare1994 Chapter TheApplicationOfPetriNetsToThe
DiCesare1994 Chapter TheApplicationOfPetriNetsToThe
1 Introduction
This paper presents work on the application of Petri nets (PNs) for the anal-
ysis and control of vehicular traffic on signalized urban arterial networks. The
problem of urban traffic congestion is ubiquitous and well known. Congestion
gives rise to costs which include increased time delays, air pollution, and fuel
consumption. While urban expressways were considered one solution, the space
and expense for such highways presently make it a prohibitive solution. Thus
the current emphasis is on finding solutions in better traffic m a n a g e m e n t and
control schemes. This, in part, is driven by the development of low cost, high per-
formance technologies such as embedded microprocessors, telecommunications,
image processing, sensors and satellite positioning systems. The vision is an in-
telligent vehicular/highway system. There is a need for innovative systematic
modeling, analysis, performance evaluation and control software development
methods in order to take full advantage of this hardware based technology. The
authors view Petri nets as basis for tools to address the needs of modern traffic
systems and their control.
The focus of this paper is the development of PN models and tools for the
control and performance analysis of signalized traffic intersections and networks
of intersections.
1.1 T h e Traffic N e t w o r k C o n t r o l P r o b l e m
The nature of a traffic system is one of shared control and resource allocation.
The driver controls the motion dynamics of each vehicle, the route of travel
and other choices for moving about the urban area. There are thousands if not
millions of drivers in each metropolitan area, each competing for system resources
to achieve their travel objectives. The resources include road segments, lanes,
and intersection rights-of-way. The traffic system controls and Mlocates these
resources by the use of signal lights, signs, road stripes, barriers and protocols
for driver and vehicle interaction. Control is needed for safety as well as to
provide orderly traffic flow. Among other functions, control attempts to reduce
conflict, prevent collisions, reduce delay and prevent gridlock. We concentrate
here on the traffic signals (lights) as the principal means of control and the work
is aimed at improving traffic flow through networks.
Traffic and traffic control can be viewed as discrete event systems. Traffic is
event driven (asynchronous) as opposed to time dependent. Traffic control may
currently be time dependent but the trend is to make control responsive to flow
and events. Traffic systems exhibit a high degree of concurrency, are character-
ized by shared resources and resource conflicts and a tendency to deadlock and
overflow, and require synchronization, scheduling and control for optimal or even
satisfactory performance.
The idea of applying PNs to traffic control is not new. It at least goes back
to the example of a colored Petri net of traffic lights given by Jensen [8] in
1986. Cois, Fanni and Giua [1] recognized the problem of control modeling as a
synchronization of mutual exclusion nets for each flow and provided a method for
control using the resulting net. Further, Giua [5] demonstrated that this Petri net
control with a scheduler could be easily implemented on a microcontroller. Wang
et al. [20] illustrated simple intersection and network control using timed nets
and performance evaluation through Petri net based simulation using Simnet
[16, 17, 18, 19].
The work cited in the preceding paragraph represents a beginning of the ap-
plication of PNs to the urban traffic problem. The authors believe the remaining
potential for contribution is enormous. The research goal is to have a comprehen-
sive set of Petri net based tools for modeling, analysis, performance evaluation,
control design and direct control code generation. One major advantage of using
nets is that the same model can be the basis for all of these activities related to
traffic control.
The fact that nets are defined graphically as well as mathematically gives
them an advantage over other modeling paradigms. As will be illustrated later,
there are two major types of models, one to specify the control logic and another
to represent the traffic flow for simulation. When the nets are merged, the control
net synchronizes the simulated traffic flow. The hope is that the control net
file may also be down loaded to token players in the traffic control boxes and
respond to traffic and control the signals in the network. This aspect will be
addressed in the future. The models for control and for traffic flow are relatively
straightforward but the issue of traffic engineers using PNs as a specification
tool remains open.
The analysis possible because of the mathematical definition of nets is a great
advantage. While this paper does not address this directly, the possibility exists
of using invariants and other methods to verify that the control logic enforces all
required mutual exclusions, that capacities are not exceeded and that gridlock
will not occur as a result of the logic.
The use of nets for performance evaluation using simulation is one of the
foci of this paper. It would also be interesting to see how well the net based
Markov chain performance approaches [10, 11, 12] could address this problem
or if any insights could be gained by net based symbolic analysis using moment
generating functions [6].
The automatic generation of control code using the Petri net graph as in-
put may be the tool that will ultimately attract practitioners to this approach.
With the net specified, the traffic engineer may be able to validate that it is
logically correct and to obtain performance statistics. Once satisfied, he or she
will be more confident of the control strategies and may appreciate an automatic
translation to code to be used in the field.
This paper presents a model for the control of traffic through an urban net-
work. The model is currently used for performance evaluation of coordinated
and distributed signalization strategies.
3 A P e t r i N e t M o d e l of N e t w o r k Traffic C o n t r o l and
Flow
This section describes an example of how a moderate size traffic network, with six
signalized intersections, as shown in Figure 1, is modeled using PNs. The purpose
of this model is to provide the ability to implement traffic signal control strategies
and evaluate their impact on traffic flow. Since the model is intended for testing,
it allows easy implementation of different signal control strategies and it also
represents the behavior of the automobiles moving through the system. Further,
the developed model is compact, modular, and adaptable. It permits changes
in network topology as well as control over phase sequencing and timing at
each intersection. This model is designed to be implemented on a PN simulator,
providing the traffic engineer with simulated traffic statistics.
[I ' "
tNo h --- i'li---
Jt I I ]i, /ii i
I
I
,I
I
,' ,
Traffic Rates , "i J i~|
I" !
I
30 cars/hr -_- I11
60 cars/hr ...:i.i~i!
,,,,,,,:,:,,-,,\,,,-,,,~300 cars/hr '"~',ILt ~i
Fig. 1. A six intersection network showing mean input traffic flow rates.
3.1 Model Description
The model can be viewed as having two major interacting parts: traffic signal
control and the network traffic flow. These parts are further broken down into
PN modules. The network topology is represented by constructing the Connect
PN module. One function of this module is to represents the links for traffic
flows between intersections. The Control PN describes the operation of each of
the traffic signals. This handles the sequence and logic of the control, i.e., in a
given direction, the signal is green for a period of time, followed by a period
of yellow, then red. This PN also guarantees properties such mutual exclusions,
e.g., no two conflicting directions be given a green signal at the same time. The
Approach PN models the paths and dynamics of the cars into and through the
intersections. There are direct connections to the Control PN where the motion
of the cars is affected by the signals at the intersection. There are also some
feedback connections to provide data to the Control PN concerning the presence
of cars at various locations in the system. The Sources PN represents the interface
between the traffic network being modeled and the "outside world." In this net,
traffic input rates to the edges of the system are defined, and where cars exit
after having passed through the network.
The Connect PN as shown in Fig. 2 allows the user of the system to model dif-
ferent traffic network configurations. This is done by connecting the macroplaces
(double circles) representing signalized intersections using transitions and arcs
as shown. Travel time delays are modeled with randomly timed (exponential in
this instance) transitions. Each macroplace is a subnet, e.g., Approach Subnet
1, which models traffic flow into, through and out of an intersection.
The Approach PN, as illustrated in Fig. 3, models the path by which cars move
through the intersection, the queuing of vehicles at the approaches, and the
vehicle flow time and headway (time between vehicles). At any given time, the
possible paths through the intersection is determined by which signal phase
is active. During each phase, particular movements are given the right-of-way
by the control signals. The traffic signal in this example is a four-phase signal
meaning it has four possible phases that constitute a cycle. An example of what
the movements are for each of the four phases is shown in Fig. 4. The phases
are enabled at transition t2 by the appropriate colored token in place p7 in the
Control PN. The connections to the Control PN implement actions such as a
car stopping at the light when it is red, and moving through it when it is green.
The number of tokens in place p26 represent the number of queued vehicles
at each approach to the intersection. Tokens in the input place p17 come from
the Connect PN or a Source PN. The Approach PN also models the time it
takes a car to move out of the intersection. This time can be approximated
Approach
Subnet 5
"2tol
Approach1
Subnet ~V Approach
Subnet 2 '~1" *]'~o3 ,~[ ~ ~J[V Subnet
Approach
4
"3to4
"1to2
"6to3
Approach
Subnet6
FROM p7
t23
w-;t
Phasewaitl~acu
TO p21
deterministic +
vehicle~ough.
l~le t16
exponential
vehiclethrough-
time 1 t17
(~)~'
Fig, 3. Approach: The intersection Petri net module.
Phase 1 Phase 3
_ _ From Eastand West From North and South
TravellingThrough Travelling Through
VI I-- a~T.m,ng~,gh, ~ Y I I I a..T.,o,ng.~h,
Phase2 Phase4
. . . . FromEastand West . . . . FromNorth and South
~~TumingLeft ~tl F TurningLeft
Pig. 4. The four phases used for all intersections in this example.
~ rateentedng
intersection5
Approach
Subnet
rateentering
intersection6
( ~ Approach
Subnet
r
Fig. 5. Sources: The external traffic input and output Petri net modules.
that determines which movement has the most cars waiting and execute the
phase which permits those cars to pass through the system. Other movements
which have fewer cars waiting might be delayed in the interest of moving the
bulk of the traffic through the system as efficiently as possible.
In order for this model to be useful to a traffic engineer, it requires the use
of a Petri Net simulator. The simulator is a software package which is capable
of executing a Petri Net and keeping statistics on the results. Some additional
useful features would be the ability to augment the functionality of the Petri
Net with code to make mathematical calculations, and for advanced decision
making and optimization. For the rest of this example we will use a simulator
called POSES.
4.1 POSES
POSES [4] is a commercial Petri Net simulator written by Gesellschaft ffir
Proze•automation ~ Consulting mbH, Chemnitz, Germany. The name POSES
is an acronym which stands for Pr~dikat-Transitions-Netz Orientiertes Simula-
tions und Entwurfs System (Predicate Transition Net Oriented Simulation and
Design System). It is capable of modeling colored PNs with up to 250 places
and 250 transitions. It can model deterministic and stochastic transitions with
several possible random functions. POSES also provides excellent capabilities to
augment the Petri Net model with Pascal code to implement complex functions
and decision making. Pascal functions can be attached to the firing of a transi-
tion and used to monitor and modify the current marking of the net, or perhaps
transition delays. POSES creates an executable simulation program which allows
the user to modify various parameters in the PN and take statistics without re-
generating the model for each change. There is also a debugging capability which
permits the user to see exactly what is going on in the net while the simulation
is running.
It is necessary to give some background on the transition firing policies used
by POSES before explaining the specific function of the PN model. POSES uses
a pre-selection firing policy. This means that the token that is going be fired
through a transition is pre-selected at random, instead of being chosen based on
random-switch probability or probability based on all of the enabled transitions.
Also a timed transition in POSES can fire more that one token in parallel. For
example, if a transition T (with fixed time d) is enabled by token A at time
ti, the token A is preselected (not available for any other transitions). At time
Q + d the token A will emerge via the output arc(s) of transition T. If another
token B arrives at time t2, before time tl + d (i.e. tl < t2 < tl + d), it also is
preselected, anti will emerge via the output arc(s) at time t2 + d, unaffected by
the fact that the transition is already processing token A. Note that from time
tl through tl + d, transition T is processing two tokens "in parallel".
FROM t2.
TO 12
extension subnet
max green min green "1
!
tlO r,~-~ FROM t2 =
r I
I
I
/ t12
/
/
t3 /
, /
tll
/
I~ extension
tl 4
~ t7
, \
tl 3
k_
t8
F i g . 6. C o n t r o l .
12
phase 1 is the phase currently being executed. With a token in pl, immediate
transition t l fires putting < 1 > tokens in p3, pS, p6, pT. This enables fixed
time transitions t4 and tl0 (max green and min green) and they begin to fire.
Let us ignore the extension subnet (set off in dotted lines in the figure) for the
time being, assuming it to be inactive. The presence of a < 1 > token in p7
allows tokens which are enabled by phase No.1 to flow through the approach
part of the PN (i.e. the lights for phase 1 are green). Note that whenever the
token is removed from p7 by t7, it is replaced immediately, so for the purposes
of the Control net, it is as if the token remains in p7. At this point no additional
transitions are enabled, so the next event to occur is the end of the tl0 (min
green) firing (min green < max green). T10 completes firing after min green
time and places a < 1 > token in p8. T7 is disabled by the token in p5. Since
we have assumed the extension subnet to be inactive, there are no tokens in p15
to disable t6, so t6 fires and places < 1 > in pg. The removal of the token from
p7 when t6 fires marks the end of the green for phase 1. T7 fires next placing
tokens in pl0 and p12. T9 (yellow) then starts to fire. After the yellow time has
finished, t9 places the < 1 > token into p l l , enabling t8. The firing of t8 marks
the end of phase 1.
T8 is an augmented transition. The augmentation is some functionality con-
tained in Pascal code which runs when t8 fires. This code determines which phase
should be executed next, based on information from the net. The color token
that comes out of t8 (into pl) is the result of that calculation. For instance, if
phase 3 is the next phase that should be executed, t8 will place a < 3 > token
into pl, initiating phase 3. The purpose of the extension subnet is to extend
the green time (up to max green) as long as there are still cars passing through
the intersection. In order to describe the max green function, we will assume a
continuous stream of cars. If there is a constant stream of cars, we will always
have a token in p15, inhibiting t6. This means the phase will continue to stay
green even after t l 0 (rain green) has completed firing. This situation continues
until t4 (max green) completes firing. When it does, it places < 1 > in p6. t3
then fires, removing the tokens from both p5 and p6. This enables t l l to fire,
since we have a token waiting in p7 and p8 since t6 was disabled. Tokens are
then removed from p7 and p8 and the phase goes to yellow as before.
Now a look at the extension subnet. This subnet takes advantage of the
"parallel firing" policy of POSES as described earlier. Every time a car passes
through the intersection, a token is placed in p21. t12 fires immediately placing
tokens in p13 and p15. The token in p13 enables t14 (extension) which begins to
fire. After the extension time expires, the token is placed in p14, t13 is enabled,
and the token removed from p14 and p15. As mentioned earlier, due to the
"parallel firing" of t14, every token that enters this subnet will leave extension
time later, p15 will contain at least one token as long as a car has passed through
the intersection in the last 'extension' time. This is the criterion for the extension
of the phase green time. If no cars arrive for more than 'extension' time, and 'min
green' time has already passed, then the t6 will be enabled and the phase will
go to yellow. If there is a constant stream of cars as mentioned earlier, the phase
13
will remain in green until t4 (max green) fires after ' m a x green' time expires.
The Approach PN (Fig. 3) is considerably simpler than the Control PN.
P17 is the entry place for this intersection. All cars that have to pass through
this intersection come into this place. T2 is enabled only if the direction the
'token' wants to go is enabled by the phase token that is currently in p7. When
t2 fires, it takes the token from p7 and replaces it, takes the token from the
resource place p20 and moves the car to p18. The deterministic time transition
t16 fires, followed by the exponential time t17 as described earlier approximating
the time it takes a car to clear the intersection. T17 finishes firing replacing the
resource in p20, and placing the car in the "out" place p24. All of the tokens
that go through this intersection leave through p24. T h e Connect and Sources
PN's are the mechanism by which the cars are placed in the "in" places of the
Approach PN's and removed from the "out" places. Connect PN handles the
interconnecting links between the intersections.
intersection. The first strategy we will consider is a standard cycle where the
control at each intersection executes each phase in order, once per cycle. The
second strategy determines the next phase to execute based on a weighted func-
tion of the number of cars waiting and the time since the intersection was last
serviced. Both of these strategies are easily implemented in this model by slight
alterations to the code augmented to transition t8 of the Control PN. This is the
transition that determines which phase will be fired next. The simulation was
run with both control strategies with two different weights for the second one.
These runs produced the output data in Tables 1 and 2. The average number
of cars waiting at each intersection was determined by examining the expected
(average) number of tokens held in p26 (wait) of the Approach PN, which is
easily available from POSES. Other data such as the number of firings of tran-
sitions, transition throughputs, percent utilization of places, etc are also readily
obtained from a POSES simulation. The simulation shows a marked difference
between the two strategies. The simulation could be used to further fine tune a
strategy to produce even better results.
With the current trend of application of state of the art technologies to the
development of intelligent vehicle and highway systems, the need exists for for
software tools which can model, analyze, evaluate performance and automati-
cally generate control code. A case is presented for Petri nets to play a major
role in the development of these software tools. This paper concentrated on the
creation of a colored Petri net model to evaluate performance using simulation.
The model achieves modularity through the use of subnets allowing changes to
be made to one component without affecting the models for other parts. The
model allows easy changes to the network configuration, the traffic control logic,
timing and coordination, the model for intersection dynamics and the assump-
tions on network input flows. The use of the model as input to a simulation is
illustrated by an six intersection network example. Results of the simulation for
different control strategies are presented.
Future research will concentrate in two areas: developing innovative intelli-
gent distributed traffic control strategies that take full advantage of advanced
technologies and the development of tools that allow Petri nets be used to their
fullest potential in intelligent vehicle/highway system research and implemen-
tion. These include analysis, synthesis, performance evaluation and control. The
goal is for Petri nets to become a single representation on which an array of tools
are based.
6 Acknowledgements
The authors acknowledge the sponsorship for this research by the New York State
Energy Research and Development Authority under Grant Number 1936-EEED-
POP-93 and the cooperation of Traffic Control Technologies, Inc. and the New
15
References
1. Cois, A., Fanni, A. and Giua, A.: An Expert System for Designing and Supervis-
ing a Discrete Event Model, Proc. IEEE Int. Work. on Intelligent Motion Control
(Istanbul, Turkey), pp. 103-107, 1990.
2. Gronje, W.B.: Analysis of existing formulas for delay, overflow and stops, Trans-
portation Research Record 903.
3. Eiger, A, Chin, S. M.: First Generation UTCS Simulation, Transportation Research
Record 906, 1983.
4. Gesellschaft ffir Prozeflautomation & Consulting mbH, Chemnitz: Das Programm-
sytem POSES, Version 4.31, Germany, 1992.
5. Giua, A.: A Traffic Light Controller Based on Petri Nets, GML Final Project Report,
Department of Electrical, Computer, and Systems Engineering (Prof. F. DiCesare),
Rensselaer Polytechnic Institute, Troy, New York, 1991.
6. Guo, D., DiCesare, F., Zhou, M.: An Analytical Performance Evaluation Approach
for Arbitrary Stochastic Petri Nets, IEEE Trans. Automatic Control, Vol. 38, No.1
2, Feb., 1993, pp. 321-327.
7. Highway Capacity Manual, Special Report 209, Transportation Research Board,
Washington, D.C., 1985.
8. Jensen, K.: Coloured Petri Nets, Petri Nets: Central Models and Their Properties,
Advances in Petri Nets Part 1 Vol. 254, W. Brauer, W. Reisig and G. Rosenberg,
Eds., Springer-Verlag, 1986.
9. Leong, S. M.: Modeling and Analysis of Traffic Adaptive Control Strategies, Doc-
toral Dissertation, Rensselaer Polytechnic Institute, Troy, N.Y., 1992.
10. Marsan,M.A., Balbo,G., Chiola, G., Conte,G., Donatelli,S. and Franceschinis, G.:
An introduction to generalized stochastic Petri nets, Microelectron Reliability, 31
(4) (1991).
11. Marsan,M.A., Chiola,G.and A.Fumagalli: Improving the efficiency of the analysis
of DSPN models, Advances in Petri Nets (1989).
12. Marsan,M.A., Chiola,G.: On Petri nets with deterministic and exponentially dis-
tributed firing times, Advances on Petri Nets (1987).
13. May, A.D.: Traffic Flow Fundamentals, Prentice-Hall, Inc., 1990.
14. McShane, W.R., Roess, R.P.: Traffic Engineering, Prentice-Hall, Inc., 1990.
15. Pignataro, L.J.: Traffic engineering: theory and practice, Prentice-Hall, 1973.
16. TSrn, A.A.: Simulation graphs: a general tool for modeling simulation design, SIM-
ULATION 37:6, 1981.
17. T5rn, A.A.:Simulation modeling using Extended Petri Nets Graphs, in Singh,
M.(ed.). Encyclopedia of Systems and Control. Pergamon Press, Oxford, England
1988.
18. T5rn, A.A.:Decision support by rapid simulation using Simulation Nets, Decision
Support Systems, 6, 1990.
19. T6rn, A.A.:The simulation net approach to modefing and simulation, SIMULA-
TION 57:3, 1991.
20. Wang, H., List, G. and DiCesare, F.: Modeling and Evaluation of Traffic Signal
Control Using Timed Petri Nets, Proc. 1993 IEEE Int. Conf. Systems, Man and
Cybernetics, Vol. 2, pp. 180-185, Le Touquet, France, 1993.