scieee AI-readable full text Open interactive document viewer

Real-time forecasting of traffic conditions on road networks

Tiago Luis Abreu Pinho

Full text

FACULDADE DE ENGENHARIA DA UNIVERSIDADE DO PORTO Real-time forecasting of traffic conditions on road networks Tiago Luis Abreu Pinho Mestrado Integrado em Engenharia Informática e Computação Supervisor: Prof. Rosaldo José Fernandes Rossetti (PhD) July 28, 2014 Real-time forecasting of traffic conditions on road networks Tiago Luis Abreu Pinho Mestrado Integrado em Engenharia Informática e Computação Approved in oral examination by the committee: Chair: Prof. Carlos Manuel Milheiro de Oliveira Pinto Soares (PhD) External Examiner: Prof. Artur José Carneiro Pereira (PhD) Supervisor: Prof. Rosaldo José Fernandes Rossetti (PhD) July 28, 2014 Abstract In the present, most of the cities and metropolitan regions face the problem of having traffic congestions on their road networks, being this an important challenge and topic for the Intelligent Transport Systems (ITS). A hypothesis of solution to mitigate this problem is through the development of traffic forecasting techniques using historical data, that would help to take better traffic management decisions regarding the network’s state in a close future. Thus, this dissertation focus on the study, test and analysis of techniques to forecast the traffic conditions on road networks (motorways) in real-time, based on Simulation (model-driven approach) and Artificial Neural Networks (data-driven approach), that would serve as basis for a new module in the Intelligent Transport System developed by Armis. The chosen simulation technique was the microscopic approach using the open-source simulator SUMO (Simulation of Urban Mobility). Regarding the data-driven approach, it was decided to use artificial neural networks (ANN), firstly developing a normal model and then creating a combined neural network with fuzzy logic, to learn and predict the traffic patterns. For testing these techniques it was used real data collected from traffic detectors located in VCI (Via de Cintura Interna) motorway, a main inner-ring road of Porto. The executed tests were made using a test-bed corresponding to a junction node of VCI motorway. i ii Resumo Hoje em dia, a maioria das cidades e grandes áreas metropolitanas enfrentam o problema de ter congestionamentos nas suas redes rodoviárias, sendo este um desafio importante para os sistemas de transporte inteligentes (ITS). Uma hipótese de solução para atenuar este problema é através do desenvolvimento de técnicas de previsão de tráfego usando dados históricos, que poderão ajudar a melhorar as decisões de gestão de tráfego tomadas, tendo em conta o estado da rede num futuro próximo. Assim, esta dissertação foca-se no estudo, teste e análise de técnicas para previsão das condições de tráfego em redes rodoviárias (auto-estradas) em tempo real, baseando-se em Simulação (abordagem model-driven) e Redes Neuronais Artificiais (abordagem data-driven), que servirão como base para um novo módulo do ITS desenvolvido pela Armis. A técnica de simulação escolhida foi a abordagem microscópica através do uso do simulador open-source SUMO (Simulation of Urban Mobility). Em relação à abordagem data-driven, optou-se por utilizar redes neurais artificiais (RNA), desenvolvendo primeiro um modelo normal e depois um outro modelo combinado com lógica fuzzy, para aprender e prever os padrões de tráfego. Para testar as técnicas desenvolvidas foram utilizados dados reais de sensores de tráfego existentes na auto-estrada VCI (Via de Cintura Interna), localizada na área metropolitana do Porto. iii iv Acknowledgements First of all, I would like to thank my supervisor, professor Rosaldo Rossetti, for the support and guidance given during the whole process of this thesis. I want also to thank to LIACC and its members for receiving me during the first stage of this project and for the knowledge and advices transmitted, as well to Armis which received me in its facilities in the last two months, in particular to Ricardo Coelho. In addition, I am thankful to my colleges Eurico and Anya for the exchange of ideas and help at solving some problems during the implementation phase, and indubitably to Guilherme Soares and José Macedo for the great support and guidance given during my stay at Armis, where they were a kind of co-supervisors. At last but not the least, I want to thank to the most important elements of my life, my family and friends. Tiago Luis Abreu Pinho v LIST OF FIGURES 5.29 Results of the test of fuzzy ANN using Sigmoid function - two hidden layers . . . 54 5.30 Results of the test of fuzzy ANN with Tanh function - one hidden layer . . . . . . 55 5.31 Results of the test of fuzzy ANN with Tanh function - two hidden layers . . . . . 55 5.32 Results of the test of fuzzy ANN with Log function - one hidden layer . . . . . . 56 5.33 Results of the test of fuzzy ANN with Log function - two hidden layers . . . . . 57 xii List of Tables 3.1 Description of inputs used by the neural network . . . . . . . . . . . . . . . . . 17 3.2 Description of fuzzy sets for velocity input . . . . . . . . . . . . . . . . . . . . . 18 5.1 Error rates obtained in the tests with DFRouter . . . . . . . . . . . . . . . . . . 37 5.2 Error rates obtained in the 1st experiment with OD matrices . . . . . . . . . . . 40 5.3 Error rates obtained in the 2nd experiment with OD matrices . . . . . . . . . . . 43 5.4 Error rates obtained in the accident experiment with OD matrices . . . . . . . . . 46 5.5 Description of activation functions tested . . . . . . . . . . . . . . . . . . . . . . 46 5.6 Epochs and time spent per each ANN to finish the training - Sigmoid function . . 47 5.7 Epochs and time spent per each ANN to finish the training - Tanh function . . . . 48 5.8 Epochs and time spent per each ANN to finish the training - Log function . . . . 51 5.9 Error rates obtained in the tests with normal ANN . . . . . . . . . . . . . . . . 51 5.10 Error rates obtained in the tests of an incident scenario with normal ANN . . . . 53 5.11 Epochs and time spent per each fuzzy ANN to finish the training - Sigmoid function 53 5.12 Epochs and time spent per each fuzzy ANN to finish the training - Tanh function 55 5.13 Epochs and time spent per each fuzzy ANN to finish the training - Log function . 56 5.14 Specifications of computer used to test the simulation and the neural networks models........................................ 58 A.1 Data values used in the tests with dfrouter ..................... 67 A.2 OD matrix used in the experiments with OD2trips ................. 70 A.3 OD matrix used in the experiments of incident scenario with OD2trips ...... 71 xiii LIST OF TABLES xiv Abbreviations ANN Artificial Neural Network CSV Comma Separated Value GUI Graphical User Interface ITS Intelligent Transport System OD Origin-Destination OSM Open Street Map SUMO Simulation of Urban Mobility VCI Via de Cintura Interna XML Extensible Markup Language xv Chapter 1 Introduction 1.1 Context Nowadays, most of the cities and metropolitan regions face the problem of having traffic congestions on their road networks, affecting daily thousands of citizens in their home-job routes which waste time in traffic jams. Therefore, this is the main problem for urban transportation planners and the stakeholders of the traffic management, which seek to solve it through the use of systems for manage the traffic networks, formally called Intelligent Transport Systems (ITS) [RLT11]. These network traffic management systems are dynamic structures where a small disturbance or event may result in channels block which leads to time and money losses. Hence, it is required to take decisions regarding the network’s state in a close future. In order to do that it is necessary to use forecasted measures from historical data to predict how it will be the network in a near future. The first theories of traffic prediction applied to road networks date back to 1950s, however only from 1990s started to have a greater focus on traffic forecasting and the acknowledge of its potential use and benefits to road networks management. Thus, this dissertation arises from the need of the current transport management systems to have a traffic forecast module. The main goal is to compare and evaluate two different forecasting techniques: simulation (model-driven approach) and neural networks (data-driven approach). The data used for testing these techniques was real traffic data from Porto motorway network, provided by Armis. This project was launched by Artificial Intelligence and Computer Science Laboratory (LIACC), which belongs to Faculty of Engineering of the University of Porto (FEUP) and had the collaboration of Armis, a company with a great experience and know-how in development of Intelligent Transport Systems (ITS). 1.2 Motivation and Goals Forecast in real-time the traffic conditions on road networks has high importance and utility for Intelligent Transport Systems (ITS) as well for navigation systems because it allows to inform and 1 Introduction help the travellers to choose the best way (closest/fastest) to reach their destination, and consequently have a better management of the road networks. Hence, the motivation for this project is supported in three topics: first and the main one is scientific since “Traffic Forecasting” as well “Traffic Management” are hot topics among scientific community, being the basis of several studies and projects developed since 1990s. In fact, more and more research projects focusing on this subjects have been carried out in the last decade, proving that it is a topic which is worth to explore, with still an open-space for improvements and innovations. The second topic is the technological motivation, due to the fact that “Big-Data” and “Data- Mining” are concepts that have been very used nowadays and on the last 30 years. We live in an information era where the amount of data collected is increasing all the time and it is necessary to properly handle that data through the use of "data-mining" techniques, in order to analyse it and take the benefits of gathering such information. Also, currently, traffic management already makes use of "big-data" by collecting data about traffic conditions through the several existing tools for monitor and control road density, from traffic detectors to cameras or even radars. And to finish there is the applicational motivation of having the challenge to improve Armis’s ITS by researching and analysing the addition of a new intelligent module that would be able to better assist in the decisions made about traffic management. Therefore, this project aims to study, analyse and develop techniques for forecast the traffic conditions on road networks (motorways) in real-time based on Simulation and Artificial Neural Networks, that would serve as basis for a new module in the Intelligent Transport System developed by Armis. This new module should be able to work with a high volume of data coming in real-time, and with that predict traffic in any kind of road networks. About the specific goals of the project, they are: 1. define a test-platform, using a pilot scenario case based on the junction node of Paranhos, which is part of VCI (Via de Cintura Interna) motorway. 2. implement the prediction algorithms firstly using SUMO (Simulation of Urban Mobility), a microscopic traffic simulator software, to deploy the model-based techniques. And later, focus on data-driven approaches using Artificial Neural Networks (ANNs) with Fuzzy logic to create a traffic predictor. 3. execute a set of tests to evaluate the two implemented models using the defined test-platform. 4. compare and analyse the efficiency of the developed algorithms with the expected results, in order to recommend which of those techniques are more suitable to Armis’ system. 2 Introduction 1.3 Organisation of the Dissertation Besides this first chapter, where the context, motivation and goals of the thesis were explained, this dissertation has also the following chapters: In chapter 2, is presented the literature review made, describing the state-of-art among simulation and data-driven research communities, presenting the main existing techniques. The related works done in these subject are also presented. In chapter 3, is presented the theoretical part of the thesis, by establishing the context and objectives, enumerating the technology requirements and describing the chosen technology. In chapter 4the implementation stage developed during the thesis is explained. Chapter 5covers the testing phase made, along with the analyse and evaluation of the achieved results. To finalize, chapter 6finishes the dissertation by presenting the final remarks and future work. 3 Introduction 4 Chapter 2 Literature Review This section presents the concepts of Simulation applied to road traffic domain and Artificial Neural Networks which are covered by the project, in order to enumerate the differences between the existing methods and to help the reader to better understand the approached contents. It starts by defining the existing simulation models: macroscopic, mesoscopic, microscopic and nanoscopic, and their most used algorithms; as well the data-driven technique used in this project: Artificial Neural Network. Finally, it is presented a list along with a brief description of the past projects developed that are related to the subject of this thesis. 2.1 Background 2.1.1 Simulation models on road traffic domain Simulation models can be classified into four different categories, according to the level of detail: macroscopic, mesoscopic, microscopic and nanoscopic. The macroscopic approach has the lowest level of detail, depicting traffic through its density per road section. In contrast the microscopic approach provides a higher level of detail by defining traffic through each existing pair of drivervehicle in the network and the interaction between vehicles. Nanoscopic approach is a recent model that goes even further on detail by considering the vehicle’s characteristics and its parts like the type of engine, tyres used and fuel consumption. In figure 2.1 is shown the difference among the models: Macroscopic Approach This kind of model analyses traffic conditions by grouping data per each road section in the network, and describes the traffic flow by using vehicles’ density and average velocity. Thus, it is based on the traffic flow-rate at a certain part of network. Due to the fact that the analysis of the 5 Literature Review Figure 2.3: Example of neural network structure: 4 inputs, 1 hidden layer (3 neurons) and 1 output About fuzzy logic, it is a probabilistic reasoning technique first presented by [Zad65], which considers data as knowledge under uncertain domain, making use of vagueness and focusing on the way an object belongs to a vague description group. This approach is suitable to use with non-deterministic challenges. 2.2 Related Works Once introduced in the previous section a description about the types of simulation and data-driven techniques to be used in the thesis context, this section presents the past projects developed whose field of study is related to the subject covered by this project. 2.2.1 Macroscopic approach This paper [HB05] presents a new extension of the macroscopic model Aw & Rascle, that aims to improve the efficiency of the original model when applied on junction nodes of roads. The BLX and the S model were the target of a comparison with the methodology MPC (Model Predictive Control) made by [LDXH12]. In the paper [RM13] it is described a model that was the result of the combination between the macroscopic model LWR and the machine-learning technique of Artificial Neural Network, showing that it is feasible to combine model and data-driven techniques and apply it to traffic forecasting. 2.2.2 Microscopic approach Microscopic techniques have been widely used among traffic forecasting projects. The papers [ES97] and [SNW01] focused on the creation of a simulation tool based on the Nagel-Schreckenberg Cellular Automata model that would improve the accuracy of the original one. A comparison between two microscopic models, the IDM (Intelligent Driver Model) and Linear was made by [BRK11], in order to identify the strengths and weakness of each, and it concluded that there is not 12 Literature Review such a model suitable to describe fully the traffic state, varying from each case in study. Another test and comparison was made by [HHST02], but this time between the microscopic car-following model IDM and a macroscopic technique. An innovative hybrid model tested on a Tokyo motorway was brought by [KFT+05], that combined the microscopic technique of Cellular Automata with the data-driven approach of Fuzzy Clustering to forecast in short-term. In [TLJ10] a road network data model of Memphis city was developed using the simulation technique IDM. Also, in [RI12] a comparison between two microscopic simulators, AIMSUM and SUMO was made, using a junction node of a motorway in Stockholm. 2.2.3 Mesoscopic approach About the use of mesoscopic techniques among traffic forecasting projects, there is the work developed in the paper [Sav11] where an example of using mesoscopic approach combined with a technique commonly used in logistics, called discrete-rate approach, was implemented using an urban scenario based in the map of Riga city. The paper [Sav12] focus also in the analysis of that subject, presenting some examples. 2.2.4 Nanoscopic approach A nanoscopic approach is more suitable for automation and robotic applications than traffic forecasting. An example of it is the simulation model presented in [MSK+11], which is a nanoscopic approach to simulate the power-train of an electric bus. The framework is composed by a nanoscopic model which is used to depict the power-train of the bus which is coupled to the microscopic SUMO simulator, responsible for depicting the surrounding traffic scenario (the other vehicles in the network). This highly detailed simulation allows to depict the bus in a great realistic way, by considering all the characteristics of the vehicle, for instance the engine efficiency, the friction forces against the vehicle, the vehicle’s mass or the braking energy generated. In paper [DP08] it was presented an innovative agent-based model, focused on driver’s behaviour, to be used in nanoscopic simulation. The model makes use of fuzzy neural networks to depict the human decisions made when a person is driving a vehicle. Also, an approach over the potential advantages of using nanoscopic techniques was carried out by the study presented in the paper [Ni06]. 2.2.5 Artificial Neural Networks The use of neural networks in traffic forecasting has become a prominent option among the research community since 1990s, when the papers [DKB93] and [DKB94] presented the first studies about using neural networks to recognize and detect traffic patterns. Also, in paper [DC97] it was explored the development of a model to predict traffic on motorways using neural networks. [Dia01] also tested the use of ANNs in short-term (up to 15 minutes) traffic forecasting on a short segment from a motorway in Australia. In Turkey, [BB10] focused to predict traffic in mid-term (15 minutes to 1 hour) on a congested urban scenario. [Lop12] deeply explored the use of ANNs 13 Literature Review to forecast traffic anomalies (caused by incidents) on a motorway, by testing different training techniques like back-propagation, resilient back-propagation and radial basis function (RBF); also experimented different architectures for the network (Linear, Space-based and Time-based). Furthermore, as referred before, more recently it has been developed hybrid models that combine ANNs with macroscopic techniques in order to predict traffic. A good example of it is the work developed by [FC13], that created an integrated model that uses ANN to predict the traffic state under normal conditions, and the second-order macroscopic algorithm Aw & Rascle to forecast the traffic conditions when an anomaly occurs. A slight different model was presented by [RM13], where an ANN is used to get trained from the historical data and its output is then simulated using the macroscopic model LWR. 2.2.6 Fuzzy logic Along with the use of ANNs in traffic prediction, several papers have recently focused on testing the combination of ANNs with fuzzy logic, and taking advantage of the capacity to cluster data by pattern sets. An example is the model presented by [YWXW02], where a neural network system combined with fuzzy logic was used to predict traffic on urban roads. The fuzzy logic was used within a model that was in charge for clustering the input data into groups according to traffic patterns, and then pass the clustered sets as an input to the ANN. In paper [ZY08] the fuzzy logic was used in a different way, since the input data for the fuzzy model was the error rate of timeseries forecasting methods. Basically the traffic was forecasted using two different time-series techniques and the combination of the obtained error rates was categorized into a fuzzy set. The application of fuzzy sets in traffic domain can be not only to forecast traffic but also to incidents detection like the model created by [XKHP98], where an adaptive on-line fuzzy neural network was developed to identify traffic incidents. A similar project was later presented in [XHM08], where it was implemented a fuzzy logic-based system to detect incidents on a motorway, by using the velocity and its variation between adjacent measures to group data and then infer the probability of an incident to occur. Another example of a different application of fuzzy logic is the model created by [CQL09] for traffic control. The model consists in an intelligent traffic lights control system that builds its knowledge base from the traffic state that is characterized by fuzzy sets. 2.3 Summary Once finished the bibliographic review, in this chapter it was described the four existing simulation techniques, the advantages and disadvantages of their usage, as well the running procedure behind neural networks and fuzzy logic, and the potential benefits when applied to traffic forecasting. It was also made a presentation of the state-of-art, and what has been developed so far at each of this subjects of simulation and data-driven domains. After making the state-of-art review, it is stated that there is open-space to explore in the area of traffic forecasting on road networks, which is the subject of this project. 14 Chapter 3 Methodological Approach This chapter starts by presenting a detailed description of the problem, and then exploring the analysis made to identify the requirements. Afterwards, the proposed solution for the implementation of the model- and data-driven forecasting is introduced, presenting the plan and the way to do it. In the end, it is shown an overview of the technologies to be used. 3.1 Problem Statement Traffic prediction in real-time on road networks has acquired high importance in the current ITS, due to the fact that if there is the chance of being able to predict, with a fair degree of confidence, the state of network in a close future that would lead to an improvement in the performance of road networks management. Basically, the existing techniques to implement traffic forecasting are through the use of simulation or data-driven approaches. This dissertation aims to develop and test some techniques from these two different approaches, in order to analyse the benefits of applying traffic forecasting on ITSs. Hence, the selected simulation technique was the microscopic approach because, despite the high computational consumption that it might require, it is the approach that allows to simulate traffic and its behaviour in a more realistic way. Regarding data-driven approaches, the option made was to use artificial neural networks (ANN) with fuzzy logic, since it is a model that can be trained and "designed" according to the actual data, and when properly trained it has a high level of reliability [RM13]. To conclude, both approaches will be tested using real data and their performance compared. 3.2 Requirement Analysis Before starting the implementation, it was necessary to identify the technology requirements for this thesis. Starting with the traffic simulation, the traffic simulator chosen was SUMO, which is one of most used microscopic simulators among research community, and the fact that is 15 Methodological Approach lightweight and open-source made it the best option. The road network used was the Porto motorway, Via de Cintura Interna (VCI), and a further description of it can be found in section 4.1. Its map was loaded using the file format OpenStreetMap (.osm extension), through the open-source maps service OpenStreetMaps [Fou14]. An edition of the map was made, to correct the number of lanes in some road segments, add some missing traffic signals and information in some road sections. This edition process was made using the JOSM (Java OpenStreetMap) software, an editor for maps with .osm format. To develop the artificial neural network, it was decided to use the machine-learning framework Encog, an open-source tool that provides several training methods and architectures for implementation. The version used was the one for Java, through the existing plugin for the IDE (Integrated Development Environment) Eclipse. To conclude, for testing both models it was used actual data, collected from real traffic detectors placed in VCI, and provided by Armis. 3.3 Proposed Solution 3.3.1 Forecasting with Simulation As referred before, for implementing the traffic forecasting using simulation it was concluded that the microscopic approach was the model more suitable for this thesis context, since it allows to depict traffic in a very deep and realistic way. Thus, for testing the simulation model it was decided to use a test-bed area, with small dimensions, that consisted in a segment of the complete network. The selected area was the Paranhos junction node, which is part of VCI motorway, and its access ramps. This node was considered to be a good option for testing, from the fact that is a generic node, located in a busy area of Porto with a high density of traffic, that serves as an access to an university campus, a hospital, a wide residential area, also as a route in direction of city’s centre. Regarding the data used for test, it was gathered a set of measures corresponding to the traffic state during rush-hour periods from normal days i.e. where there was no reported incidents neither it was weekend or holidays season. A detail description can be seen in chapter 5. Therefore, the implementation phase was defined to be composed of four phases: 1. Conversion of the map from OpenStreetMap format (.osm) to SUMO format network (.net.xml) and making the necessary adjustments in some road segments; 2. Definition of traffic demand that would be used as input for the simulation; 3. Execution and test of the developed solution; 4. Calibration and validation of the model. 3.3.2 Forecasting with Artificial Neural Networks About the implementation of forecasting using artificial neural networks it was also decided to develop and test it with the selected test-bed area of Paranhos junction node. Concerning the 16 Methodological Approach structure of the network, the ANN was constructed with the Multi-layer feed-forward model, which is a multi-layer version of perceptron network model and uses supervised learning to train the network. The learning technique chosen was the supervised training method called Resilient Back-propagation. This decision was made regarding the conclusion presented by [Hea09] where it is proved that generally a resilient propagation is easier to implement, due to it does not require the definition of extra training parameters and it has a better performance during the training stage. For defining the architecture of the neural network, it was taken in account the conclusions obtained from the test made by [Lop12]. In this paper a comparison among three different architectures: linear, space-based and time-based was made; and the space-based architecture proved to be the best for speed prediction which is the type of measure that will be used in this forecasting model. Thus, considering all this factors, the chosen architecture was the space-based model, defining an ANN for each way of the motorway, one for the traffic in direction of West and the other towards East. In respect to the inputs and outputs of the network, the ANN receives thirteen inputs and produces one value as output, corresponding to the predicted speed for the next time interval (t+1). A detailed definition of the inputs is presented in table 3.1. In that table it is shown that the ANN receives the five last measures which, considering a time interval of 5 minutes, corresponds to the measures obtained in the previous 25 minutes before the current moment. Input Description weekday from 1 to 7 corresponding to the day of the week (1-Monday, 7- Sunday) holiday a flag that can be 0 or 1, corresponding to either the day is a holiday or not holidays season a flag that can be 0 or 1, corresponding to either is holidays season or not day from 1 to 31 corresponding to the day of the month month from 1 to 12 corresponding to the month hour from 0 to 23 corresponding to the hour minute from 0 to 59 corresponding to the minutes average speed (t-5) from 0 to 130 corresponding to fifth past measure average speed (t-4) from 0 to 130 corresponding to fourth past measure average speed (t-3) from 0 to 130 corresponding to third past measure average speed (t-2) from 0 to 130 corresponding to second past measure average speed (t-1) from 0 to 130 corresponding to first past measure average speed (t) from 0 to 130 corresponding to current measure tcurrent moment of time Table 3.1: Description of inputs used by the neural network Besides this base neural network, it was also decided to develop an ANN with fuzzy logic, using the fuzzy sets for grouping the speed values that are used as input, into categories that represent a textual description of traffic state. The fuzzyfication was classified into four groups, each one representing a state of traffic, composed by a range of velocities and the corresponding input value given to the network. Table 3.2 describes the defined fuzzy sets. 17 Methodological Approach Traffic state Range of values Input value for ANN Stopped (red colour) speed within 0-40 km/h 1 Stop-and-go (orange colour) speed within 40-55 km/h 2 Slow (yellow colour) speed within 55-70 km/h 3 Normal (green colour) speed within 70-∞km/h 4 Table 3.2: Description of fuzzy sets for velocity input For training the ANN it was decided to use four weeks of normal traffic data (from Monday to Sunday) without incidents to train the network, and one week of data to test it. The data used was desired to represent four weeks (28 days) of normal traffic conditions, in order to train the network with the common patterns of traffics. For that reason it should be noted that the data used was not necessarily from a continuous period of days in a week, from the fact that in some weeks there were days where incidents happened. Thus, the training set was composed by four entries of each day of week, composing a four weeks dataset. The traffic data belongs to the measures collected from VCI motorway during April and May of 2013. To finalize, the development of the neural network was structured into six phases: 1. Implementation of the neural network; 2. Execution and test of the developed solution (by varying the number of neurons and hidden layers used); 3. Calibration and validation of the model; 4. Implementation of the neural network with fuzzy logic; 5. Execution and test of the developed solution (by varying the number of neurons and hidden layers used); 6. Calibration and validation of the model; 3.4 Technology Overview 3.4.1 SUMO (Simulation of Urban MObility) SUMO is a microscopic open-source traffic simulator created by the German Aerospace Centre (DLR) in 2001, with the goal to provide a tool that would be fast in run-time and portable, as well able to support new algorithms developed by its users [KHRW02]. It is currently in the version 0.20 and it has been widely used among traffic simulation community. An important feature is the fact that SUMO is a multi-modal simulator, being able to not only depict the cars’ movements but also the other kind of vehicles that usually circulate within a city, like motorcycles, bicycles or pedestrians, as well public transport vehicles: bus, train, tram or taxi. The simulator is available 18 Methodological Approach through command-line or through a GUI (Graphical User Interface) for those who need a graphical presentation. The microscopic algorithm used is the car-following model extension of Gipps algorithm, developed by Krauß and Janz [Kra98], which is a collision-free model since a vehicle adapts its velocity at each simulation step according to the speed of the leading vehicle (the vehicle that is ahead). The vehicle’s speed is defined using two auxiliary equations. The first one is the safe velocity, which is the maximum speed the vehicle can go in order to not collide with the vehicle ahead: vsa f e(t) = vl(t)+ g(t)−vl(t)τ ¯v b(¯v)+τ(3.1) vl(t): speed of the leading vehicle in time t; g(t): gap to the leading vehicle in time t; τ: the driver’s reaction time (usually 1s); b: the deceleration function. Then there is the desired velocity, which is the speed the driver wants to have: vdes(t) = min[vsa f e,v(t)+a,vmax](3.2) And the final velocity is calculated through a third equation that binds a random factor, in order to simulate the fact that the driver might not be able to achieve the desired speed. v(t) = max[0,rand[vdes(t)−a,vdes(t)]] (3.3) The format of the files used by SUMO is XML-based, varying on the extension used according to the type of file. For instance, the configuration file for the simulation is saved with a .sumo.cfg extension; the network is defined into a file using .net.xml extension; or even the routes file which uses the .rou.xml extension. Besides the simulator, SUMO has also a set of small applications included in its package that work as auxiliary tools for tasks such as: generating the network to be used (netconvert,netgenerate), defining and computing the routes of vehicles (darouter,jtrrouter, dfrouter), inputting the demand of vehicles in the simulation (od2trips), as well for other uses (eg: polyconvert,edgesinDistrict). [KHWR02] [KHH+05] The network to be used in simulation can be generate randomly with netgenerate or by using an existing map either previously defined "by hand" or from a maps service like OpenStreetMaps. In this case the application used is netconvert which is an importer that reads a network definition from a file and can be in a variety of formats. To define the traffic demand there are three different generators: the first, duarouter, is the simplest since it uses the shortest path computation as the way to generate the routes, being the Dijkstra model the algorithm used. There is also the option to use A* algorithm instead. The application jtrouter uses the turning percentages at junctions to compute the routes, being suitable to use in a urban road network scenario. There is also the dfrouter which computes the routes by 19 Methodological Approach using actual data collected from induction loop detectors and which is inserted into the network through a few "source points". Those "source points" represent the actual existing detectors. This is suitable in a motorway scenario and when there are induction loop detectors installed in the real network, that can provide a real and accurate set of data. [BBEK11] 3.4.2 JOSM (Java OpenStreetMap Editor) JOSM is an open-source desktop editor for maps with the file format OpenStreetMaps (with .osm extension) , written in Java, and created by Immanuel Scholz [Sto14]. Is is currently in the version 7000. The purpose of using this software in the thesis was to edit the map that would serve as basis for generating the network of VCI motorway which was used in the forecasting with simulation. 3.4.3 Encog Machine Learning Framework Encog is a machine learning framework created by Jeff Heaton through its research institute, Heaton Research Inc., in 2008 [Hea13]. It has versions for the programming languages: C/C++, C# and Java; and it supports several artificial intelligence algorithms, such as Bayesian Networks, Genetic Algorithms, Neural Networks, Support Vector Machines. In this thesis context it was only used the neural network feature for Java, which is currently in the version 3.1.0. This neural network module supports both Supervised and Unsupervised learning, and allows the implementation of different types of architecture like ADALINE Neural Network, Feedforward Neural Network (Perceptron), Radial Basis Function Network (RBF). As well, several training techniques are available such as: Backpropagation, Resilient Propagation (RProp), Levenberg–Marquardt or Manhattan Update Rule Propagation. 3.5 Summary Initially in this chapter it was presented the statement of the problem and the goals of this thesis, as well the analysis of the requirements, which revealed to be crucial in order to obtain a robust plan and set of procedures for the implementation phase. Also, a brief but concise explanation of the proposed solution for the two models was made, providing an overall view of the chosen methods. Before finish the covering of the adopted methodologies, it was presented an overview of the technologies used, with a definition of its characteristics and features. 20 Chapter 4 Implementation This chapter presents a detailed view about the steps and decisions made during the implementation process, which was divided into two phases: firstly the goal was to implement the traffic forecasting techniques using the microscopic simulation model (model-driven stage), and secondly the traffic forecast would be made using Artificial Neural Networks with Fuzzy logic (data-driven stage). 4.1 Network Description The network used as base for implementing both simulation and data-driven models was the Via de Cintura Interna (VCI) motorway, in particular one of its junctions nodes called Paranhos, which served as test-bed for the initial developments made. VCI is a main urban motorway located in Porto metropolitan area with an extension of 21 kilometres. It has the shape of a ring which passes through East, North and West parts of Porto city and the North part of Gaia, being composed by twenty junctions nodes and connected to six inter-urban motorways (A1, A3, A20, A28 A43 and A44). The motorway is covered by several induction-loop detectors, property of the Portuguese Traffic Authority - Estradas de Portugal1, which help to control and evaluate the traffic flows. Thus, in this thesis context it was used the data collected by the traffic detectors located near the Paranhos junction node. A network map, containing the junction nodes and traffic detectors location, can be seen in figure 4.1. As referred before, the implementations and tests were made using a test-bed based on the Paranhos junction node, which is covered by two traffic detectors, both located in the junction node boundaries of the motorway. This node is connected to three access streets, two of them serving as origin and destination, and another that works only as destination for the vehicles which come from VCI. Its representation can be seen in figure 4.2. 1http://www.estradasdeportugal.pt/ 21 Implementation data and convert it to an usable format from the ANN, it was developed an auxiliary function called CSVtoArray(ArrayList<ArrayList<Double>>csv_array, int mode), which converts the loaded CSV file into a array of arrays of double type. 1String line = ""; 2String cvsSplitBy = ","; 3... 4 5while ((line = br.readLine()) != null) 6{ 7ArrayList<Double> line_values = new ArrayList<Double>(); 8 9// use comma as separator 10 String[] data = line.split(cvsSplitBy); 11 String speed = data[1]; 12 13 String[] time = data[0].split(" "); 14 String date = time[0]; 15 String[] date2 =date.split("-"); 16 String month = date2[1]; 17 String day = date2[2]; 18 19 String hours = time[1]; 20 String[] hours2 = hours.split(":"); 21 String hour = hours2[0]; 22 String minutes = hours2[1]; 23 24 line_values.add(weekday); 25 line_values.add(Double.parseDouble(day)); 26 line_values.add(Double.parseDouble(month)); 27 line_values.add(Double.parseDouble(hour)); 28 line_values.add(Double.parseDouble(minutes)); 29 line_values.add(Double.parseDouble(speed)); 30 ... Listing 4.12: Code fragment of LoadCSV function Since the activation functions used have a restrict domain of values which work with, it was necessary to normalize the input values to be within the required interval, since they are in a variety of ranges. The interval chosen was [0−1], which is the range of values of the Sigmoid activation function co-domain. To do that, a set of normalizing functions were created, making use of the Encog class NormalizedField which allows to create a normalize method by simply defining the interval values. The definition of those functions can be seen in listing 4.13. 1//Used to normalize day of the week from a range of 1-7 to 0-1. 28 Implementation 2public static NormalizedField normWD = new NormalizedField( NormalizationAction. Normalize, "wd", 7, 1, 1, 0); 3 4//Used to normalize day from a range of 1-31 to 0-1. 5public static NormalizedField normD = new NormalizedField( NormalizationAction. Normalize, "d", 31, 1, 1, 0); 6 7//Used to normalize month from a range of 1-12 to 0-1. 8public static NormalizedField normMth = new NormalizedField( NormalizationAction. Normalize, "mon", 12, 1, 1, 0); 9 10//Used to normalize hours from a range of 0-23 to 0-1. 11public static NormalizedField normH = new NormalizedField( NormalizationAction. Normalize, "h", 23, 0, 1, 0); 12 13//Used to normalize minutes from a range of 0-59 to 0-1. 14public static NormalizedField normMin = new NormalizedField( NormalizationAction. Normalize, "min", 59, 0, 1, 0); 15 16//Used to normalize speed from a range of 0-130 to 0-1. 17public static NormalizedField normSpeed = new NormalizedField( NormalizationAction. Normalize, "speed", 130, 0, 1, 0); Listing 4.13: Code of normalize functions With the dataset prepared to be read by the ANN, it was time to create the neural network. Hence, it was initially defined an ANN with one hidden layer composed by fifteen neurons plus a bias neuron to provide some adjustments on the weights of the neurons and help during the learning phase. Several tests were done using a different number of hidden layers as well by varying the number of neurons used. This was easily done by just adding a new layer or changing the value of the variable hidden_neurons. Listing 4.14 presents the code used to created the neural network, and the results obtained with the test of different configurations of the ANN can be seen in chapter 5. 1static int inputs_number = 13; 2static int ideals_number = 1; 3static int hidden_neurons = 15; 4... 5BasicNetwork network = new BasicNetwork(); 6network.addLayer(new BasicLayer(null,true,inputs_number)); 7network.addLayer(new BasicLayer(new ActivationSigmoid(),true,hidden_neurons)); 8network.addLayer(new BasicLayer(new ActivationSigmoid(),false,ideals_number)); 9network.getStructure().finalizeStructure(); 10network.reset(); Listing 4.14: Example of code for create the neural network 29 Implementation Once the neural network was created it was time to train it, and the train process was made, like referred before, with the learning method of resilient back-propagation. Therefore, it was constructed the training set, composed by the input values (variable inputs_arr) and the values that are expected to be obtained with the train (variable ideals_arr). The next step was to start the iteration of the learning process, which was set to execute until a error rate lower than 0,1% was reached. The code implemented is shown in listing 4.15. After finishing the training stage, the neural network was tested with a different traffic data set composed by a non-continuous series of seven days of measures. Listing 4.16 shows the code used for testing. 1MLDataSet trainingSet = new BasicMLDataSet(inputs_arr, ideals_arr); 2final ResilientPropagation train = new ResilientPropagation(network,trainingSet); 3 4int epoch = 1; 5System.out.println("Starting training..!"); 6 7do { 8train.iteration(); 9System.out.println("Epoch #" + epoch + " Error:" + train.getError()); 10 epoch++; 11 }while(train.getError() > error_rate); 12 train.finishTraining(); Listing 4.15: Example of code to train the neural network 1MLDataSet evaluationSet = new BasicMLDataSet(inputs_arr_eval, ideals_arr_eval); 2System.out.println("\nNeural Network Results:"); 3for(MLDataPair pair: evaluationSet ) 4{ 5final MLData output = network.compute(pair.getInput()); 6 7System.out.println(normH.deNormalize(pair.getInput().getData(5)) + ":" + normMin.deNormalize(pair.getInput().getData(6)) + ", actual=" + normSpeed. deNormalize(output.getData(4)) + ",ideal=" + normSpeed.deNormalize(pair. getIdeal().getData(4))); 8} Listing 4.16: Example of code to test the neural network Following the planned implementation, after the development and test of the basic neural network the next step was to implement an ANN with fuzzy logic. As described in chapter 3the use of fuzzy logic consisted in grouping the speed values into velocity range sets, where those input values would be fuzzyfied, then computed by the neural network and later the output would be defuzzyfied. In terms of implementation, the task is simply to change the way the speed values are normalized and subsequently passed to the network; and make a verification of in which range 30 Implementation the value is. Thus, the velocity value is normalized in a scale according to the range defined (see Table 3.2). The code used for the fuzzyfication is present in listing 4.17 1public static NormalizedField normSpeedFuzzy = new NormalizedField( NormalizationAction.Normalize, "speed_fuzzy", 4, 1, 1, 0); 2... 3if(elem.get(5) > 0 && elem.get(5) <= 40) 4{ 5inputs_arr[ind][12] = normSpeedFuzzy.normalize(1.0); 6} 7else if(elem.get(5) > 40 && elem.get(5) <= 55) 8{ 9inputs_arr[ind][12] = normSpeedFuzzy.normalize(2.0); 10} 11else if(elem.get(5) > 55 && elem.get(5) <= 70) 12{ 13inputs_arr[ind][12] = normSpeedFuzzy.normalize(3.0); 14} 15else if(elem.get(5)> 70 && elem.get(5) <= 120) 16{ 17inputs_arr[ind][12] = normSpeedFuzzy.normalize(4.0); 18} Listing 4.17: Example of code to implement fuzzy logic As it was done in the traffic forecast using simulation, after developing the normal neural network and the version with fuzzy logic, it was implemented an ANN aimed to detect the traffic patterns when an incident occurs. This model uses the data from two adjacent detectors in order to learn the correlation of the traffic state between both detectors, and it was created using the same structure of the normal neural network. Thus, besides considering the last five measures and the last measure as input, this model also considers the last five measures and last measure of the second detector, having in total 19 inputs. There was also a change in the outputs, with the network producing 2 outputs, one corresponding to the traffic forecast for the next time interval in the first detector, and the other matching to forecast of traffic for the next time interval in the second detector. 4.4 Summary A detailed view about the steps taken during the implementation phase was presented in this chapter, which started by describing the road network used for testing. Then, it focused on the developed model for forecasting through the use of simulation and the way it was implemented using SUMO simulator. After that, it were presented the procedures taken for developing the data-driven prediction model using neural networks, using the Encog framework. 31 Implementation 32 Chapter 5 Tests and Evaluation After the presentation in the previous chapter of the implementation details, this chapter explores the tests made during the development phase for both forecasting models: the simulation as well the data-driven model. In the end, is described the environment where the tests were made in. 5.1 Simulation Model During the first stage of implementation, which focused on the configuration of the software, a few functional tests were executed in order to evaluate if a proper configuration was made. Later, when the initial simulation models were ready, it was carried out a set of execution tests with the goal to evaluate the performance of the techniques developed. 5.1.1 Functional Tests The functional tests made were carried out after defining the first network model of the test-bed area, and it consisted of testing the injection of vehicles in the network in order to detect potential mistakes and errors in the network topology. The data used for testing was a set of random trips generated with the SUMO’s auxiliary tool randomTrips, which receives as input the network and the time interval of simulation, and generates vehicles with random routes. This test allowed to identify a few deadlock situations existing on certain road segments, where the cars got stuck provoking a block on simulation. The reason for this to happen was the fact that there was no restriction of U-turns so that in every street the vehicles were allowed to turn back due to the fact that by default netconvert inserts U-turns in the end of every urban road edge. Similar errors were detected and described in the project presented in the paper [DAS+13]. In figure 5.1 is an example where we can see from the white arrows that the vehicles are allowed to turn around in the end of the road segment. Figure 5.2 shows a similar situation on a crossing with traffic lights where the vehicles could turn around, when in real-life that movement is forbidden. This error 33 Tests and Evaluation Figure 5.1: Illegal U-turn Figure 5.2: Illegal U-turn on a crossing was solved by adding the option --no-turnarounds when creating the network from the OSM map with netconvert. Also, some of the existing traffic lights in the access streets were not properly defined when the map importing was made. An example of it can be seen in figure 5.2, where one of the traffic lights is placed in the middle of the crossing, and it is not synchronized with the rest of traffic lights. A solution found was to use the parameter --junctions.join when using the netconvert program to import the network. This option forces the program to search the existing traffic lights on every crossing and synchronise (join) them into only one traffic light system per intersection. 5.1.2 Execution Tests Once the functional errors related to U-turns movements and traffic lights were detected and corrected, it was time to test the execution of the developed simulation model. The tests covered two different ways for modelling traffic demand: first using the dfrouter application, and then with OD matrices. The data used for testing came from the measures collected by real traffic detectors and the time interval used was of several hours in some cases, and of one hour long during rush-hour period (early morning) in other cases. Since the VCI motorway is only partially covered by traffic detectors, not having detectors in some road segments neither existing on the access ramps, it was necessary to infer the data related to the trips between the motorway and the neighbour streets. This inference was decided to be made through an equal split-rate for all the origin and destination links. Indeed, this method might lead to a loss of accuracy, however in the case of study of this thesis it is acceptable since the main percentage of traffic flows occurs within the motorway which is the ultimate area of study. For testing the simulation performance, the measurement unit was the number of vehicles passed within a time interval, that consisted of 5 minutes in some cases and of 10 minutes in others. Also, to improve the calibration and evaluation of the developed models it was used a function to calculate the error rate between the number of expected vehicles to be simulated at each time interval and the vehicles that are actually simulated. This function was based on the formula presented in [KHWR02], where it was used the variation between simulated and real 34 Tests and Evaluation travel times to calibrate the model. A model would be considered to have better performance as lower is its error rate. The formula is denoted by: error =|Vsim −Vobs| Vobs (5.1) Vsim : number of simulated vehicles within the time interval; Vobs : number of observed vehicles from real data within the time interval. In order to retrieve those measures from the simulation, it was used a SUMO feature for testing the simulation, which allows to define virtual detectors in the simulation that function as the reallife induction-loop detectors. These detectors count the number of vehicles that passed as well as calculate the average speed registered during the defined time interval, saving the results in an XML file. 1 Modelling traffic with DFRouter The first experiment was made using the application dfrouter to model the traffic demand. As referred in chapter 4this way of modelling the traffic demand is made through the use of virtual detectors that act as the actual traffic detectors. The dataset used for test was a time period of six hours composed by 5-minutes measures, belonging to the interval between 0h00 and 6h00 of the day March 1, 2013, which was a typical day without the occurrence of incidents. Then, the time of the simulation was 22000 seconds, corresponding to six hours plus an extra time to warm-up the data for simulation. A further description about the data used and the configuration file can be found in appendix A.1. The interval of measures used was of 300 seconds (5 minutes) and the measurements were made using the induction loop detectors (E1 type) of SUMO which were placed just-after the source detectors, and just-before the sink detectors. As said in beginning of this section, it was necessary to infer the data related to the trips between the motorway and the adjacent streets. In this case, it was used a 50 /50% split-rate for each of the neighbour streets (Paranhos and Faria Guimarães). (a) A3 detector - C direction (source) (b) Paranhos detector - C direction (sink) Figure 5.3: Results of 1st test of DFRouter - West (C) direction 1http://sumo-sim.org/userdoc/Simulation/Output/Induction_Loops_Detectors_(E1).html 35 Tests and Evaluation In figure 5.3 are presented the results obtained from the detectors located in direction of West (designated by letter C), and observing it we can see that all the expected cars were released, and within the time, from the source detector (figure 5.3a), however only nearly 40-50% of them arrived in the sink detector (figure 5.3b). On the opposite way, East direction (designed by letter D), in the source detector (figure 5.4a) most of the vehicles were released in accordance to the expected number with a small variation but still within the expected time. On the other hand the sink detector (figure 5.4b) registered a higher value for the simulated vehicles than the expected ones. (a) Paranhos detector - D direction (source) (b) A3 detector - D direction (sink) Figure 5.4: Results of 1st test of DFRouter - East (D) direction Summing up, the reason for this difference between the values measured in the source and in the sink detectors, either in West or East direction, is from the fact that the trips and routes generated with dfrouter cannot be defined by the user, since it only receives the number of expected vehicles and the average speed. Thus, the program computes the trips and routes accordingly to its own criteria, having the only milestone as to follow the defined number of vehicles. This leads to an unrealistic set of routes, that do not match with the actual trips. A solution found to solve this situation and calibrate the simulation model was to use the option --disallowed-edges when importing and generating the traffic demand with dfrouter. This parameter commands the program to not use certain edges when calculating the routes, forcing the trips to have a "defined" route and though avoid the existence of unrealistic routes. Using this option led to an improvement in the results, especially with the source detector "Paranhos D" and the sink detector "Paranhos C". Figure 5.5 shows the improvement achieved in terms of vehicles passing, reaching in average around 60% of the expected number, and in figure 5.6 can be seen that all the expected vehicles were release into the simulation. It should be noted that in the first test as well as in the second, the number of vehicles that reached the sink detector of "A3 D"(figure 5.6b) was superior to the expected value. The identified reason for this happening was again due to the impossibility to define the trips and routes generated by dfrouter. This provokes a considerable number of random trips, where the dfrouter tries to generate the enough number of trips from different source points and ends up creating more trips to a certain destination than it should have. 36 Tests and Evaluation (a) A3 detector - C direction (source) (b) Paranhos detector - C direction (sink) Figure 5.5: Results of 2nd test of DFRouter using "--disallowed-edges" - West (C) direction Regarding the error rates of the two experiments, in table 5.1 are presented the average rates registered at each detector. Observing it, we can see that there was a clear improvement in the second test, especially in the values collected at detector "Paranhos (C)", where the error rate dropped from around 57% in the first test to 21,4% in the second experiment. Also, both source detectors (A3 (C) and Paranhos(D) ) achieved a 0% error rate in the experiment using --disallowed- edges (2nd test). In contrast, during the second test was registered a higher error rate for the sink detector A3 (D), whose likely reason for happening was described before. Experiment A3 (C) Paranhos (C) Paranhos (D) A3 (D) #1 0% 56,8% 5,5% 22,4% #2 (using --disallowed-edges)0% 21,4% 0% 29,1% Table 5.1: Error rates obtained in the tests with DFRouter After evaluating the results obtained and taking in account the error rates achieved, the arisen conclusion was that it was not the best method to be used in this thesis context since it revealed to be unable to fully emulate the real routes from the source and the sink points. Albeit, its ability to depict the traffic flows from real data measurements makes it a potential useful method to be used in a small network scenario, where having the right number of vehicles at each detector point is more important than the routes taken by the cars. (a) Paranhos detector - D direction (source) (b) A3 detector - D direction (sink) Figure 5.6: Results of 2nd test of DFRouter using "--disallowed-edges" - East (D) direction 37 Tests and Evaluation was capable to simulate the traffic pattern for a defined time of the day. Thus, the use of OD matrices proved to be more suitable for this thesis study than dfrouter application. Modelling traffic with OD matrices - using an incident scenario The conclude the tests with the simulation model a final test was made, this time focusing on the prediction of the network state when an incident occurs. Thus, for testing it it was used a data set of measures from a time interval where an incident was reported to have happened in the test-bed area (Paranhos junction node), in East-West direction. Since the incident happened only in one direction of the motorway, it were used only traffic measures from the two detectors located in West (C) direction. The day in question was 28th of January 2014 from 10h until 12h30, which was the time the accident was reported to last, and it affected the most-right lane. A description about the OD matrix used and the configuration file is presented in appendix A.3. The goal of carrying this test was to evaluate if at some point the simulator was able to depict the network’s behaviour when an incident occurs, more specifically when one or more lanes of the road are blocked. Therefore, the implementation of the accident in the simulation was made through two methods: stopping a car on the lane during the simulation; and by defining speed limits on the lanes and road segments close to the area of the accident. These methods are the recommend ways to simulate an accident since SUMO so far does not have an exclusively feature to depict accidents. 2 So, in the first experiment two vehicles were halted in the middle of the network on the rightmost lane for the whole time of simulation. Their function was to act as the vehicles involved in the accident do, which leads to force the vehicles behind them to change their route by moving to the adjacent lane. This reduced the number of vehicles passing per time-step as desired, however it was still a higher value than expected, as can be seen in the results presented in figure 5.17. (a) A3 detector - C direction (origin) (b) Paranhos detector - C direction (destination) Figure 5.17: Results of 1st incident scenario test using vehicles stopping Observing the results, it is evident that using only the method of stopping the vehicles in the road segment was not enough to fully emulate the traffic state during a real incident scenario. A reason for it is that in real-life when there is an accident or a lane blocked in the middle of the 2http://sumo-sim.org/userdoc/FAQ.html#How_to_simulate_an_accident 44 Tests and Evaluation Figure 5.18: Map of accident area, with the defined speed limits road, the cars in the adjacent lanes reduce their velocity, normally provoking a traffic congestion. Albeit, in the simulator this situation is not depicted at all since the cars in the neighbour lanes keep moving with the same speed, not concerning about the existing blockade in the next lane. For that reason in the second experiment it was decided to set a speed limit on the lanes near the area of the accident besides the use of two vehicles to block the traffic. A description about the implementation of this speed limits can be found in section 4.2. The defined limits of velocity were: 30 km/hon the lane where the accident happened, 40 km/hon the middle lane and 55 km/h on the left-most lane as well as in the road segments before the accident area. In figure 5.18 are presented in detail the speed limits for each lane. Hence, the simulation was executed again, this time with two vehicles halted in the rightmost lane and with speed limits on the lanes located in the surrounding area of the accident. A tiny improvement was achieved with the additional methods used, having a small variation in the vehicles counted in the source detector A3, and there was in the sink detector Paranhos a reduction in the traffic flow per each measurement interval. The detailed results can be seen in the graphics of figure 5.19. (a) A3 detector - C direction (origin) (b) Paranhos detector - C direction (destination) Figure 5.19: Results of 2nd incident scenario test using variable speed signs The error rates obtained by each experiment are presented in table 5.4, and observing it we can state that both tests got similar error rates, with a meaningless difference of 0,2% at the origin points. Thus, two conclusions can be taken: one is that the obtained error rates are still relatively high to consider the model valid, and which leads to the second conclusion that to modelling incidents using SUMO might not be so easy and simple to accomplish by just stopping cars and 45 Tests and Evaluation Experiment A3 (C) Paranhos (C) #1 (using two vehicles stopped) 10,5% 9,9% #2 (using variable speed sign) 10,3% 9,9% Table 5.4: Error rates obtained in the accident experiment with OD matrices reduce the speed on the lanes. Indeed, to depict the traffic pattern of an accident using simulation is necessary to combine the stopping of vehicles and the use of variable speed signs, by varying the values of those parameters through the simulation time in order to reproduce the velocity variations caused by a block on a lane. 5.2 Data-driven Model The tests made with the developed neural networks focused on the use of different activation functions: Sigmoid,Tanh and Log, and their formulas can be seen in table 5.5. In addition, two network structures were tested: one hidden layer with 15 neurons; and two hidden layers, one with 10 neurons and the other with 5 neurons. Name Function Sigmoid f(x) = 1 (1+e−x) Tanh f(x) = e2x−1 e2x+1 Log f(x) = log(1+x),x>=0 −log(1−x),otherwise Table 5.5: Description of activation functions tested As said in section 3.3.2 the dataset used for testing was composed by a complete week of measures (from Monday until Sunday) without the occurrence of incidents, collected in May 2013. The measurement unit used was the average speed registered by the traffic detectors within a time interval of 5 minutes, and it was used a road section of the motorway way from East to West, located in Paranhos junction node. In the initial tests were only used the values from one of the two existing detectors in that node, specifically the "A3" detector (see map of the node in figure 4.2). Also, like it was done in the test of the simulation model, it was used a formula to calculate the error rate of predictions, where the unit used was the predicted average speed. Before testing the performance of the networks to predict traffic, it was made an evaluation of the time spent by each network during the training stage. Modelling traffic with normal ANN The tests started with the normal neural network model, and the results obtained as well a comparison with the real data are presented in this section using graphics, where the yaxis is about the 46 Tests and Evaluation average speed and the xaxis is about the time of the day along the week of test. Firstly it was tested the use of the Sigmoid function, and during the learning phase the one hidden layer network took 44 epochs to reach an error rate lower than 0,1% and finalize the training, spending 1,33 seconds to do it. In comparison, the network with two hidden layers spent two times more (3,91 seconds) to conclude the training than the one hidden layer and 115 epochs, as it is shown in the table 5.6. Network Time (seconds) Epochs One hidden layer (15 neurons) 1,33 44 Two hidden layers (10+5 neurons) 3,91 115 Table 5.6: Epochs and time spent per each ANN to finish the training - Sigmoid function About the results obtained, the ANN with one hidden layer predicted a range of values close to the actual values, revealing however a difficulty to make strong variations of values between adjacent time steps. Even using data from normal days to train and test, this network tends to normalize the values along the time. This characteristic was noted even more in the rush-hour intervals where the network followed the tendency to decrease the value of average speed but not reaching close to the real data. In figure 5.20 is presented the comparison between the results and the real data using the one layer network. Figure 5.20: Results of the test of normal ANN with Sigmoid function - one hidden layer With the two layers network the results achieved were mostly similar, with only a slight improvement, where it showed to be more flexible to vary the lowest values between measurements. In the rush-hour periods this network got the predictions closer to the actual data. The forecasting results of this network are presented in figure 5.21. Summing up, since both networks had identical results, it is not possible to clearly define which of the two structures was better for traffic forecasting. Afterwards it was tested the forecasting using the Tanh activation function. About the learning phase, the network with one hidden layer took 2,20 seconds to complete the training, with a total 47 Tests and Evaluation Figure 5.21: Results of the test of normal ANN with Sigmoid function - two hidden layers of 70 epochs, while the ANN with two hidden layers spent less time and epochs to get trained, taking 1,55 seconds. These execution times can be seen in table 5.7. Concerning the results, both networks showed the tendency, in general, to predict values which are higher than the expected data, specially the network with one hidden layer as can be found in the graphic of figure 5.22. This network learnt the rush-hour traffic patterns at a fair level, however there was an average speed difference between the predictions and the real values of around 15 km/hmore for Monday, Tuesday and Thursday; and near 20 km/hmore than actual data on Wednesday and Friday. Figure 5.22: Results of the test of normal ANN with Tanh function - one hidden layer Network Time (seconds) Epochs One hidden layer (15 neurons) 2,20 70 Two hidden layers (10+5 neurons) 1,55 47 Table 5.7: Epochs and time spent per each ANN to finish the training - Tanh function 48 Tests and Evaluation The network with two hidden layers got lower results than the first one, essentially in the peak hours as can be seen in figure 5.23. In fact, this tendency to predict lower values showed that it was better to forecast the traffic state of rush-hours, having only a difference of 10 km/hbetween its forecast and the actual values on Monday, Tuesday and Thursday, and a 15 km/hmore than expected on Wednesday and Friday. Figure 5.23: Results of the test of normal ANN with Tanh function - two hidden layers Additionally, it was made an experiment with a combination of two different activation functions for the network with two hidden layers, with the goal to research if the use of different functions could improve the results. Thus, the structure used was: one of the layers with the Sigmoid function and the other using the Tanh activation function. Indeed, this modification caused a significant variation in the predictions, with the forecasted traffic being underestimated with lower values than the real data, as it is presented in figure 5.24. This variation is more evident in the forecasts for the rush-hour period where the results were either similar to the actual data (in the measurements for Wednesday, Thursday and Friday) or even lower than expected (in the measurements for Monday and Tuesday). To conclude, when using the Tanh activation function the best of the three models tested was the second network (two hidden layers using only Tanh function) since it produced balanced results in the normal traffic periods and during rush-hour. A downside of the last model developed (with the combination of Tanh and Sigmoid function) is that it provokes big variations of traffic which is not exactly what happens in a normal traffic state. Finally, it was tested a third activation function, the Log function, and the training time for the ANN with one hidden layer was of 3,42 seconds and 159 epochs. In contrast, the learning stage of two layers network took only 1,03 seconds to conclude and 47 epochs, as it is presented in table 5.8. In general both networks got good results, having the ANN with one hidden layer forecasted the traffic for the normal hours periods (i.e. non rush-hour) with a small difference between the predicted values and the real data. For rush-hour periods where there was great speed variations in a short time interval (Wednesday and Friday), its results were not so accurate, having a difference 49 Tests and Evaluation Figure 5.24: Results of the test of normal ANN using Tanh and Sigmoid function - two hidden layers of around 10 km/hmore than it was expected. In the other periods of rush-hour where the velocity variation was not so deep, the network predicted with an average error of 5 km/has can be seen in the graphic presented in figure 5.25. Figure 5.25: Results of the test of normal ANN using Log function - one hidden layer By observing the results graphic of the network with two hidden layers (see figure 5.26), we can see that it showed a trend to have a higher variation of values during the hours with normal traffic flow than the ANN with one layer, predicting sometimes above the real value and other times below the actual value. About the periods of rush-hour it had worse results when compared to the first network, with an average variation of 10 km/hexcept in the measurements for Friday where the variation was of around 15 km/h. Thus, the best model using the Log activation function was the model with one hidden layer, which proved to better depict the traffic patterns, including during the rush-hour period where it got close predictions to real values. 50 Tests and Evaluation Network Time (seconds) Epochs One hidden layer (15 neurons) 3,42 159 Two hidden layers (10+5 neurons) 1,03 47 Table 5.8: Epochs and time spent per each ANN to finish the training - Log function After finishing the test of the normal neural network, the conclusions that can be taken are that the most accurate forecasts were made by the networks using the Log activation function since both of the structures implemented acquired good results. In fact, the implemented network with one hidden layer using the Log activation function got the best results, predicting the traffic along the normal hours as well as during the rush-hour periods with values very close to the real data. Also, the other ANN implemented with Log function, with two hidden layers, got a fair set of forecasts, only varying sometimes more than expected, when compared to the network version of one hidden layer. In contrast, the networks which got worst results were the network using Tanh function with one hidden layer, and the ANN of two hidden layers with the combination of Sigmoid and Log functions. The first one predicted values higher than expected, while the second got forecasts with extreme values and a big variation than the real data. In table 5.9 are presented the error rates obtained by each network and observing it we can conclude that the ANNs using the Log activation function got the best predictions with a error rate of 2,7%, where the networks using Sigmoid got the higher rate (around 3,5%). Hidden layer structure Sigmoid Tanh Log One layer (15 neurons) 3,4% 3,2% 2,7% Two layers (10+5 neurons) 3,6% 2,9% 2,7% Two layers (Sigmoid + Tanh) - 3,0% - Table 5.9: Error rates obtained in the tests with normal ANN Modelling traffic with normal ANN - using an incident scenario Like it was done in the tests made with the simulation model, the basic model of the normal neural network was adapted to create an ANN that could work with incident scenarios. In fact, the main changes were increasing the number of inputs and outputs in order to use data from two detectors instead of the first version which only took in account the values of one traffic detector. This approach was intended to use the measures of two adjacent detectors and learn the pattern when an incident occurs by using the gap of the number of vehicles between both points. In terms of function, this network model uses the values of both traffic detectors to detect the traffic at each one. In figure 5.27 are presented the predictions obtained for each point and we can see that the forecasts for the first detector ( 5.27a) were reasonably accurate for the periods where traffic was normal as well as for the rush hours periods having a tiny difference of 5 km/hmore on Monday 51 Tests and Evaluation Figure 5.26: Results of the test of normal ANN using Log function - two hidden layers and Tuesday, and of 10 km/hon Wednesday and Friday. For the second detector ( 5.27b) the network got good forecasts during the normal traffic period, however its performance was worse when it forecasted for the peak hours. It got predictions in average 10 km/hhigher than expected (on Monday, Wednesday and Friday) and 20 km/hhigher than the real data for Tuesday and Thursday. (a) A3 detector (1st detector) (b) Paranhos detector (2nd detector) Figure 5.27: Results of the test of ANN using an incident scenario Concerning the error rates obtained by the network when testing an incident scenario, it got a better rate on the predictions for first detector (A3 detector), which was almost 1% better than the rate achieved in the forecasts for the second detector (Paranhos detector) as can be seen in table 5.10. Comparing this rates with the error ratio obtained in the previous tests (see table 5.9) the values are similar, having the first detector obtained a rate (2,8%) identical to the rate of the best models, which used Log as activation function, and the second detector a rate (3,6%) equal to the rate achieved by the networks using Sigmoid function. To conclude, we can see from the similarity of results with the normal network, that this neural network can provide traffic forecasts with the same accuracy as the normal model with the benefit of being able to better detect the influence of traffic flow over two adjacent detectors. 52 Tests and Evaluation A3 detector Paranhos detector 2,8% 3,6% Table 5.10: Error rates obtained in the tests of an incident scenario with normal ANN Modelling traffic with fuzzy ANN After testing the normal ANN model, it was time to test the fuzzy neural network with different activation functions. In the tests made the measurement unit used was the average speed, but this time using the fuzzy scale defined on chapter 3(see table 3.2) instead of defining it in km/h. As it was done while testing the normal network, the first tested activation function was the Sigmoid function and during the learning stage there was a considerable differences between the time spent by both types of network. The first network, with one hidden layer, took 62,23 seconds and 2076 epochs to conclude the training, while the ANN with two hidden layers finished its training after 142,73 seconds and 3270 epochs. In table 5.11 are presented the execution time values. The reason for this great divergence is the fact that during the deployment of the network with fuzzy logic, it occasionally did not achieve the desired error rate of 0,1% and thus did not complete the training stage, entering in an endless cycle. Due to this reason, it was decided to force the stop of the learning process if after a certain time period there was no improvements on the training error rate. Therefore, the rule to stop the learning stage before the time was: if the error rate increased during ten consecutive measurements, instead of decrease, after executing more than 300 epochs then the training should finish. Network Time (seconds) Epochs One hidden layer (15 neurons) 62,23 *finished before time 2076 Two hidden layers (10+5 neurons) 142,73 3270 Table 5.11: Epochs and time spent per each fuzzy ANN to finish the training - Sigmoid function Concerning the results, the network with one hidden layer predicted well the traffic for the non rush-hour periods, forecasting the speed value within the expected range (level four - normal traffic state). For the rush-hour periods the results obtained were not so satisfactory, with the ANN having some difficult to learn and depict deep variations of speed (i.e. from speed level 4 to level 2), predicting the speed within a range higher than the expected values as can be seen figure 5.28. The ANN with two hidden layers had similar results with regards to the normal traffic state period, predicting the values as expected. An improvement from the results of the first network was achieved in the prediction for the traffic during the peak hours, with the forecasted speed range close to the real values. The graphic with the results of the second network is presented in figure 5.29. In conclusion, the results obtained by the network with two hidden layers were more uniform in the rush-hour time, being this structure better when using the Sigmoid function than the model 53 Conclusions and Future Work improve its predictions would be perhaps by changing the input values used, since in the tests executed the speed scale use revealed to be less efficient due to the difficulty of predict high variations in the speed values. 6.2 Future Work In terms of possible future developments to continue the research covered by this thesis, one possible improvement was to expand the tests of both models (simulation and neural network) to the whole VCI motorway by departing from the work developed with the test-bed of Paranhos junction node, since both models can be adapted to work with the rest of the motorway. Additionally, the domain of the tests performed with the neural network could be expanded to cover all the existing traffic scenarios, from normal days to holidays season, as well as increase the number of inputs, by taking in account for instance the weather conditions related to each day. About the traffic data used by both models, it could be endowed of more precision by considering the GPS data related to the vehicles’ routes information [FCR10]. In addition, the GPS data can be used to improve the map behind the simulation model by processing it [FCR09]. Also, there are some potential applications that can be taken from the contributions made by this thesis such as, using the developed simulation model by artificial transportation systems applied in serious games scenario [RAKG13], for artificial traffic control systems [RFBO08], or even for simulation frameworks [FERO08] and decision-support tools related to transportation domain [ROB07]. Another enhancement could be the combination of both approaches, simulation with artificial neural network, by having the traffic data forecasted by the ANN and then use those forecasts in the simulation software. Basically, the neural network would be responsible for making traffic forecasts using the historical data; and then those predicted data would be used to feed the simulator to forecast how the traffic behaves with the received data. This hybrid model would lead to have a simulation model combined with artificial neural network, where the traffic forecasting was made by data-driven approach through the analysis of traffic patterns and then depicted in a real-life scenario by simulation. 60 References [AR00] A Aw and Michel Rascle. Resurrection of" second order" models of traffic flow. SIAM journal on applied mathematics, 60(3):916–938, 2000. [BB10] M Sari B. G. Çetiner and O Borat. A Neural Network Based Traffic-Flow Prediction Model. Mathematical and Computational ApplicationsNo. 2, pp., 15:269–278, 2010. [BBEK11] Michael Behrisch, Laura Bieker, Jakob Erdmann, and Daniel Krajzewicz. Sumosimulation of urban mobility-an overview. In SIMUL 2011, The Third International Conference on Advances in System Simulation, pages 55–60, 2011. [BRK11] S Boubaker, F Rehimi, and A Kalboussi. Comparative analysis of microscopic models of road traffic data. In 2011 4th International Conference on Logistics (LOGISTIQUA), 31 May-3 June 2011, pages 474–478, Piscataway, NJ, USA, 2011. IEEE. [CQL09] Y Chong, C Quek, and P Loh. A novel neuro-cognitive approach to modeling traffic control and flow based on fuzzy neural techniques. Expert Systems with Applications, 36(3, Part 1):4788–4803, 2009. [DAS+13] José Capela Dias, Pedro Henriques Abreu, Daniel Castro Silva, Gustavo Fernades, Penousal Machado, and António Leitão. 2 Preparing Data for Urban Traffic Simulation using SUMO. In 1st SUMO User Conference 2013, pages 25–34, Berlin- Adlershof, Germany, 2013. Deutsches Zentrum für Luft - und Raumfahrt e.V. [DC97] Mark S Dougherty and Mark R Cobbett. Short-term inter-urban traffic forecasts using neural networks. International Journal of Forecasting, 13(1):21–31, 1997. [Dia01] Hussein Dia. An object-oriented neural network approach to short-term traffic forecasting. European Journal of Operational Research, 131(2):253–261, 2001. [DKB93] Mark S Dougherty, Howard R Kirby, and Roger D Boyle. The use of neural networks to recognise and predict traffic congestion. Traffic engineering & control, 34(6), 1993. [DKB94] M S Dougherty, H R Kirby, and R D Boyle. Using neural networks to recognise, predict and model traffic. Artificial intelligence applications to traffic engineering, pages 235–250, 1994. [Dou95] Mark Dougherty. A review of neural networks applied to transport. Transportation Research Part C: Emerging Technologies, 3(4):247–260, 1995. 61 REFERENCES [DP08] Hussein Dia and Sadka Panwai. Nanoscopic traffic simulation: enhanced models of driver behaviour for ITS and telematics simulations. In 8th International Symposium on Transport Simulation, Queensland, Australia, 2008. Monash University. [ES97] J Esser and M Schreckenberg. Microscopic Simulation of Urban Traffic Based on Cellular Automata. International Journal of Modern Physics C, 8:1025–1036, 1997. [FC13] Gaetano Fusco and Chiara Colombaroni. An Integrated Method for Short-Term Prediction of Road Traffic Conditions for Intelligent Transportation Systems Applications. In 7th European Computing Conference (ECC ’13), pages 339–344, Dubrovnik, Croatia, 2013. WSEAS Press. [FCR09] Tiago R. M. Freitas, António Coelho, and Rosaldo J. F. Rossetti. Improving digital maps through GPS data processing. In 12th International IEEE Conference on Intelligent Transportation Systems, pages 1–6. IEEE, October 2009. [FCR10] Tiago R. M. Freitas, António Coelho, and Rosaldo J. F. Rossetti. Correcting routing information through GPS data processing. In 13th International IEEE Conference on Intelligent Transportation Systems, pages 706–711. IEEE, September 2010. [FERO08] Paulo A. F. Ferreira, Edgar F. Esteves, Rosaldo J. F. Rossetti, and Eugénio C. Oliveira. A cooperative simulation framework for traffic and transportation engineering. In Cooperative Design, Visualization, and Engineering, pages 89–97. Springer, 2008. [Fou14] OpenStreetMap Foundation. Open Street Map. http://www.openstreetmap.org, (accessed in March/April/May 2014), 2014. [Gip81] Peter G Gipps. A behavioural car-following model for computer simulation. Transportation Research Part B: Methodological, 15(2):105–111, 1981. [HB05] B Haut and G Bastin. A second order model for road traffic networks. In Intelligent Transportation Systems, 2005. Proceedings. 2005 IEEE, pages 178–184, 2005. [Hea09] J Heaton. Programming Neural Networks with Encog 2 in Java. Heaton Research, Incorporated, 2009. [Hea13] Inc. Heaton Research. Encog Machine Learning Framework. http://www.heatonresearch.com/encog, 2014(acessed in April/May 2014), 2013. [HHST02] D Helbing, A Hennecke, V Shvetsov, and M Treiber. Micro- and macro-simulation of freeway traffic. Mathematical and Computer Modelling, 35(5–6):517–547, 2002. [KFT+05] H Kanoh, T Furukawa, S Tsukahara, K Hara, H Nishi, and H Kurokawa. Short-term traffic prediction using fuzzy c-means and cellular automata in a wide-area road network. In Intelligent Transportation Systems, 2005. Proceedings. 2005 IEEE, pages 381–385, 2005. [KHH+05] Daniel Krajzewicz, Markus Hartinger, Georg Hertkorn, Peter Mieth, Christian Rössel, Julia Zimmer, and Peter Wagner. Using the Road Traffic Simulation “SUMO” 62 REFERENCES for Educational Purposes. In Traffic and Granular Flow’03, pages 217–222. Springer, 2005. [KHRW02] Daniel Krajzewicz, Georg Hertkorn, C Rössel, and P Wagner. Sumo (simulation of urban mobility). In Proc. of the 4th Middle East Symposium on Simulation and Modelling, pages 183–187, 2002. [KHWR02] Daniel Krajzewicz, Georg Hertkorn, Peter Wagner, and C Rossel. An example of microscopic car models validation using the open source traffic simulation SUMO. In Proceedings of Simulation in Industry, 14th European Simulation Symposium, pages 318–322, 2002. [Kra98] Stefan Krauß. Microscopic modeling of traffic flow: Investigation of collision free vehicle dynamics. PhD thesis, 1998. [KS83] H R Kashani and G N Saridis. Intelligent control for urban traffic systems. Automatica, 19(2):191–197, 1983. [LDXH12] Shu Lin, Bart De Schutter, Yugeng Xi, and Hans Hellendoorn. Efficient networkwide model-based predictive control for urban traffic networks. Transportation Research Part C: Emerging Technologies, 24(0):122–140, 2012. [Lop12] J Lopes. Traffic Prediction for Unplanned Events on Motorways. PhD thesis, Universidade Técnica de Lisboa - IST and Massachusetts Institute of Technoogy, 2012. [LSXH09] S Lin, B De Schutter, Yugeng Xi, and Hans Hellendoorn. A simplified macroscopic urban traffic network model for model-based predictive control. In Anastasios G. Chassiakos, editor, 12th IFAC Symposium on Control in Transportation Systems, pages 286–291. International Federation of Automatic Control, 2009. [LW55] Michael J Lighthill and Gerald Beresford Whitham. On kinematic waves. II. A theory of traffic flow on long crowded roads. Proceedings of the Royal Society of London. Series A. Mathematical and Physical Sciences, 229(1178):317–345, 1955. [LX08] Shu Lin and Yugeng Xi. An efficient model for urban traffic network control. In Proc. 17th IFAC World Congress, pages 14014–14066, 2008. [MP90] A. Messner and M. Papageorgiou. METANET: a macroscopic simulation program for motorway networks. Traffic engineering & control, 31(8-9):466–470, 1990. [MSK+11] Jose Macedo, Guilherme Soares, Zafeiris Kokkinogenis, Deborah Perrotta, and Centro Algoritmi. 10 A Framework for Electric Bus Powertrain Simulation in Urban Mobility Settings: coupling SUMO with a Matlab/Simulink nanoscopic model, 2011. [Ni06] Daiheng Ni. A framework for new generation transportation simulation. In 2006 Winter Simulation Conference, pages 1508–1514, Monterey, CA, USA, 2006. WSC. [NS92] Kai Nagel and Michael Schreckenberg. A cellular automaton model for freeway traffic. Journal de physique I, 2(12):2221–2229, 1992. 63 REFERENCES [RAKG13] Rosaldo J.F. Rossetti, Joao Emilio Almeida, Zafeiris Kokkinogenis, and Joel Goncalves. Playing Transportation Seriously: Applications of Serious Games to Artificial Transportation Systems. IEEE Intelligent Systems, 28(4):107–112, July 2013. [RFBO08] Rosaldo J. F. Rossetti, Paulo A. F. Ferreira, Rodrigo A. M. Braga, and Eugenio C. Oliveira. Towards an Artificial Traffic Control System. In 11th International IEEE Conference on Intelligent Transportation Systems, pages 14–19. IEEE, October 2008. [RI12] Aji Ronaldo and Taufiq Ismail. Comparison of the two Micro-Simulation Software AIMSUN & SUMO for Highway Traffic Modelling. Master thesis, Linköping University, 2012. [Ric56] Paul I Richards. Shock waves on the highway. Operations research, 4(1):42–51, 1956. [RLT11] Rosaldo J. F. Rossetti, Ronghui Liu, and Shuming Tang. Guest Editorial Special Issue on Artificial Transportation Systems and Simulation. IEEE Transactions on Intelligent Transportation Systems, 12(2):309–312, June 2011. [RM13] Stephen Robinson and Salissou Moutari. An Integrated Framework for Macroscopic Traffic Flow Simulation in Road Networks. Modern Traffic and Transportation Engineering Research, 2(3), 2013. [RN10] S J Russell and P Norving. Artificial Intelligence: A Modern Approach. Prentice Hall, 3rd edition, 2010. [ROB07] Rosaldo J. F. Rossetti, Eugenio C. Oliveira, and Ana L. C. Bazzan. Towards a specification of a framework for sustainable transportation analysis. In 13th Portuguese Conference on Artificial Intelligence, pages 14–19, Guimaraes, Portugal, December 2007. [Sav11] M Savrasovs. Urban transport corridor mesoscopic simulation. In 25th European Conference on Modelling and Simulation, ECMS 2011, pages 587–593, Kraków, 2011. ECMS. [Sav12] M Savrasovs. Traffic flow simulation on discrete rate approach base. Transport and Telecommunication, 13(2):167–173, 2012. [SNW01] Michael Schreckenberg, Lutz Neubert, and Joachim Wahle. Simulation of traffic in large road networks. Future Generation Computer Systems, 17(5):649–657, 2001. [ST07] M Savrasovs and Y. Tolujew. Application of Mesoscopic Modelling for Queuing Systems Research. In Igor V. Kabashkin and Irina V. Yatskiv, editors, 7th International Conference, Reliability and Statistics in Transportation and Communication, I. V. Kabashkin, I. V. Yatskiv (Eds.), number 2, pages 94–99, Riga, 2007. Rel Stat. [Sto14] Dirk Stocker. JOSM - Java OpenStreetMap Editor. https://josm.openstreetmap.de/, (accessed in March/April 2014), 2014. [TA04] J Tolujew and F Alcalá. A mesoscopic approach to modeling and simulation of pedestrian traffic flows. In Graham Horton, editor, Proceedings of the 18th European Simulation Multiconference, Magdeburg, Germany, 2004. ESM. 64 REFERENCES [THH00] Martin Treiber, Ansgar Hennecke, and Dirk Helbing. Congested traffic states in empirical observations and microscopic simulations. Physical Review E, 62(2):1805–1824, 2000. [TLJ10] Daimin Tang, Xiang Li, and Yijuan Jiang. Microscopic traffic simulation oriented road network data model. In 2nd International Conference on Future Computer and Communication, ICFCC 2010, May 21 - 24, 2010, volume 2, pages V287– V291, Wuhan, China, 2010. IEEE Computer Society. [vdBHDH07] Monique van den Berg, Andreas Hegyi, Bart De Schutter, and J Hellendoorn. Integrated traffic control for mixed urban and freeway networks: A model predictive control approach. European Journal of Transport and Infrastructure Research, 7(3):223–250, 2007. [XHM08] Binglei Xie, Zheng Hu, and Hongwei Ma. Fuzzy-logic-based traffic incident detection algorithm for freeway. In Machine Learning and Cybernetics, 2008 International Conference on, volume 3, pages 1254–1259, 2008. [XKHP98] H Xu, C M Kwan, L Haynes, and J D Pryor. Real-time adaptive on-line traffic incident detection. Fuzzy Sets and Systems, 93(2):173–183, 1998. [YWXW02] Hongbin Yin, S.C. C Wong, Jianmin Xu, and C.K. K Wong. Urban traffic flow prediction using a fuzzy-neural approach. Transportation Research Part C: Emerging Technologies, 10(2):85–98, April 2002. [Zad65] L A Zadeh. Fuzzy sets. Information and Control, 8(3):338–353, 1965. [ZY08] Yunlong Zhang and Zhirui Ye. Short-Term Traffic Flow Forecasting Using Fuzzy Logic System Methods. Journal of Intelligent Transportation Systems, 12(3):102– 112, 2008. 65 REFERENCES 66 Appendix A Data and configuration files used for testing the models In this appendix are presented the configuration files as well the data used in the tests executed. A.1 Data used for modelling traffic with DFRouter Table A.1: Data values used in the tests with dfrouter A3 (C) Paranhos (C) Paranhos (D) A3(D) Time (s) Vehicles (qpkw) Avg. speed (vpkw) Vehicles (qpkw) Avg. speed (vpkw) Vehicles (qpkw) Avg. speed (vpkw) Vehicles (qpkw) Avg. speed (vpkw) 0 73 78.95 106 83.65 107 81.48 84 76.57 5 86 81.01 109 86.49 112 84.79 97 78.85 10 84 80.61 103 88.09 135 82.99 101 78.66 15 84 79.74 98 84.26 158 83.74 135 79.06 20 72 80.01 87 88.23 117 82.62 90 76.79 25 66 74.35 85 83.05 102 83.38 72 79.39 30 65 81.37 78 89.56 105 82.59 81 80.89 35 71 79.87 84 87.31 81 84.94 66 79.64 40 48 81.98 58 91.4 77 84.84 58 80 45 53 79.04 64 89.23 71 86.55 62 78.15 50 63 81.3 59 94.46 59 86.24 46 78.98 55 49 79.18 66 87.65 56 83.73 49 80.12 60 38 80.63 49 88.24 63 86.67 48 81.12 65 45 78.42 46 85.52 59 86.63 47 83.34 70 27 76.11 39 88.05 46 86.46 33 87.73 Continued on next page 67 Data and configuration files used for testing the models Table A.1 – continued from previous page Time (s) Vehicles (qpkw) Avg. speed (vpkw) Vehicles (qpkw) Avg. speed (vpkw) Vehicles (qpkw) Avg. speed (vpkw) Vehicles (qpkw) Avg. speed (vpkw) 75 33 78.03 42 86.02 50 83.78 44 80.16 80 29 78.55 41 86.59 53 88.6 45 86.84 85 29 81.59 47 91.96 31 86.45 28 80.11 90 20 81.25 29 86.93 41 88.34 31 81.65 95 22 79.36 32 89.97 52 85.13 41 77.85 100 19 83.74 26 95.12 33 79.82 28 77.75 105 35 73.34 26 88.85 46 87.37 33 81.15 110 33 83.39 37 93.05 31 87.06 31 78.42 115 22 77.73 26 91.5 31 77.26 27 77.7 120 21 75.05 29 87.69 44 86.16 32 85.88 125 26 81.5 28 93.71 32 84.88 19 82.95 130 13 84.54 14 96.71 45 81.33 35 82.34 135 19 82.89 26 91.65 36 86.78 35 76.83 140 21 80.24 27 88.11 29 83.21 19 71.63 145 19 87.79 28 91.71 39 88.51 24 82.54 150 19 79.84 24 89.21 25 76.48 27 75.33 155 16 82.25 13 86.08 32 83 20 80.35 160 23 77.17 26 91.62 16 87.94 12 85.83 165 15 70.53 15 83.27 26 87.23 15 81 170 9 67.22 11 91.82 23 86.26 24 81.38 175 22 82.64 23 94.17 27 85.11 24 78.42 180 23 78.61 22 93.5 22 87.5 16 79.88 185 11 75.55 16 87.25 30 80.3 26 79.42 190 14 72.64 16 88.38 19 79.21 14 75.79 195 9 80.89 12 91.42 18 85 13 82.62 200 13 69.54 15 87.07 13 81.69 12 80.08 205 23 81.61 20 94.3 19 82 16 77.5 210 16 83.56 21 95.14 13 86.77 9 79 215 20 77.15 23 92.35 10 78.3 5 77.6 220 18 78.56 24 91.62 14 85.64 10 77.2 225 12 83.83 13 91.54 25 88.68 24 84.96 230 11 84.82 17 89.06 14 79.71 9 79.11 235 11 83.73 19 93.21 16 83.12 12 79.17 240 8 72.88 16 86.19 21 82.81 18 77.39 245 16 75.94 18 90.06 14 93.36 13 84.23 Continued on next page 68 Data and configuration files used for testing the models Table A.1 – continued from previous page Time (s) Vehicles (qpkw) Avg. speed (vpkw) Vehicles (qpkw) Avg. speed (vpkw) Vehicles (qpkw) Avg. speed (vpkw) Vehicles (qpkw) Avg. speed (vpkw) 250 13 80.85 20 90.65 15 80.93 13 71.62 255 25 78.76 34 91.5 22 85.77 15 81.47 260 12 76.5 15 83.13 16 72.19 10 84.7 265 22 81.86 23 91.26 25 75.04 21 77 270 24 78.08 27 89.89 20 84.1 18 82.67 275 15 70.67 19 89 21 87.43 14 82.57 280 15 76.53 18 85.33 21 82.86 17 80.94 285 28 77.14 31 91.48 22 81.14 13 82.85 290 23 79 26 88.54 19 89.21 16 80.5 295 15 75.33 16 87.75 23 79.26 18 77.61 300 22 71.82 28 89.89 13 84.31 11 77.36 305 22 80.18 21 91.24 23 72.13 24 78.25 310 25 81.44 35 90.14 20 84.05 23 74.65 315 43 75 47 88.66 26 83.77 19 78.84 320 29 76.76 39 89.72 33 80.55 36 81.28 325 33 75.67 34 88.21 30 87.2 20 88.35 330 28 80.64 29 91.79 24 81.33 21 85.48 335 41 77.22 43 88.6 32 81.88 24 83.71 340 38 76.87 50 88.08 32 78.78 29 82.66 345 42 77.9 50 87.74 52 77.21 38 76.32 350 46 72.07 56 88.68 34 82.18 33 79.88 355 47 71.36 49 88.1 39 83.56 31 79.16 360 33 74.94 42 85.81 51 86.18 47 80.77 1<?xml version="1.0" encoding="iso-8859-1"?> 2<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 3xsi:noNamespaceSchemaLocation="http://sumo.sf.net/xsd/sumoConfiguration.xsd"> 4<input> 5<net-file value="paranhos.net.xml"/> 6<additional-files value="rotas.rou.xml emitters.add.xml pois.add.xml sumo_detectors.add.xml"/> 7</input> 8<time> 9<begin value="0"/> 10 <end value="22000"/> <!-- simulation time for +/- 6 hours--> 69