Real Time Traffic Simulation Using Cellular Automata

Download Real Time Traffic Simulation Using Cellular Automata

Post on 04-Apr-2018




0 download

Embed Size (px)


  • 7/31/2019 Real Time Traffic Simulation Using Cellular Automata


    EG UK Theory and Practice of Computer Graphics (2010)John Collomosse, Ian Grimstead (Editors)

    Real-Time Traffic Simulation Using Cellular Automata

    C. S. Applegate, S. D. Laycock and A. M. Day

    Crowd Simulation Group, School of Computing Sciences, University of East Anglia, Norwich, United Kingdom. NR4,,


    In this paper, we present a method to simulate large-scale traffic networks, at real-time frame-rates. Our novel

    contributions include a method to automatically generate a road graph from real-life data, and our extension to a

    discrete traffic model, which we use to simulate traffic, demonstrating continuous vehicle motion between discrete

    locations. Given Ordnance Survey data, we automatically generate a road graph, identifying roads, junctions,

    and their connections. We distribute cells at regular intervals throughout the graph, which are used as discrete

    vehicle locations in our traffic model. Vehicle positions are then interpolated between cells to obtain continuous

    animation. We test the performance of our model using a 500 x 500m2 area of a real city, and demonstrate that

    our model can simulate over 600 vehicles at real-time frame-rates (> 80% network density).

    Categories and Subject Descriptors (according to ACM CCS): I.3.5 [Computer Graphics]: Computational Geome-try and Object ModelingPhysically based modeling; I.6.8 [Simulation and Modeling]: Types of SimulationAnimation

    Keywords: traffic simulation, mesoscopic simulation, cellular automata, road generation, vehicle animation

    1. Introduction

    For more than 50 years, researchers from a diverse set of dis-ciplines have been studying the behaviour of traffic flow tobetter understand the causes of traffic congestion, accidentsand related phenomena. As the worlds population continuesto increase, there is high demand for effective and efficienttransport infrastructures that alleviate these problems. Typ-ically, cost-effective solutions are designed and developedusing simulation packages, which allow transportation engi-neers to accurately model road networks and evaluate theirdesigns though visual simulation. These packages providethree-dimensional representations of different traffic scenar-ios prior to their actual construction, allowing professionals,

    local authorities and the general public to instantly under-stand the expected impact on the surrounding environment.However, to better portray this information, methodologiesto model larger-scale networks at higher visual fidelity aredesirable.

    One of the major challenges faced by researchers in thecomputer graphics industry, involves the design and imple-mentation of algorithms that allow large-scale simulations torun at real-time frame-rates. This is a typical requirement of

    traffic simulators, as it enables designers to modify and in-teract with an environment in real-time, reducing the devel-opment time and overall cost of a project. However, to ob-tain the required performance, many applications will com-promise behavioural accuracy or visual quality. These chal-lenges also translate to the entertainment industry, as real-time traffic simulation is required in computer games, filmsand virtual tourism applications.

    Over the years, there has been extensive research into thedevelopment of realistic traffic simulations, with the ma-jority of literature either focusing on agent-based micro-scopic models, where individual vehicles have their own de-

    tailed behaviour, or continuum-based macroscopic models,which focus on the collective behaviour of vehicles, mod-elled through density conservation equations. A third typeof traffic simulation, mesoscopic models, combines micro-scopic and macroscopic model properties, simulating indi-vidual vehicles that show collective behaviour. However,there has been relatively little literature that considers ex-tending mesoscopic traffic models to produce traffic simula-tions, which exhibit both accurate behaviour and continuousanimation.

    c The Eurographics Association 2010.
  • 7/31/2019 Real Time Traffic Simulation Using Cellular Automata


    C. S. Applegate, S. D. Laycock and A. M. Day / Real-Time Traffic Simulation Using Cellular Automata

    In this paper, we propose a system to simulate large-scaletraffic networks in real-time. Our novel contributions includea method to automatically create a road graph from real-life data, and our extension to Nagel and Schreckenbergsoriginal mesoscopic traffic model [NS92], which we use tosimulate a large-scale traffic network, demonstrating contin-uous animation between discrete locations. We test the per-formance of our model using a 500 x 500m2 area of a realcity, and demonstrate that our model can simulate over 600vehicles at real-time frame-rates (> 80% network density).

    2. Related Work

    The realistic behaviour of vehicles has been studiedextensively in literature by researchers from a varietyof disciplines. The pioneering work of Lighthill andWhitham [LW55] and Richards [Ric56], investigated the be-haviour of traffic flow as a density continuum, modelling themacroscopic or continuous behaviour of traffic using the-ory from fluid-dynamics. The Lighthill-Whitham-RichardsModel (LWR Model) uses aggregate variables representingthe average velocity of vehicles, traffic density and trafficflow, to model the collective behaviour of vehicles fromthe defined relationship between these attributes. The maindisadvantage of macroscopic traffic models is that they donot differentiate between individual vehicles, and it is there-fore difficult to accurately simulate complex urban networkswhere there are a diverse range of vehicle types and driverbehaviours. An advantage of modelling the collective be-haviour of traffic is that simulations operate at high-speeds.For these reasons, macroscopic models are often used tosimulate large-scale networks where detail is less important.

    Recently, Sewall et al. [SWML10] extended a macroscopictraffic model to produce detailed three-dimensional anima-tions of traffic flow on large-scale networks. Their systemuses continuum dynamics to model traffic, but maintains in-dividual vehicle information to display each vehicle. Theirmethod is scalable with multi-core/multi-processor architec-tures and runs at real-time frame-rates.

    Microscopic or discrete traffic simulations are the mostpopular form of traffic simulation, and model the behaviourof individual vehicles with detailed behaviours. Microscopicmodels are often preferred to macroscopic alternatives, asthese systems can accurately simulate traffic on both urbanand rural road networks, using car-following and lane-

    changing rules, which model individual vehicle attributessuch as speed, acceleration, braking forces, reaction times,etc. In these rules, the movement of each vehicle is calcu-lated based on the position or velocity of the vehicle in front.A disadvantage of microscopic models is that they typicallyrequire more computation time when compared with macro-scopic models. Significant contributions in this area can befound in the works of Gerlough [Ger55], Newell [New61]and Gipps [Gip81]. Popular microscopic traffic simulatorsinclude, Quadstone Paramics and PTV AGs VISSIM.

    Mesoscopic traffic simulators combine microscopic andmacroscopic model properties, simulating individual vehi-cles that show aggregated behaviour at high computationspeeds. In 1992, Nagel and Schreckenberg [NS92] proposeda mesoscopic model for traffic simulation using cellular au-tomata. The authors used a one-dimensional array to repre-sent a single-lane carriageway, which was segmented intoa finite number of cells. Each cell contained a maximumof one vehicle, and vehicles moved between consecutivecells using simple rules. Updates were performed per-celland in parallel, thus the performance of this model is scal-able with multi-core/multi-processor architectures. Rickertet al. [RNSL96] extended Nagel and Schreckenbergs modelto incorporate two lanes of traffic, where vehicles were per-mitted to change lanes, based on their distance to neigh-bouring vehicles. Nishinari and Takahashi [NT99] use Burg-ers Cellular Automaton (BCA), an ultra discrete version ofthe Burgers equation to model traffic flow. In their model,each cell can contain a number of vehicles, and movement

    between cells is defined by the evolution of the BCA. InNishinari and Takahashis model, individual lane-changingrules are neglected, but the macroscopic effects of lanechanges are preserved. More recently, cellular approacheshave been used to model the interactions in mixed bi-cycle flow [JJW04], the interactions between pedestriansand low-speed vehicles (e.g. bicycles, tricycles and bar-rows) [JW06b, JW06a] and between different types of ve-hicle [ZJG07, MDDZ07, CYZ08, LGJZ09].

    Although cellular approaches combine the advantagesof macroscopic and microscopic models, their discrete na-ture is not directly suitable for animating the continuousmovement of traffic, as vehicles appear to pop between

    disjoint cells. Animation quality could be improved us-ing finer discretisations, but at the cost of reducing per-formance. Alternative techniques for simulating the be-havioural animation of vehicles have been investigated inthe literature; Go et al. [GVK06], introduce a frameworkfor animating autonomous agents in interactive applications,simulating the behaviour of vehicles and spacecraft, bycombining Reynolds steering behaviours for autonomousagents [Rey99] with an online path-planning algorithm. Theauthors increase the run-time performance of their modelthrough an adaptive sampling technique, which reduces thenumber of paths to search. More recently, van de Berg etal. [vdBSLM09] present a technique to reconstruct a three-dimensional visualisation of traffic from road-sensor data, in

    real-time. Their method records vehicle information at twodiscrete locations on a stretch of road, and computes vehi-cle trajectories between these two points. To produce real-istic results, the algorithm minimalises the number of lanechanges and vehicle acceleration and deceleration, whilstmaximising the distance between individual vehicles.

    These systems demonstrate high-quality vehicle anima-tions. However, there is little literature which considers ex-tending highly-scalable mesoscopic traffic models to pro-

    c The Eurographics Association 2010.

  • 7/31/2019 Real Time Traffic Simulation Using Cellular Automata


    C. S. Applegate, S. D. Laycock and A. M. Day / Real-Time Traffic Simulation Using Cellular Automata

    duce similar results at high speeds. We identify that this isan area that requires further research, and therefore focus onmesoscopic models in this paper.

    To model traffic, we require a road graph that details thelayout of the road network. This could be created manu-

    ally, but can become a time-consuming and laborious pro-cess when modelling large-scale networks. A variety of tech-niques for automatically generating roads have been studiedin the literature. Chen et al. [CEW08] proposed a methodto interactively and intuitively generate large-scale road net-works, based on tensor fields, which guide the automaticgeneration of roads. In their work, the authors present avariety of techniques to manipulate the tensor fields to ob-tain typical urban street networks. More recently, Galin etal.[GPMG10] proposed an automated technique for generat-ing roads in complex environments that contain rivers, lakes,mountains and forests. A weighted shortest-path algorithm isperformed between an initial and final location on the land-scape, which is discretised into a regular grid. Weightingscan be adjusted interactively to create roads which exhibitcertain characteristics.

    The above works have presented methodologies to gener-ate realistic but fictitious roads from scratch, and also tech-niques to edit existing road networks. However, there hasbeen little research with focus on the automatic identifica-tion of road structures, i.e. extracting roads, junctions, andtheir connections, from road centre line data. The ability toautomatically generate road graphs from road centre linesis highly desirable, as it would enable networks to be in-tuitively designed with a few brush strokes in an editor, orcreated from Ordnance Survey data. We therefore focus onsuch techniques in this paper.

    3. Generation of the Road Graph

    To begin our process, we require a road graph that encodesthe structure of the road network, detailing roads, junctions,and their connections. In this section, we present our noveltechnique for automatically generating a road graph fromreal-life data. It is important to note, that in our currentimplementation, all roads are considered as uni-directionalroads. However, we plan to extend our technique to includebi-directional roads, in future work.

    To generate the road graph, we use road centre lines ob-tained from Ordnance Survey LandLine.Plus data, repre-

    sented as a set of vertices and connecting edges (Figure 1).We then identify and classify junctions, such that, verticeswith three or more connecting edges are stored as road junc-tions, and vertices with only one connecting edge are storedas terminal junctions. These are junctions that provide eitherentry into or exit from the road network (Figure 2).

    We consider a road to be a set of connecting edges thatstart and end at a road or terminal junction. However, we re-alise that there may be several junctions along a single road,

    Figure 1: Road centre lines of a 500 x 500m2 tile area of a

    real city. The data is represented as a set of vertices and con-

    necting edges. At the boundaries of the tile, there are some

    isolated edges, created from the tile segmentation.

    Figure 2: Identified junctions on the road graph. Blue points

    indicate junctions with three or more connecting edges,

    green points indicate entry junctions, and red points indi-

    cate exit junctions.

    and therefore suggest that the end of a road could be identi-fied by comparing the angles between connected edges at a

    junction. In our implementation, if the smallest of these an-gles is greater than 10, we have reached the end of the road.This value was selected arbitrarily, as it provided the mostaccurate classification of roads in our test data (Figure 3).

    Using this criteria, individual roads are identified. Thisis an iterative process, which visits each terminal junctionand traverses through the string of unvisited edges, until theend of the road is identified. When it is possible to followmultiple edges, the edge with the smallest angle incident to

    c The Eurographics Association 2010.

  • 7/31/2019 Real Time Traffic Simulation Using Cellular Automata


    C. S. Applegate, S. D. Laycock and A. M. Day / Real-Time Tra...