Available online at www.sciencedirect.com
ScienceDirect Procedia Computer Science 103 (2017) 20 – 27
XIIth International Symposium «Intelligent Systems», INTELS’16, 5-7 October 2016, Moscow, Russia
Intelligent traffic flows control software for megapolis A.I. Diveeva,b, E.A. Sofronovab,*, V.A. Mikhalevb, A.A. Belyakovb a
Federal Research Centre “Computing science and Control” of RAS, Vavilov str. 44, Moscow, 119333, Russia b RUDN University, Miklukho-Maklaya str. 6, Moscow, 117198, Russia
Abstract
A problem of traffic flows control in congestion conditions is considered. Control is performed on intersections using optimal traffic lights phases durations. The traffic lights phases durations are searched using previously proposed traffic flows mathematical model which is based on the controlled networks theory and evolutionary algorithms. To present a large scale road networks the model contains the connection matrices that describe interactions between input and output roads in subnetworks. Results obtained on traffic simulation software CTraf are given. ©2017 2017The TheAuthors. Authors. Published by Elsevier © Published by Elsevier B.V.B.V. This is an open access article under the CC BY-NC-ND license (http://creativecommons.org/licenses/by-nc-nd/4.0/). Peer-review under responsibility of the scientific committee of the XIIth International Symposium «Intelligent Systems». Peer-review under responsibility of the scientific committee of the XIIth International Symposium “Intelligent Systems” Keywords: Transportation systems; traffic control; controlled networks; evolutinary algorithms.
1. Introduction An effective way to control the urban traffic nowadays are controlled intersections. In some cities the number of cars is so huge that they cover significant space of the roads. In such cities the traffic flow is alike a continuous flow that often interferes passenger transport, pedestrians and itself to move in optimal way. The controlled intersections should divide this continuous flow into groups that move in turn. The main problem of traffic control by controlled intersections is the absence of exact mathematical model of traffic flow in urban roads. If we have a reasonably precise traffic model then we can guarantee the optimal control at controlled intersections by model predictive control approach.
* Corresponding author. E-mail address:
[email protected]
1877-0509 © 2017 The Authors. Published by Elsevier B.V. This is an open access article under the CC BY-NC-ND license (http://creativecommons.org/licenses/by-nc-nd/4.0/). Peer-review under responsibility of the scientific committee of the XIIth International Symposium “Intelligent Systems” doi:10.1016/j.procs.2017.01.004
21
A.I. Diveev et al. / Procedia Computer Science 103 (2017) 20 – 27
Many attempts have been made to develop exact models of urban traffic1-6. All these models have certain advantages and disadvantages. We should note that in comparison to liquid, for example, the traffic flow moves according to its goal and not only to the space available. To use model predictive control (MPC) more effectively the mathematical model should include the dependence between active phases durations of traffic lights and the flow states at each intersection. Thus, the exact traffic model should possess the properties of both micro- and macro models. In this paper, we try to estimate the exact number of cars at every moment on any road of the road network. We consider traffic on the roads at different moments in given time interval. A number of vehicles on all roads at some moment we determine as a current traffic flow state. It is evident, that the current number of vehicles on the road at some moment depends on the number of traffic on this road at the previous moment, as well as the number of traffic that left this road, and the number of traffic that come on this road during the last time interval. The traffic flow state changes depending on the traffic that left some roads and came on the other. Here to derive a mathematical model of traffic flow we use a model, based on the controlled network theory7-9. The model describes a road network, its changes, depending on the traffic lights signals, and it allows estimating traffic flow state at each moment. We have developed the model by introducing subnetworks that can be assembled in the whole network. The main challenge that we have faced at that point was that application of this model needed accurate values of manoeuvres throughputs and the routes of groups of vehicles. To determine these parameters it is proposed to use artificial neural networks (ANNs) with supervised learning. ANNs can refine necessary parameters by accurate values of traffic flow state. In this paper, an example of traffic control for complex intersection in Moscow, Russia is presented. 2. Mathematical model To construct a mathematical model of traffic flow control we use a controlled networks approach 7-9. Let the network consists of M intersections and L parts of the road. Maneuvers are performed at intersections. The traffic lights phases at intersections prohibit certain maneuvers. Nodes of the graph are the roads between intersections. The edges of the graph are maneuvers between the roads. As a result we obtain a directed graph of flexible configuration. To present the graph we use the following matrices: an adjacency matrix of basis network graph, a capacity matrix, a control matrix, a distribution matrix, a traffic light phases matrix To describe the flexibility of the network configuration we introduce the control vector u [u1
uM ]T , ui {0,
,ui } ,
(1)
where ui is a number of the phase of traffic light at intersection i , u i is a maximal number of active phases at intersection i , i 1, , M . A network configuration change is described by a configuration matrix that is also an adjacency matrix of a partial subgraph A (u ) [ ai , j (u )] , i, j ai , j u
1,
,L ,
1, if ai , j 1, uci , j {Fi , j } , i, j ® ¯0, otherwise
(2)
1,
,L .
(3)
A configuration matrix influences the structures of all other matrices. To describe the parameters of the traffic flow let us introduce a time interval, 't . We assume that the durations of all phases are estimated in integer value, 't . We also assume that all traffic lights are synchronized so that the count of integer values of time intervals for all traffic lights in the network is done simultaneously. To obtain the quantitative characteristics of the traffic flow for each part of the road we use a flow state vector
22
A.I. Diveev et al. / Procedia Computer Science 103 (2017) 20 – 27
xL (tk )]T ,
x(tk ) [ x1 (tk )
(4)
1 where x j (tk ) is a number of cars on the road j at time t k , x j (t k ) R , j 1, control timing periods. Further on rewrite
x j (t k )
,L, k
0,
, N , N is a number of
x j (k )
(5)
Flow state x ( k ) depends on the road network configuration and the values of flow state vector at the previous moment of time, x ( k 1) . We have the following model of traffic flow control x( k )
x(k 1) ((x(k 1)1TL ) b A (u ( k )) b D ((x(k 1)1TL ) b A (u ( k )) b D A (u ( k )) b B ))1 L
T ((x( k 1)1TL ) b A u k b D ((x(k 1)1TL ) b A u k b D A u k b B )) 1 L δ ( k ) ,
where B is a capacity matrix, D is a distribution matrix, δ ( k ) [G1 ( k ) on road i , i 1,
(6)
G L ( k )]T , G i ( k ) is the value of input flow T
, L , depending from some random factor, b is an Hadamard product of matrices, 1 L
[1 1] , L
ab
b, if a ! b, ^0a , othewise.
Subnetworks Consider a large road network of K subnetworks. The models of subnetworks are presented as: ( Al (u(k )), Bl , Cl , Dl , Fl : l 1,
, K) .
To connect the models of all subnetworks let us introduce a connection matrix for each subnetwork Rl
[ ril, j ] , i
1,
,n1l , j , l
1, K ,
(7)
where ril, j is an index of element in the input roads vector for the road j , n1l is a number of output roads in the subnetwork l . For each part of the road the model should include vectors of input and output roads vl
[v1l
wl
[ w1l
v l l ]T , n0
wl l ]T , n1
(8)
(9)
where vil is an index of an input road in subnetwork l , wil is an index of an output road in subnetwork l , n0l is a number of input roads in subnetwork l .
23
A.I. Diveev et al. / Procedia Computer Science 103 (2017) 20 – 27
Using connection matrices we can simulate the flow dynamics in all subnetworks simultaneously. At each time interval 't we recalculate the flow vector in accordance with connection matrix J z 0 , xDj ( k )
ril, j
,n1l , j , l
where i 1,
x El ( k ) ,
(10)
,K , D
1,
vJj , E
wil .
3. Model predictive control To solve the optimal control problem for the traffic flows it is necessary to calculate the active phases durations of the traffic lights at intersections q j ,i d q j ,i d q j ,i , i
1,
, u j , j
,M ,
1,
(11)
where q j ,i and q j ,i are given. The control vector u
[u1
uM ]T , ui {0,
,ui } ,
(12)
where ui is a number of the phase of traffic light at intersection i , u i is a maximal number of active phases at intersection i , i 1, , M . The control should minimize the functional with constraints:
J1
¦
xi N
iI1
¦
jI 2
xj N p
N
L
§§ x k i
¦¦ ¨¨ ¨¨ k 1 i 1 ©©
xi
· · xi k 1¸ 1 ¸ xi o min , ¸ ¸ xi ¹ ¹
(13)
where I1 is a set of input roads indices, I 2 is a set of output roads indices and p is a penalty coefficient. To solve the control synthesis problem it is necessary to determine the discrete value of phase duration by the discrete value of flow. As a result, we obtain a multidimensional function Y
G z ,
(14)
T ª yi , j º , yi , j Y , i 1, ui , j 1, M , z > z1 z L @ , z k Z , k 1, L . ¬ ¼ To solve the problem of control system synthesis namely finding G z we use a genetic algorithm.
where Y
In terms of model predictive control during control problem solving we consider the prediction horizon to be several times greater than max sum length of traffic light phases. Well, the proposed model is supposed to fully describe traffic. So the solution found on prediction horizon is supposed to work also beneath it. 4. Artificial neural network for road network parameters indentification Nowadays there are many different variations of neural networks from those with only one or two layers of single direction logic, to complicated multi–input many directional feedback loops and layers. Since neural networks are universal approximaton tools that use elementary operations over a large number of simple functions with unknown parameters, the main challenge of neural networks application is the search of these parameters which is a problem of large scale finite dimentional optimization.
24
A.I. Diveev et al. / Procedia Computer Science 103 (2017) 20 – 27
Neural networks may consist of several layers. Each layer is a linear function of inputs from the previous layer. Linear functions describe hyperplane in the space of inputs as a sum of input vector elements and adjustable coefficients called weights. Outputs are nonlineary transformed by activation functions. For approximation of complex
Fig. 1. The placement of intersections and traffic lights.
functions multi-layer networks are used. The dimentions of input and output vectors at each internal layer are also increased that broadens the number of weights. Model can cope with any parts of the road network and can describe traffic flow dynamics on intersection. As far as parameters of model change, depending on the time of the day, season or even some accidents, and the found optimal control may become not optimal for the model with new parameters, we need to trigger the change, identify new parameters and find the new optimal control. We address this issue using ANN. The inputs are traffic flow state vectors x ( k ) and x ( k 1) that show traffic flow on all parts of the road at intersection in times k and k 1 . The outputs are adjustable parameters: elements of capacity matrix B and distribution matrix D . Then to trigger model parameters change we use norm between the real traffic flow state and the one, calculated by our model || x* (k 1) x(k 1) ||! H , where H is a given small positive value. If this condition becomes true, then we get new parameters obtained by ANN and find optimal control for the model with this parameters. 5. Implementation of Ctraf software package on the real group of intersections at metro station Akademicheskaya Problems of implementing the interface can be divided into two subgroups. The first is a task of developing an interface allowing even an untrained user to intuitively and easily digitize a real urban transport system (Fig. 1). The second (Fig. 2) is a visual display of the results of modeling and optimization efficiency, by means of the same interface. To solve these problems, it was decided to develop a web platform that would make it easy to digitize transport systems from any location (including a direct location at a road intersection) using a PC, tablet or mobile phone with internet access. Also, such a platform can immediately demonstrate and evaluate the effectiveness of the optimization. The following programming and markup languages were chosen as the technology stack: HTML, CSS, JavaScript, Delphi and the jQuery library, OpenLayers. The use of these languages allows us to achieve a good separation of the visualization and processing core. That, if necessary, will make it easy to integrate the entire interface to existing software systems, and to use the processing core as part of a server or built-in library. Digitizing interface (Fig. 1): x the loading of a real map; x the arrangement of the vertices (denoting input, intermediate and output transport flows); x entering information on the allowed maneuvers (matrix A);
A.I. Diveev et al. / Procedia Computer Science 103 (2017) 20 – 27
x the placement of traffic lights; x entering the information on traffic light phases;
Fig. 2. Example of traffic flows display on some iteration.
x binding the maneuvers to the traffic lights and their phases (matrix C and F); x entering the capacities of the maneuvers (matrix B); x entering the information on the streams distribution values (matrix D). Necessary features and key points: x x x x x x
work with real data (coordinates, distances, bandwidths, etc.); entering an unlimited number of objects; an adaptive interface for different devices; secure user from random errors while entering the data; intuitiveness and ease of interaction (ease of binding values to objects); abstraction of objects (trams, pedestrians, public transport, etc).
The interface of simulation results (Fig. 2) should clearly show traffic congestion on the map, visible changes of heavy traffic at stepwise switching phases, values of traffic flows, the quantitative optimization data during each switching phase (relative to non-optimized network). 6. An example Consider a road network that consists of 6 intersections. Graphs of intersections are shown on Fig. 2 – 4. Intersection adjacency matrices for intersections are the following forms
A1
ª0 «0 «0 «0 «0 «0 «0 ¬« 0
1 0 0 0 0 1 0 0
1 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 1 0 0 1 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0º 0» 0» 0» , A 2 0» 0» 1» 0 ¼»
ª0 «0 «0 «0 «0 «¬ 0
1 0 0 0 1 0
1 0 0 0 0 0
0 0 0 0 0 0
0 0 0 1 0 0
0º 0» 1» , 3 1» A 0» 0 »¼
ª0 «0 «0 «0 «0 ¬«0
1 0 0 0 1 1
1 0 0 0 0 1
1 0 0 0 1 1
0 0 0 0 0 0
0º 0» 0» , 0» 0» 0 ¼»
25
26
A.I. Diveev et al. / Procedia Computer Science 103 (2017) 20 – 27
Fig. 3. Intersections 1 - 6
A
4
ª0 «0 «0 «0 «0 «¬0
1 0 0 0 1 0
1 0 0 0 1 1
1 0 0 0 1 1
0 0 0 0 0 0
0º 0» 0» , A 5 0» 0» 0 »¼
ª0 «0 «0 «0 «0 «¬0
1 0 0 0 1 0
1 0 0 0 0 0
0 0 0 0 0 0
0 0 0 1 0 0
0º 0» 1» 1» 0» 0 »¼
,
A6
ª0 «0 «0 «0 «0 «0 «0 «0 «0 ¬«0
1 0 0 0 1 0 0 0 0 0
1 0 0 0 1 0 1 0 0 0
1 0 0 0 1 0 1 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 1 0 0 0 1
0 1 0 0 0 1 0 0 0 1
0 1 0 0 0 1 0 0 0 1
0º 0» 0» 0» 0» . 0» 0» 0» 0» 0 ¼»
The intersections are connected through vectors of input roads and connection matrices. Vectors of input roads are: v 1 [1 4 6 7 ]T , v 2 [1 4]T , v 3 [1 5 6]T , v 4 [1 5 6]T , v 5 [1 4]T , 6 v [1 5 6 10 ]T . .. Vectors of output roads are: w 1 [ 2 3 5 8]T , w 2 [ 2 6]T , w 3 [ 2 3 4]T , w 4 [ 2 3 4]T , w 5 [ 2 6]T , 6 T w [3 4 8 9 ] . The intersections are connected through vectors of input roads and connection matrices:
R
1
R4
ª0 «0 «0 «¬0
1 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0º 0» , 2 0» R 0 »¼
ª0 0 0 0 1 0 º 5 «0 0 6 0 0 0 » , R «¬ 0 0 0 0 0 0 »¼
ª7 0 0 0 0 0 º , R 3 «¬0 0 5 0 0 0 »¼
ª0 0 0 0 0 10 º , R 6 «¬0 0 0 6 0 0 »¼
ª0 0 0 5 0 0 º «0 4 0 0 0 0 » , ¬« 0 0 0 0 0 0 »¼
ª0 «0 «0 ¬« 0
0 0 0 0
0 0 0 0
0 0 0 0
4 0 0 0
0º 0» . 0» 0 ¼»
All modeling has been held with equal initial conditions: same traffic state on all parts of roads, and same model parameters. Simulation showed that the obtained optimal control lead to significant decrease of congestions. The criteria (13) changing through algorithm’s iterations is on Fig. 4. The optimal traffic phases lengths:
A.I. Diveev et al. / Procedia Computer Science 103 (2017) 20 – 27
P
ª 30 « 49 «127 « 38 « 30 «¬19
0 º 45 » 11 10 » , 37 37 » » 51 »¼ 25
Fig. 4. Criteria per generations
It is interesting to notice that the algorithm considered the second phase on first intersection as useless, through evaluating it’s length as 0. For intersection 6 the parameters of capacity matrix have been adjusted by double-layer ANN. ANN had 10 inputs and 15 outputs for each nonzero element in B . Three values of each element with step 1/3 from nominal value were considered. Learning time was 1000 iterations. 7. Conclusion The automatic search for optimal phases durations is a challenging problem for smart cites infrastructure. Using CTraf can help to reduce congestions in conditions of existing road network. At the same time, obtained mathematical model and ANN approach can suggest new parameters of the roads. Acknowledgements This work was supported by Russian Foundation for Basic Research №16-08-00639a. and at financially supported by the Ministry of Education and Science of the Russian Federation on the program to improve the competitiveness of Peoples’ Friendship University of Russia (RUDN University) among the world’s leading research and education centers in the 2016-2020. References 1. 2. 3. 4. 5. 6. 7. 8.
Whitham GB. Linear and Nonlinear Waves. John Wiley & Sons Inc; 1974. Papageorgiou M. Applications of Automatic Control Concepts to Traffic Flow Modeling and Control. Berlin: Springer; 1983. Ardekani SA, Herman R. Urban Network-Wide Variables and Their Relations. Transportation Science 1987;21(1):1987. Mauro V. Road Network Control. In: Papageorgious M, editor. Concise Encyclopedia of Traffic and transportation Systems. Advanced in Systems, Control in Information Engineering. Pergamon Press; 1991. p. 361-6. Popkov Yu S. Macrosystems theory and its applications. Berlin: Springer Verlag; 1995. Shvetsov VI. Mathematical Modeling of Traffic Flows. Avtomat i Telemekh 2003;11:3-46. Diveev AI, Sofronova EA. Synthesis of Intelligent Control of Traffic Flows in Urban Roads Based on the Logical Network Operator Method. In: Proceedings of European Control Conference 2013; p. 3512-7. Diveev AI, Sofronova EA, Mikhalev VA. Model Predictive Control for Urban Traffic Flows. In: Proceedings of 2016 IEEE International Conference on Systems, Man and Cybernetics 2016; p. 3051-6.
27