Modeling the Permeable Power of the Road on a Semaforized Crossing Using Petri Nets

With the growth in demand and the development of traffic over the last fifty years, the need for the introduction of Intelligent Transport Systems (ITS) is growing every day. With a modern approach they solve complex traffic problems. One modern approach is modeling the dynamics of Petri Nets. The Petri Nets is a powerful graphical and mathematical model for working with discrete systems. This paper describes how using a Petri Net can manage signaled intersections, assist in choosing the best alternative route, or manage an intersection at which an incident occurred. The research was carried out in a real traffic environment, at the intersection of Zagrebačka Road and Bistrička Road in the center of the city Sesvete, by modeling with coloured timed Petri Nets.


INTRODUCTION
Petri Nets represent a graphical method of modeling dynamic systems for the purpose of analyzing their behavior in different circumstances. The name comes from their inventor Carl Adam Petri. They are a class of dynamic systems of discrete events. They graphically describe the structure of the distributed system as a directed hindered graph which contains two types of nodes: locations and transitions associated with directed arcs. Petri Nets allow the definition and simulation of different states and processes in the observed system and to describe the flow of information and objects through the system.
The Petri Net consists of places, crossings and joints. The joints go from place to transition or vice versa, never between places or between switches. The places from which the couplings cross are called the entry points, and the places where the couplings are drawn from the crossing are called the exit points. Sites in the Petri Net can graphically contain a discrete number of branded labels. Petri Nets are a method for abstracting all types of processes. It is important that time and causal relationships should be precisely defined during the description of the process [1]. Formally, the Petri Net is defined as a decorated six: The place (set S) of the transition (set T) differs. No objects can be found in both sets, and there may be a relational flow (arrow F) between two objects (located in different sets). The locals are assigned two natural numbers K and M0, and the arrows are the natural number F. Uses include places that may contain one or more marks. How many brands can contain a place tells the capacity K, and how much it actually contains shows the number of M marks. Unlike the place, the transitions have no additional parameters. They represent active elements because, by their activation, they change the layout of brands in places, which is called the trigger. The arrows indicate the number that affects the mark flow at breaks, and is called the weight of the arrow.
Locations are represented by circles, and the marks are denoted by points inside the circle. If there are a large number of brands in the Petri Net, their number is entered by the number, also within the circle. The capacity is recorded at the circuit and if it is not specified it is of unlimited capacity. Locations can be named for easier understanding and handling, and their name can be used as an ordinal number of positions or a description of what is modeled on a place. The rectangles represent the crossroads and below it is their name. Places and crosses are linked by arrows, and the arrows do not have to be flat. The arrow head is located on the other end of the line F. The arrow has a weight and it is entered with the arrow. If the weight is not specified its assumed value is 1. There are several definitions that can accurately be expressed by Petri Nets [2]: The network is three-dimensional: -C is such that C ≤ P is a configuration (4)

Definition 4:
The Petri Nets is a network of forms that extends the elementary network N = (P, T, F); where: M : P → Z is multiset of place; W : F → Z is the multiset guidelines.

BASIC REQUIREMENTS AND CLASSIFICATION OF PETRI NETS
The first feature of Petri Nets is security. It has been defined as the place of the pi P  marked network N = (P, The security feature of the Petri Net determines that the number of markings in each site should not be greater than one, that any condition may only be filled or unfulfilled. The Petri Net is safe if all the places are safe in it. Limitation refers to the maximum number of markings in the network location. It is defined as the place pi P  of the Petri Net M; The Petri Net is k-limited if all sites in the network are klimited. Limitation can be considered as a function of places that can divide a different degree of limitation [3].
There are five levels of vitality [4]: Level 0: The transition is inactive, it cannot be executed in one transition sequence; Level 1: The transition is potentially active, meaning it can be performed in at least one step; Level 2: The transition to the transition sequence takes place at least n times; Level 3: The transition to the infinite sequence of transitions runs countless times; Level 4: The transition is active, i.e. for each condition there is a sequence of transitions in which the transition will be performed; From this it follows that the network is active if it is level 4 and inactive if it is level 0. The active network includes the possibility of blockage or total stoppage in the modeled system manifested by the existence of a transition that is never performed or the state in which the transition can never be performed. Busy properties occur when the transition is at level 0 or inactive. The Petri Net is inactive if any of its crossings are in deadlock.
The availability feature is important for studying the dynamic properties of the network and for its analysis, which is one of the most important problems. For the network M = (P, T, I, O, μ); -the state µ ′ is directly available from µ if there is a transition tj T  such that δ(µ, tj) = µ ′ If the state μ' is directly available from μ, and μ' from µ ′′ then μ is available from μ. The coverage is related to states that are valid for µ ′′ ≥ µ ′ , and it is expressed by the question of whether the network C with the initial µ and the condition µ ′ state Coverage requires potentially viable transitions. The complexity is similar to availability. Conversion property refers to retaining an equal, initial number of tags in all network states. The network C = (P, Conversion affects network structure because the number of outputs and inputs must be the same. A network that is not strictly conversational can be converted in such a way that the number of inputs and outputs is equal to each transition. The marked Petri Net M = (P, T, I, O, µ); -is conservative with respect to the weight vector w, The Petri Nets, due to the time lags in the transitions, are divided into ordinary Petri Nets, time colored Petri Nets, exponential time Petri Nets and generalized stochastic Petri Nets. The usual Petri Net has no time switches, so it cannot be used for real-time applications. Time slots in Petri Nets are associated with crossings. The transition without delay is called a current or immediate transition to the lock and branch. The degradation rule is defined so that the enabled transition will be activated or deactivated after an overdue time delay if the entry points contain markings so that the condition of the enablement is kept uninterrupted during the delay. Also, there are no tags in the site associated with the inactive branch during the delay. In the exponential time Petri Net all transitions have exponential delays. There are two exponentially distributed times [5].

TIME COLORED PETRI NETS
Time colored Petri Nets (CTPN) are defined as bipartite-oriented graphs displayed over seven: where: P -represents a set of sites; T -is a set of transitions; Co -is a color function related to each element in P∪T is an inadmissible arranged color set in a set of possible colors of Cl. Co denotes every place pi P  set of possible The transition tj T  is enabled by holding the color b j,k , on the M then and only when the following conditions are met:

TRANSPORT PROBLEM -Case Study City Sesvete
Traffic development in the city Sesvete is articulated with the primary interest of solving the problems of transit and local traffic, radially concentrated when passing through the narrow center of the city. Transit traffic to and from the city of Zagreb from the directions of the cities Varazdin, Dugo Selo and Marija Bistrica combined with local traffic flows makes a double barrier. The traffic of the "narrow throat" of Sesvete center represents a barrier to transit traffic when moving in these directions, while at the same time overloading road infrastructure in close proximity to the parallel railway infrastructure. The city Sesvete is divided into two completely separate parts. This problem has been further highlighted in recent years by the construction of a new settlement, Novi Jelkovec. From the traffic industries point of view, to solve the mentioned barriers with functional connection of the city Sesvete in a unified and sustainable entity, it is necessary to find a compromise between the existing situation (unstable construction etc.) and the requirements (urban, architectural, traffic, ecological).
Possible space for transport solutions can be reduced to two mutually dependent segments. The first is the vertical connection of Sesvete. Ie the conversion of traffic areas in the center of Sesvete, primarily for pedestrians, cycling and public transport, thus solving the problems of the vertical connection of Sesvete to the north -south axis. The second segment refers to the shifting of traffic flows from the center of Sesvete and the elimination of traffic congestion occurring on the east -west axis. By analyzing the existing plans and project documentation from the traffic area, the solution for the relocation of the transit traffic and the local traffic from the center of Sesvete (the extension of Branimirova Street -Sesvete North Bend) it is necessary to re-examine the requirements of future plans and sustainable development. To select a traffic solution from Sesvete, it is necessary to make a detailed analysis of the entire transport infrastructure, i.e., a traffic study that would analyze all the alternatives and take into account the plans and needs of future developments in Sesvete [8]. The traffic study based on analysis and simulation models would validate the proposed alternatives and provide a satisfactory transport solution for removing the bottlenecks in transit traffic through Sesvete and linking the separated parts of Sesvete into a unique and functional entity. With an average of about 16,000 daily traffic vehicles, and in excess of 20,000 vehicles on individual days of the week (Friday and Saturday), the traffic situation over this entire 8 km's, and especially the central one between the intersection with Zagrebačka and Bistrička Street, becomes unacceptable for its impact on urban environment, traffic safety and overall quality of life (Fig.  4).

MODELING A TRAFFIC CROSSING WITH TIME COLORED PETRINETS
Modeling of signal system dynamics can be done with time colored Petri Nets. So places represent connected cells and intersections, while brands mark vehicles, and paint marks the route of the corresponding vehicle. In the proposed model: vehicles that change lanes on the road Colored stamps in places represent vehicles. The color of each brand is the direction assigned to each vehicle marked by different paths in which the vehicle can follow the start of a special position. The traffic lights of the general traffic network are defined by the time signal plan, including green, red and yellow lights which are used in most European and American cities. Consideration is given to the lost time and duration of the phase in which all traffic lights at the intersection are red so that vehicles that previously occupied the transition area, and were late to vacate due to the congestion, could leave the intersection. The cycle is defined as the duration of time from the middle of the red light stage to the middle of the next red light stage.

Figure 5 Example of traffic crossing
Shared green for the signal in the direction of travel is defined as part of the cycle when the traffic lights are green in that direction. Further, the phase is the time interval during which the combination of traffic light in the area does not change. During each phase, different flows can be prolonged, where the vehicle stream at the intersection is part of the traffic that all vehicles cross the intersection from the same outgoing link and are directed to the same incoming link at the given stage (Fig. 5). Traffic light management refers to a common signal plan modeled: More precisely, the points from P are phases, and the transitions from T model the sequence of red, yellow, and green phases [9]. The actual traffic intersection shown in Fig. 4 is determined by the six links L i (i = 1, …, 6) with length l 1 = 40 m, l 2 = l 3 = 45 m, l 4 = l 5 = l 6 = 60 m. Link capacities C 1 = 16 PCU s , C 2 = C 3 = 9 PCU s , C 4 = C 6 = 24 PCU s , C 5 =12 PCU s obtained assuming that one PCU (engl. Passenger Car Unit) is debted to l 0 = 5 m and considering the number of strips in each link. Fig. 5 shows the same intersection as modeled with time colored Petri Nets. Places p i , p i ′ , with i = 1, …, 9 are subset of sites that make up the cell of the links, and p i , p i ′ with i = 10, 11, 12 represent the crossing area at the intersection of six cells.
For simplicity, Fig. 5 shows only two places for each strip in the input link and one place for each strip in the output link. Taking into account the number of tapes in each link, L 1 is modeled with 16 link locations, L 2 with 9, L 4 and L 6 with 24 positions. Additionally, links L 3 and L 4 links are only designated for buses and considering that each bus is 3 CPUs, L 3 and L 5 have 4 seats. Referring to Figure 5, the transitions t 0.1 , t 0.2 , t 0.3 , t 0.4 , t 0.5 are the input transitions, and the transitions t 1 , t 2 , t 3 , t 4 are the output transitions. Transition t j with j = 12, …, 21 modifies the change of the two-link link at the intersection, transitions t 1 , t 1 ′ , t 3 , t 6 , t 6 ′ modeling the cars entering the transition area that govern the traffic lights used by the time colored Petri Nets. Cars moving at the intersection are marked with fivecolor marks. Specifically, colors a 1 and a 2 refer to cars following the routes (L 1 , L 4 ) and (L 1 , L 2 ). Further, the colors a 3 and a 4 refer to the vehicles that follow the routes (L 6 , L 2 ) and (L 6 , L 4 ) and the color a 5 indicates the vehicles that follow the route (L 3 , L 5 ).

MODELING THE TRAFFIC LIGHTS
In this paper, four sets of traffic lights are deployed in the directions north (n), east (e), south (s) and west (w). Each set has five light signals: red light signal (R), yellow (Y), green with transit straight (GS), green with passage left (GL) and green with passage right (GR). Phases are deployed in phase a, b, c and d. In phase a, vehicles from the north and south are allowed to turn left and right at the same time, while in phase c, vehicles from the east and west are allowed to turn left and turn right. In phase b, vehicles from the north and south are allowed to go straight, while in phase d, it is allowed with vehicles from the east and west. In order to model a traffic intersection with DSPN (Deterministic and stochastic Petri Nets), the sequence of traffic light signals must form a cycle. Also, the system starts when all the lights red and short yellow light are accepted at the crossings between green and red light. Additionally, in order to increase traffic safety, all traffic lights must be red when all phases in the cycle are completed. Fig. 6  enabled in G 0 . It is worth 5 s after G = 5 where the mark is shifted from p i1 to p i6 and p i7 and instantly enabling and deflating t i5 and t i6 . At that moment, each of p 2 , p 3 , p 6 , p 7 gets the mark. p i4 and p i5 get the mark when t i2 exceeds on n and s, resulting in t i7 and t i8 being enabled. t i7 and t i8 span after 10s when G = 15. Then the mark/token is moved from p i4 and p i5 to p i8 and p i9 by enabling and dropping the t i2 with the mark stored in p i3 . This means that the signal lights GS in the direction n drop when the global time is from 15 to 35. Then it comes down to t i3 resulting in p i2 having a token. This means that the signal changes from GS to Y, and the duration of the GS signal is 20 s. At the same time p 1 , p 4 , p 5 , p 8 get the mark. Then, t i4 and t j1 are enabled and they are thrown down to G = 38 and G = 40. The phase duration of the Y is 3 seconds. The traffic lights fall GL and GR on direction e and w after Y passes to R on the directions n and s. And then the signal lights from directions e and w fall to GL and GR, GS, Y return to their initial states when G = 73. The sensors in this model help gather data and do some of the management tasks. In this example, nine sensors and eight counters have been set up for the purpose of gathering whether there are any incidents and traffic counts. Also, this model allows the calculation of the maximum number of vehicles (V).

Figure 7 Emergency Check Model
Therefore, it is possible to develop a strategy for emergencies using a model of time colored Petri Nets. When the number of vehicles in the RD section reaches V (maximum number of vehicles) emergency signs should be accepted so that GL n , GR s and G w should not be switched on to stop the traffic flow entering the RD. The control model is shown in Fig. 7. When the incident is cleared, there is no mark in p acc , t rec is enabled and ignited so that the p nor contains a token meaning that the traffic signaling for emergencies goes away.

CONCLUSION
One of the major problems of modern humanity is surely traffic and its daily increase. With the growth of traffic and congestion, security decreases, travel time increases, etc. It was noticed that building new roads does not make sense, it is necessary for new technologies to "intelligently" manage traffic to solve the problems mentioned above. The best way has been to introduce intelligent transport systems. Intelligent transport systems try to solve problems with their modern approaches. One such approach is modeling the dynamics of Petri Nets. Petri Nets have proven to be an excellent graphical and mathematical tool for solving many traffic problems. Time colored Petri Nets can be used to model intersections, lanes and cars in the urban area. Time colored Petri Nets can also control intersections. The obtained model is able to provide a sufficiently valid and accurate display of the transport network system using data collected from the detector. Also, Petri Nets have proven to be good for designing models for alternative route selection in large-scale transit transport systems. It is possible to choose a route with good cost and travel time. It is commonly known that due to overcapacity of the roads and the decrease of the intersection flow, congestion is occurring such as in the center of Sesvete.
The analysis and processing of data collected during the observation of the Zagrebačka Road and the narrow center of Sesvete established the overburden of the main road and the congestion of traffic flows at the intersection, especially in peak hours. Big tails of left-wing riders from the Zagrebačka road and Bistrička road in the afternoon, and the right turners on the main road in the morning, are dominated and formed. For this intersection it is recommended to change the signal plan and to extend the cycle of the green signal concept for the described traffic flows. Precisely with the deterministic stochastic Petri Nets, it is possible to adapt the signaling plan to emergency situations, thus reducing the congestion, increasing the intersection flow, and dismantling the main road along the Zagrebačka road (especially in the morning and afternoon hours during the peak load). Petri Nets can help a lot in traffic, but also in other business sectors. Therefore, it is necessary to conduct research and implement models to demonstrate their advantages in the modern era of transport and traffic.