Keywords

1 Introduction

Traffic and transportation are concepts with substantial financial, environmental, and social implications on the daily activities of a city. These implications are even more significant for smart cities. Not for nothing, smart cities promote efficiency and sustainability as a way to reduce costs, processing timespan of urban activities, resources, wastes, and emissions, as well as to improve the quality of life of the city dwellers.

Decision makers should find ways to achieve these objectives in their sphere of influence. Some of these actors are members of municipal or regional governments with responsibilities on public transportation, emergency systems, or traffic control and regulations, managers of companies with logistic systems, as well as private owners of transportation means. Different technologies provide some help to achieve these goals of efficiency and sustainability, such as sensors, cameras with pattern recognition software, vehicle-to-vehicle (V2V) communications, GPS receivers and navigators, etc.

The confluence of many different factors, such as the cutting-edge devices, large number of actors and transportation means in a city, the strong commercial competition between logistic companies, the increasing expectations of consumers in the quality of products and delivery services, and, in addition, the large number of degrees of freedom, leads to a complex environment, where making efficient decisions is a must but it is not an easy task.

These decisions, when developed on the fly on the real system, can lead to costly financial, environmental, and social implications. Moreover, relying on experienced decision makers may be costly and not always available or even adaptable to a changing environment. In this context, simulation arises as a promising tool for testing decisions before putting them into practice, saving time, financial resources, dwellers’ dissatisfaction, or even social unrest [1,2,3].

Significant effort has been devoted to develop traffic simulators [4], which can be classified according to different criteria, such as:

  1. (a)

    Open-source or proprietary simulators. The first category allows more freedom to configure simulation parameters and experiment design.

  2. (b)

    Continuous-time, discrete-time, or discrete-event simulators. The last category may provide with realistic simulations to a certain extent, while consuming limited computer resources. This approach has been followed to develop the simulator described in this document.

  3. (c)

    Microscopic, mesoscopic, or macroscopic simulators. These categories are associated to a decreasing level of detail in the description of individual vehicles and their behavior. Additionally, less detail, in this case, implies less complexity in the simulator and likely, less computer resources to develop simulations and experiments. The simulator described in this document can be classified as mesoscopic, since it described the vehicles as individual entities but some processes, such as lane changes, are not considered in detail. A mesoscopic simulation is believed by the authors to provide with enough accuracy for the decision problems aimed at, while constraining the computational cost.

A survey on different tools available for traffic simulation is given in [4]. One of the most successful formalisms to represent a discrete event system is Petri nets. A Petri net model presents many useful features, such as a double graphical and matrix-based representation, which allow to represent explicitly the elements and potential evolutions of the system, as well as constitutes a successful way to carry out structural analysis and performance evaluation based on simulation. Petri nets have been applied to the modelling of systems with complex behavior and the development of decision support tools [5,6,7].

Decision making under uncertainty has been addressed successfully by simheuristics, based on Monte Carlo simulation and metaheuristics [8]. It is possible mixing simheuristics, simulation, and Petri net modeling to deal with decision making under uncertainty applied to logistic systems [9].

As a consequence of all these advantages, Petri nets has been selected to develop the simulation model of a traffic system presented in this document. Most of the previous work in Petri net modelling of traffic is devoted to a very active area of research related to the control of traffic lights in intersections using field data provided by sensors in order to maximize the flow, considering unexpected events, such as accidents [10,11,12,13,14]. They focus on a microscopic modeling, very accurate for small models but requiring large computational resources when dealing with large road or street maps.

Moreover, [15] describe a hybrid Petri net traffic model combining macroscopic modeling in roads and microscopic modeling in intersections. The proposed model presents some common features with the model described in the present document. However, high level Petri nets, such as colored Petri nets (CPN), have not considered, leading to a quite large model for representing a whole community’s street map or complex road map.

This document describes a Petri net model of a traffic system for mesoscopic simulation and decision making support, which is in process of being implemented. The main objective of this research is to test the performance of the Petri nets in a decision support system for traffic networks, based on the results, tools, and characteristics of this paradigm, as well as the successful applications of Petri net modelling developed in other sectors. Among the main contributions of the presented model, the Petri net graph and incidence matrix size is not increased as the modelled network grows, since information of the network is read as the model requires it for updating the state of the net in a simulation. Another contribution is the increase in the size of the modelled traffic system, since in most of the references addressing Petri net models of such systems, a microscopic model of a reduced set of crossroads is considered. This use of Petri nets for modelling large traffic networks is also a contribution to general traffic simulators, since many of them are based on programming languages and not in the development of a mathematical model with all the possibilities of this paradigm: structural analysis as well as performance evaluation, integration with tools and models already developed for Petri nets, broad body of knowledge related to Petri nets, possibility of refining the model by top-down modeling, integrating with simheuristics and other approaches for decision making, good insight into the structure of the model by an intuitive graphical representation, open source approach, etc.

The rest of the paper is organized follows: Sect. 2 describes a Petri net model of a traffic network, while Sect. 3 deals with the application of the model for decision making support. Section 4 addresses the conclusions.

2 Petri Net Model for Traffic Simulation in a Smart City. Application Case to a Neighborhood of Tudela (Spain)

CPNs [16] is a formalism that can lead to very compact models in systems such as a traffic system, where many elements differ in features that can be aggregated to the model as attributes of one of its elements: the tokens. CPNs have been applied for performance evaluation and decision making in logistic systems, for example in manufacturing facilities [17]. The Petri net graph of the proposed model of the traffic in a smart city is represented in Fig. 1.

Fig. 1.
figure 1

Petri net model of a traffic system.

Some of the constitutive elements of the model are detailed in the next paragraphs. Firstly, the five places of the net can be described as follows:

P 1 is a place representing a route section, such as a street, street lane, road, or roundabout. A route section is defined as a part of a street, road, or roundabout without intermediate diversions or side-streets. This place can hold tokens representing vehicles of different types.

P 2 describes the capacity of a given route section. A token represents a measure unit of the place, since the place required by a vehicle depends on its type

P 3 contains tokens, representing stopped vehicles. They include parked vehicles as well as damaged or wrecked ones. Notice that a street has also a limited but variable amount of parking places, when considering double parking.

P 4 and P 5 correspond to a red and green traffic light respectively. A token contains information on the location of the traffic light.

The transitions of the Petri net, the second type of nodes, are the following:

t 1 represents the stop of a vehicle in a given route section.

t 2 complements t 1 , since it corresponds to the start of a stopped car.

t 3 describes the motion of a vehicle from a route section to an adjacent one. In this case, the connection between both sections is not regulated by a traffic light. A token from the original route section, representing a given vehicle, arrives at the end of its route section, if there is free place in the next section of its route, transition t 3 fires, updating the attribute of the token representing the route section, where the vehicle is moving. The token remains in place P 1.

t 4 is similar to t 3 ; however, in this case there is a traffic light constraining the traffic from the initial route section to the final one.

t 5 represents the timed change of a traffic light’s color from red to green.

t 6 complements t 5 . This time the traffic light color changes from green to red.

t 7 is associated with the change of a traffic light color as a consequence of a request, for example from a pedestrian or an emergency vehicle on duty by vehicular communication. This transition could also fire in case that field information from sensors or cameras inform of an unbalanced density of vehicles in different directions of a crossroad regulated by traffic lights.

Every place may contain tokens with attributes, called colors, belonging to different color sets. Some color sets considered in this model are:

P 1 and P 3 – Tokens represent vehicles associated to attributes from:

  1. (a)

    Set of types of vehicles: {compact car, sedan, van, light truck, medium truck, heavy truck, bus, emergency vehicle}.

  2. (b)

    Set of types of driving: {conservative, smart, aggressive}.

  3. (c)

    Set of types of energy source: {electric, hybrid, petrol, diesel}.

  4. (d)

    Set of locations, or sections of routes in the modelled traffic network.

  5. (e)

    Set of routes, or sequence of adjacent route sections.

  6. (f)

    Set of priorities: {normal, emergency}.

P 2 – Set of locations.

P 4 and P 5 –Tokens, representing traffic light status, have these color sets:

  1. (a)

    Set of identifiers (ID) of traffic lights.

  2. (b)

    Sets of time delays for activation of red and green lights.

Some information on the street network should be added to the model. The network of a neighborhood of the town of Tudela, Spain, is shown in Figs. 2 and 4(a), where nodes and route sections are superimposed to the street-map. The model of the street-map comprises 56 nodes (circles), 92 route sections (directed arcs), and 4 traffic lights (triangles).

Fig. 2.
figure 2

Street-map of a neighborhood of Tudela with nodes and route sections. (Color figure online)

Figures 3 and 4(b) show elements with their IDs. This area includes roundabouts, one-way and two-way streets, four-lane streets, blind alleys, and parkings.

Fig. 3.
figure 3

Traffic network with IDs of nodes, route sections and traffic lights.

This information, complementing the Petri net model, is stored in a data structure that is independent to the Petri net model. In fact, the model reads the information it needs to evaluate when transitions t 3 and t 4 are enabled and how their firing modify the attributes of the tokens that change of place.

Fig. 4.
figure 4

Roundabout network: (a) street map, (b) IDs of nodes and route sections.

3 Decision Making Support in Smart Cities with Petri Nets

The previous Petri net model can be integrated in a simulation-based decision-making support tool. A decision can be made by assigning values to the decision variables, parameters of the model, then the evolution of the system can be studied by the simulation of its Petri net model. Due to the fact that the decision variables can be chosen among all the parameters of the Petri net model, the associated decision support system is very flexible, allowing to describe decisions associated to different contexts and decision makers.

The simulation is performed by the so called “token game”, describing the dynamic rules of a Petri net evolution. During this simulation one or several performance parameters can be calculated. They can be associated to the decision made as quality parameters. After checking a set of different feasible decisions, their quality parameters can be compared and chosen the best one for the stated problem. This tool can be applied for performing experiments under a “what-if” approach or an optimization process, meaning that some modifications are implemented on the system and the simulation’s outcome allow to foresee the main consequences of such decision.

The experiments to be performed can be adjusted depending on the scope of the decisions to be made. In other words, the responsibilities of the decision-maker would determine the degrees of freedom of the system. Other parameters of the traffic system would be modeled by means of deterministic or stochastic parameters, meaning that they are uncontrollable or out of the reach of the decision maker. Other experiments can change the degrees of freedom, representing realistically the decision making process.

Examples of decision makers are municipal and traffic authorities, managers of companies with logistic services for delivering products, managers of emergency services or public transportation, as well as private car owners. Some examples of decision makers and several related degrees of freedom of a traffic system are given in the following. All these degrees of freedom in the traffic system are modelled by parameters of the Petri net (time delays associated to transitions, initial markings, priorities in actual conflicts) or in the data structure containing information on the route network:

  1. (a)

    For traffic authorities it can be considered the activation/deactivation and timing of traffic lights, installing sensors and cameras to adapt the behavior of traffic lights to traffic conditions, closing streets for demonstrations, parades, or works, changing driving senses, building up new streets, roads or roundabouts, pedestrianization of streets, etc.

  2. (b)

    For logistic planners, routes of every vehicle including the departure time, the amount and types of transported products, number of available vehicles, number and sizes of depots, etc.

In addition to the decision variables it is important to determine the objectives aimed with the decision making process. Some examples are:

  1. (a)

    For traffic authorities, it can be considered the average driving time of emergency or private vehicles for a certain route, pollution and noise levels, traffic density and average speed at certain periods of time, detection of bottlenecks and deadlocks, etc.

  2. (b)

    For logistic planners, it can be taken into account the need of meeting the schedules, as well as minimizing the number of vehicles, delivery time, amount of transported products returned to the depot, number of returns to the depot to reload products, petrol consumption, etc.

The degree of achievement of a certain objective, after a decision, can be evaluated by means of performance parameters, which are calculated while simulating the behavior of the Petri net model. For instance, travel times can be calculated by adding the time a given token spend in each route section, modelled by places P 1 and P 3 . Congestion and actual capacities of streets can be obtained by adding the marking of P 1 and P 3 (#vehicles) or P 2 (vacancies).

4 Conclusions

The concept of smart city constitute a reference of many communities, where the quality of life of dwellers is a priority. The efficient use of resources and the reduction of wastes and emissions, in short sustainability, are key goals in the management of a smart city and the companies that operate in it. In this context, traffic and transportation activities produce a significant impact in the use of resources, and production of emissions, noise, and wastes.

Decision making should aim at improving the achievement of these objectives. However, the behavior complexity of the system under study and the potential impact of wrong decisions in it, suggest the use of simulation tools to test the feasible decisions in appropriately designed experiments.

The Petri net model for mesoscopic simulation described in this document provides with a flexible tool for decision making support. CPNs lead to a very compact model with only 5 places and 7 transitions. A large variety of individual vehicles, traffic lights, as well as elements of a road and street network can be easily added to the model as attributes of the tokens. This feature provides the model with enough generality to be adapted to any city, town or road network, modeling the behavior of traffic with the level of detail of a mesoscopic simulation. In other words, individual vehicles of interest can be considered, but also deterministic or stochastic macroscopic parameters can be added easily, such as traffic density in streets. An example of application is provided with a neighborhood of Tudela (Spain).

In brief, the proposed Petri net model, presents a compromise between simplicity of the model and level of detail in simulation. It presents potential for the development of flexible decision support tools for many different decision makers with impact in the traffic of the modeled road/street map.