Available online at www.sciencedirect.com
ScienceDirect Procedia Computer Science 63 (2015) 89 – 95
The 6th International Conference on Emerging Ubiquitous Systems and Pervasive Networks (EUSPN 2015)
Modeling and control of traffic flows Pashchenko F.F.a,*, Kamenev A.V.a, Kholodilov D.S.a a
V.A. Trapeznikov Institute of Control Sciences, Russian Academy of Sciences, 65 Profsoyuznaya street, Moscow 117997, Russia
Abstract The scheme of crossroad control has proposed and shown the results of simulation. The description of a complex road network of the city has held. Introduced the concept of the event model and control and its application to the example of traffic flow within the city. © 2015 2014Published The Authors. Published by Elsevier B.V. © 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 Program Chairs. Peer-review under responsibility of the Program Chairs Keywords: hybrid algorithm; genetic algorithm; control; event model; traffic flow
1. Introduction The task of traffic control in urban environments has practical importance, but building an accurate model of traffic network is a difficult problem that requires various simplifications due to the problems with modeling behavior of each car. The use of adaptive algorithms allows us to build an effective mathematical models and processes in order to use them for recognition systems, decision-making and control. In this paper we describe the method of crossroad control using hybrid algorithm proposed in paper1. We model traffic flow at the crossroad and build a control system to predict the optimal values of traffic lights phases. Then we present traffic simulation software built for assessing effectiveness of control mode. Finally, we describe approach to control of road network based on event model.
* Corresponding author. Tel.: +7-495-334-85-60; fax: +7-495-334-93-40. E-mail address:
[email protected]
1877-0509 © 2015 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 Program Chairs doi:10.1016/j.procs.2015.08.316
90
F.F. Pashchenko et al. / Procedia Computer Science 63 (2015) 89 – 95
2. Crossroad modeling In paper1 we model part of the road with a hybrid algorithm. This algorithm is based on neuro-fuzzy model Takagi (Takagi) and Sugeno (Sugeno)2,3,4 (TS-model) and combines the two identification: parametric and structural1. θ-th rule in TS-model: R T :if y (t 1) is Y1T ,..., y (t r ) is YrT
u (t ) is U 0T ,..., u (t s) is U sT r
s
l 1
l 0
then y T (t ) a0T ¦ alT y (t l ) ¦ blT u (t l ), T 1,.., n
(1)
c (a01 ,..., a1r , b01 ,..., bs1 ,..., a0n ,..., a rn , b0n ,..., bsn ) New notation of variables allows us to rewrite the rules in a compact form: RT :if x1 (t ) is X 1T ,..., xm (t ) is X mT ,
then yT (t )
(2)
m
c0T ¦ cTj x j (t ), T 1, n j 1
The power of Fuzzy Inference FI calculated the value of true θ-th rule: wT X1T ( x1 ) X 2T ( x2 ) ... X mT ( xm ) and fuzzy function: E T wT /( w1 w2 ... wn ), T 1, n So output of the model is: n y (t ) E T yT (t ), where yT cT xT cT , T
¦ T
0
(3) (4)
1, n
1
Next step is to learn this model on training data: we’ll find parameters of (5) – ሬࢉԦ. Main steps of the overall hybrid algorithm presented below:
Fig. 1. Algorithm scheme.
(5)
91
F.F. Pashchenko et al. / Procedia Computer Science 63 (2015) 89 – 95
J is a stop criterion. In our case it is the middle module error:
J (c )
1 T ¦ (| y(t ) y(t ) | / y(t )), T t1
(6)
Let’s apply this algorithm for control of traffic lights of crossroad. We consider a simple model of crossroad where traffic is possible only in two directions: straight and to the right. Below is a diagram of crossroad and the main parameters, see Fig. 2a:
Fig. 2. (a) Scheme of crossroad; (b) Crossroad model.
ݍଵ െ ݍସ - queues for each direction of the crossroad. Traffic lights work as follows: first the green toward ͳ ՞ ͵ െ ͳݐ, and then the green toward ʹ ՞ Ͷ െ ʹݐ. Then the cycle repeats. Let us consider the limited length of a cycle of traffic lights, that is, ͳݐ ʹݐൌ ܶ. T was set at the beginning of the modeling. Imagine our crossroads as a "black box" (Fig. 2b), we have: 1. Input parameters: ݍଵ െ ݍସ - it is the same queues at the crossroad, control signals: ݑଵ ǡ ݑଶ - It's duration of green traffic lights. ݑଵ – green time in the direction of traffic ͳ ՞ ͵, and ݑଶ – this green time in the direction of traffic ʹ ՞ Ͷ. In addition, the input data have constraint: ݑଵ ൏ ܶǢݑଶ ൏ ܶ. 2. Output signal S - is the time that needs when all cars go through crossroad. We use this model for hybrid algorithm for learning. For model learning we use data obtained with traffic simulation package described in the next part of the article. 3. Traffic simulation and crossroad control with SUMO suite We apply model built with hybrid algorithm to the problem of traffic lights control on crossroad. Given some values of input queues control algorithm finds optimal value of current traffic lights phase length, minimising total time of queues exhaustion. In related works like papers5,6 authors solve similar problem of traffic lights control using specialized algorithm for adjusting phase durations. We are taking inverse approach of building and applying general-purpose control algorithm to specific problem of traffic lights control. To train the model we used simulation data obtained from the traffic simulation suite – Simulation of Urban Mobility (SUMO)7. SUMO is a system which allows modelling of complex traffic systems. It is based on microscopic simulation approach where each vehicle movement is controlled explicitly using analytical model, which takes into consideration many aspects of motion like speed, acceleration, driver response delays, etc. It also provides means for execution of complex simulation scenarios - declarative specification of network structure plus interactive control of vehicles and traffic lights state. Using SUMO as a base for physical modelling of traffic we built our custom traffic simulation and crossroad control software package, which utilises hybrid algorithm described in part 2. Its source code is available online8. It supports following features:
92
F.F. Pashchenko et al. / Procedia Computer Science 63 (2015) 89 – 95
1) Generation of complex simulation scenarios and its execution with SUMO. 2) Control of traffic lights state using control mode or fixed phases mode. 3) Measurement of crossroad throughput. Next we describe in detail our methods of obtaining data for model training and measurement of crossroad throughput, and results of execution with control mode applied. Simulation data for model training consist of samples containing sizes of queues for each crossroad direction, fixed phases of traffic lights applied in simulation and the result of simulation - duration of simulation before exhaustion of all queues. We generate a number of such samples by executing each simulation and measuring its duration. To assess effectiveness of control mode compared to fixed phases mode we need to measure crossroad throughput in both cases. We propose two methods for estimating throughput. First estimate is calculated in simulation scenario similar to those we used for training data collection. We set up fixed queues, apply traffic lights control or fixed phases mode and measure duration of simulation before exhaustion of all queues. Estimating the throughput as total size of queues divided by the time needed for each vehicle to pass crossroad:
throughput
(total size of queues ) /( duration of simulation )
(7)
The result of such estimation is shown as a heatmap – Fig. 3. We compare relative values of throughput achieved with control mode and with fixed phases mode for each pair of queues size from two directions. Each cell on heatmap is a set of initial states for simulation. Initial states consist of all queues on every direction: ݍଵ ǡ ݍଶ ǡ ݍଷ ǡ ݍସ . For example, cell (10, 6) corresponds to init values ݍଵ ݍଷ ൌ ͳͲ and ݍଶ ݍସ ൌ . Values at heatmap greater than zero correspond to superior performance of control mode over fixed phases mode.
Fig. 3. Heat map
F.F. Pashchenko et al. / Procedia Computer Science 63 (2015) 89 – 95
Another method of throughput estimation is based on traffic jam detection. We set up the simulation in such way that from each direction constant number of vehicles per second arrive to the crossroad, so the ratio of two flows is fixed and the target value of throughput is predefined. We track the state of the roads during the simulation and once we detect that vehicles no longer can arrive at the defined rate - there is a jam at the entrance to the crossroad - we stop the simulation and try lower value, until we find a value at which there are no jams over sufficient period of time. Below, the maximum throughput search algorithm for given flows ratio is described: 1) Select knowingly large flow value for one of the directions (1 vehicle/sec in our setup of crossroads size, vehicles speed and acceleration parameters) 2) Run simulation and periodically measure current throughput - how many vehicles per second arrive to the crossroads (averaged over time window of 30 seconds) 3) If measured value of throughput is lower than expected value: expected throughput = flow value * (flows ratio + 1) then stop the simulation, decrease flow value and repeat step 2. 4) If during sufficiently long period of time (20 minutes in our setup) measured throughput value is equal to expected, then stop the algorithm – the maximum throughput value for given flows ratio is found. To present the results of this estimation we performed measurement for different flows ratios from two direction and compared the result with fixed phases mode of traffic lights – Fig. 4.
Fig. 4. Throughput
As we can see, control mode significantly outperforms fixed phases mode at low ratios of flows. This result is in agreement with simple reasoning - when one flow is significantly lower than the other, but phases are fixed, there are periods of time when the lower flow direction queue are exhausted and the value of throughput over such period is zero. Compared to the first method of estimation of throughput, now we see better results for control mode. The reason is that the second estimate is calculated over a sufficiently long period of time, whereas the first estimate shows only short-term performance of control mode.
93
94
F.F. Pashchenko et al. / Procedia Computer Science 63 (2015) 89 – 95
4. Event model for road network From modelling and control of isolated crossroad we turn to analysis of approach to modelling of city road network. To model city road network we need to consider mutual influence of traffic flows from adjacent crossroads, but centralised control of the whole network might significantly increase complexity of a model and computational costs. Let's consider an approach to control of road network based on event model in which each crossroad is controlled independently. Modelling a system with events presumes system structure of multiple agents which create event flows and listen to each others events. The main question of this modelling approach is how to define derived events with aggregation and matching9. City road network might be modelled as a system of connected crossroads. Let's consider an event model of such system and build an event hierarchy using Structural Event Model approach proposed in10. On the lowest level there are Raw Sensor Events emitted by road sensor, such as the value of traffic flow density at the moment FlowDensity(C, k, d), where C and k identify crossroad and direction of traffic on it and d is the value of density. Such events are usually emitted by sensor regularly with some interval. The next level in event hierarchy defines Domain Events. In our use case there are events related to modelling traffic lights phases. Events such as SwitchRed/SwitchGreen(C, k, T) define moments of switching traffic lights, where C and k identify crossroad and direction and T stands for the time after which switch will occur. These events are emitted by the component of the system responsible for calculation of phases. Status Events are derived from events of previous levels and used for signaling about complex situations which occur in the system, like high traffic density, traffic congestion or a blocked road. For example, event like OverloadedDirection(C, k) stands for a situation when direction k from crossroad C is overloaded with vehicles. Using SQL-like event definition language11 we can derive this event from SwitchRed and FlowDensity events as: insert into OverloadedDirection select switchEvent.C as C, switchEvent.k as k from ( select C, k from SwitchedRed.win:time(m minutes) group by C, k having median(T) > M ) as switchEvent, FlowDensity.win:time(m minutes) as flowDensityEvent where switchEvent.C = flowDensityEvent.C and switchEvent.k = flowDensityEvent.k and mean(flowDensityEvent.d) > D From this definition we see that overloaded direction is direction for which during last m minutes more than half of green phase lengths are greater than M and mean density of traffic flow is greater than D - green phases are long, but nevertheless flow density is high. Using the same principle we can define event for the opposite situation FreeDirection(C, k). Finally, there is Action Events level in the hierarchy. Such events are derived from Status Events and designate actions appropriate to a certain situation, which have to be taken by particular agents in the system. We define BypassCrossroad(C, k, C') event which designates action for vehicles (drivers) to bypass direction k of crossroad C and instead drive through crossroad C': insert into BypassCrossroad select overloadedEvent.C as C, freeEvent.k as k, freeEvent.C as C’ from OverloadedDirection.win:time(m minutes) as overloadedEvent, FreeDirection.win:time(m minutes) as freeEvent
F.F. Pashchenko et al. / Procedia Computer Science 63 (2015) 89 – 95
where nieghbour_crossroads(overloadedEvent.C, freeEvent.C) and overloadedEvent.k = freeEvent.k and not connects(overloadedEvent.C, freeEvent.C, freeEvent.k) Similarly, events for more complex scenarios of bypassing in city road network could be defined.
5. Summary In this paper, we presented the method of crossroad control using hybrid algorithm, which includes a neuro-fuzzy network for parametric identification and genetic algorithm for structural identification. We applied the algorithm to build the model for adaptive control of traffic lights on the isolated crossroad. To assess the performance of the model we built simulation software package based on SUMO simulator. The results we obtained show significant improvement of crossroad throughput when control is applied over a long periods of time. Finally, we analysed an approach to modelling of city road network with events and shown that this approach provides means for building multi-level models and could be applied for the domain of road network control. As a perspective directions of future research we can list event-driven approach for building algorithms of automatic control and adaptive adjustment of parameters in event definitions.
References 1. Kamenev A. V., Pashchenko F. F., Kudinov Y. I. Predicting traffic flow changes by fuzzy logic. Control and Decision Conference (CCDC), Taiyuan, China, 2012 24th Chinese. – IEEE, 2012. – pp. 1570-1572. 2. Takagi T., Sugeno M., Fuzzy identification of systems and its application to modeling and control, IEEE Transactions on Systems, Man and Cybernetics, Vol. 1, No. 15, 1985. pp. 116-132. 3. Pashchenko F.F. Введение в состоятельные методы моделирования систем. Ч.2. Идентификация нелинейных систем. М.:Финансы и статистика. 2007. 288 p. 4. Kudinov Y.I., Kudinov I.Y., Pashchenko F.F. Identification of Multivariable Fuzzy Systems. Proceedings of the 2011 Chinese Cjntrol and Decision Conference ( CCDC), 23-25 May 2011, Mianyang, China, pp. 1572-1575 5. Krajzewicz D., Brockfeld E., Mikat J., Ringel J., Rössel C., Tuchscheerer W., Wagner P., Wösler R. Simulation of modern Traffic Lights Control Systems using the open source Traffic Simulation SUMO. Proceedings of the 3rd Industrial Simulation Conference, Germany, Berlin, 2005, pp. 299-302. 6. Mikat J., Brockfeld E., Wagner P. Agent Based Traffic Signals on a basic grid. Proceedings of the 4th Workshop on Agent-Based Simulation, 2003. 7. Behrisch M., Bieker L., Erdmann J., Krajzewicz D. SUMO - Simulation of Urban MObility: An Overview. SIMUL 2011, The Third International Conference on Advances in System Simulation, 2011, 63-68. 8. https://github.com/kholodilov/crossroads-simulator 9. Etzion O., Niblett P., Event processing in action, Manning Publications, 2011. pp. 214-216. 10. Dunkel J. On complex event processing for sensor networks, International Symposium on Autonomous Decentralized Systems, 2009. pp. 1-6. 11. Esper Reference, Version 5.2.0. URL: http://www.espertech.com/esper/release-5.2.0/esper-reference/html/index.html
95