Agent-based Large Scale Simulation of Pedestrians With Adaptive Realistic Navigation Vector Fields

8
EG UK Theory and Practice of Computer Graphics (2010) John Collomosse, Ian Grimstead (Editors) Agent-based Large Scale Simulation of Pedestrians With Adaptive Realistic Navigation Vector Fields Twin Karmakharm , Paul Richmond and Daniela M. Romano 1 1 University of Sheffield Department of Computer Science,211 Portobello, Sheffield, S1 4DP Abstract A large scale pedestrian simulation method, implemented with an agent based modelling paradigm, is presented within this paper. It allows rapid prototyping and real-time modifications, suitable for quick generation and testing of the viability of pedestrian movement in urban environments. The techniques described for pedestrian simulation make use of parallel processing through graphics card hardware allowing simulation scales to far exceed those of serial frameworks for agent based modelling. The simulation has been evaluated through benchmarking of the performances manipulating population size, navigation grid, and averaged simulation steps. The results demon- strate that this is a robust and scalable method for implementing pedestrian navigation behaviour. Furthermore an algorithm for generating smooth and realistic pedestrian navigation paths that works well in both small and large spaces is presented. An adaptive smoothing function has been utilised to optimise the path used by pedestrian agents to navigate around in a complex dynamic environment. Optimised and un-optimised vectors maps obtained by applying or not such function are compared, and the results show that the optimized path generates a more realistic flow. Categories and Subject Descriptors (according to ACM CCS): I.2.11 [Distributed Artificial Intelligence]: Multiagent systems 1. Introduction Pedestrian simulations have found increasing use in various fields from entertainment to disaster planning [Sof10, Sim10, TP02] where they can be used to predict and model the ef- fect of crowd movement under various environmental con- ditions. As the population densities of urban areas continu- ous to increase, it is likely that pedestrian simulations will play a progressively more important role in ensuring safe and optimised crowd flows within urban spaces. Simulating groups of pedestrians is now almost exclusively performed by considering an individual approach, where agents interact directly to form emergent group behaviour, rather than using a top down set of equations to attempt to model group dy- namics. This individual emphasis, defined as either an agent simulation or particle force simulation lends itself well to the natural description of behaviour through sets of defined rules. Likewise, heterogeneity can be introduced within the simulation as each pedestrian is a unique entity, responsible for their own actions and personal traits. In addition to simu- lating the interaction between agents, pedestrian simulations also require an additional technique to model the flow of pedestrians through the environment. This can be achieved using either a global navigation technique (common to all agents) or through individual path planning. Whilst the individual approach to agent simulation has many advantages it poses a significant computation prob- lem when considering large scale simulations. Due to the need to simulate ever increasingly large populations sizes it has become apparent that traditional serial simulation frame- works are therefore unable to meet the real time requirement needed for visual exploration with such models. Paralleli- sation offers a solution to this issue, however hardware ar- chitectures such as the Graphics Processing Unit (GPU) are far from easy to develop with and require specialist knowl- edge to gain maximum performance even when taking into account new development tools. With respect to agent nav- igation, previous techniques tend to diverge away from the agent based semantics meaning that navigation becomes a separate process which in most cases remains static through- out the simulation. c The Eurographics Association 2010.

Transcript of Agent-based Large Scale Simulation of Pedestrians With Adaptive Realistic Navigation Vector Fields

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

Agent-based Large Scale Simulation of Pedestrians WithAdaptive Realistic Navigation Vector Fields

Twin Karmakharm , Paul Richmond and Daniela M. Romano1

1 University of Sheffield Department of Computer Science,211 Portobello, Sheffield, S1 4DP

AbstractA large scale pedestrian simulation method, implemented with an agent based modelling paradigm, is presentedwithin this paper. It allows rapid prototyping and real-time modifications, suitable for quick generation and testingof the viability of pedestrian movement in urban environments. The techniques described for pedestrian simulationmake use of parallel processing through graphics card hardware allowing simulation scales to far exceed thoseof serial frameworks for agent based modelling. The simulation has been evaluated through benchmarking of theperformances manipulating population size, navigation grid, and averaged simulation steps. The results demon-strate that this is a robust and scalable method for implementing pedestrian navigation behaviour. Furthermore analgorithm for generating smooth and realistic pedestrian navigation paths that works well in both small and largespaces is presented. An adaptive smoothing function has been utilised to optimise the path used by pedestrianagents to navigate around in a complex dynamic environment. Optimised and un-optimised vectors maps obtainedby applying or not such function are compared, and the results show that the optimized path generates a morerealistic flow.

Categories and Subject Descriptors (according to ACM CCS): I.2.11 [Distributed Artificial Intelligence]: Multiagentsystems

1. Introduction

Pedestrian simulations have found increasing use in variousfields from entertainment to disaster planning [Sof10,Sim10,TP02] where they can be used to predict and model the ef-fect of crowd movement under various environmental con-ditions. As the population densities of urban areas continu-ous to increase, it is likely that pedestrian simulations willplay a progressively more important role in ensuring safeand optimised crowd flows within urban spaces. Simulatinggroups of pedestrians is now almost exclusively performedby considering an individual approach, where agents interactdirectly to form emergent group behaviour, rather than usinga top down set of equations to attempt to model group dy-namics. This individual emphasis, defined as either an agentsimulation or particle force simulation lends itself well tothe natural description of behaviour through sets of definedrules. Likewise, heterogeneity can be introduced within thesimulation as each pedestrian is a unique entity, responsiblefor their own actions and personal traits. In addition to simu-lating the interaction between agents, pedestrian simulations

also require an additional technique to model the flow ofpedestrians through the environment. This can be achievedusing either a global navigation technique (common to allagents) or through individual path planning.

Whilst the individual approach to agent simulation hasmany advantages it poses a significant computation prob-lem when considering large scale simulations. Due to theneed to simulate ever increasingly large populations sizes ithas become apparent that traditional serial simulation frame-works are therefore unable to meet the real time requirementneeded for visual exploration with such models. Paralleli-sation offers a solution to this issue, however hardware ar-chitectures such as the Graphics Processing Unit (GPU) arefar from easy to develop with and require specialist knowl-edge to gain maximum performance even when taking intoaccount new development tools. With respect to agent nav-igation, previous techniques tend to diverge away from theagent based semantics meaning that navigation becomes aseparate process which in most cases remains static through-out the simulation.

c© The Eurographics Association 2010.

T. Karmakharm, P. Richmond & D. Romano / Agent-based pedestrians with adaptive vector fields.

This paper takes an agent based approach to modellingpedestrian systems and navigational behaviour where boththe interaction between agents and the agent’s navigationthrough the environment is facilitated through a single agentframework. The advantage of this technique is that we areable to integrate our model within an agent based frame-work designed for efficient GPU simulation allowing us tosimulate large population sizes in real time. In addition thesimulations can be rendered efficiently as simulation data isalready contained within the GPU device. Within this pa-per the navigation is based upon a set of agents arrangedwithin a discrete grid. The use of these agents to indicatea vector field is described as is a novel process for avoid-ing a common issue we identify as "diagonal convergence"which is the result of generating vector fields using shortestpath flows throughout the environment. An evaluation is alsopresented which is defined according to a real world environ-ment and used by the simulation to test the performance andbehaviour of our system.

2. Related Work

The use of agent based modelling has been widely adoptedwithin the field of pedestrian simulation. An early exampleof this concept was demonstrated by Reynolds on the sim-ulation of flocking behaviour of animals [Rey87]. Operat-ing on only three simple rules and awareness of their envi-ronment, the agents displayed emergent complex and plau-sible group behaviour. A model for pedestrian behaviourswas later conceived by Helbing et al [Hel91] which takesinto consideration psychological factors such as social dis-tances from other pedestrians as well as environmental ob-stacles. Within this particle force model, widely observedorganisational behaviours of pedestrians such as lane forma-tion emerge from the individual pedestrian behaviours Theoriginal model was later extended to include contact forceswhich simulate aspects of emergency situations [HFV00].This well studied and validated model is now standard inmost evacuation models and continues to form the basis forextended research into pedestrian behaviour e.g. Moussaïdet al takes in to account of the shapes small groups form inorder to maximise their social communication [MPG∗10].

Pedestrian agent modelling technique originally used Cel-lular Automata [BKSZ01], a discrete model where eachpedestrian occupies a single cell within a grid. The or-der of their movements must be sequential which makes itharder to parallelize, they are also not suitable for smoothpedestrian flows in continuous environments. The contin-uum crowd technique, initially proposed by Huges [Hug02],defines crowds as a density field where pedestrians travelto their goals by following the gradient vectors calculated bythe potential functions. This model was improved by Treuilleet al. [TCP06] to incorporate empirically measured emergentpedestrian behaviours such as lane formation. Since the den-sity field takes into account of both global goals and local

obstacles including other pedestrian agents, global and localnavigation is integrated and resolved at the same time. Themost intensive calculation with this process is in resolvingthe density field with every time-step of the simulation andhence the method may not scale well for much larger envi-ronments. The solution for the scalability was addressed byShopf et al. in the March of the Froblins demo [SBOT08]where continuum methods were instead used as a coarsedensity grid to drive global navigation and using agent basedcollision detection behaviour for local obstacles.

With respect to navigation local perceptive interactiondoes not provide enough information to provide long rangeplanning through the virtual environment. As a result eithera global or individual based navigation technique is requiredto provide long range guidance. Most global navigationaltechniques reduces the environment down to a set of discretegrid cells [TLCC] [ST05]. Information about obstacles occu-pying the cell, terrain height, and other arbitrary informationcan be encoded within each cell where pedestrian agents canthen use to navigate within the virtual environment. Mostcommonly the discrete cells can be used to hold a direc-tional force which when combined with neighbouring cellsrepresents a vector field (also known as force fields or flowfields). This technique is very effective when combined withgood local collision avoidance and computationally very ef-ficient as each agent avoids having to perform a path plan-ning exercise. The authoring of the vector fields can either bedone manually using a software that allows a user to ’paint’the field directions, alternatively they can be automaticallygenerated using algorithms such as wavefront propagationwhere the origins of the waves represent the destination(s) ofthe pedestrians [LaV06]. Multiple fields can be used for eachgroup(s) of pedestrians to represent differing goals and intro-duce complex flows. The drawback with this method is thefact that the method often uses more memory, growing ex-ponentially with the size of the grid and can then also placelimits on the number of goals or fields that can be used. Theflow tiles concept introduced by Chenney [Che04] makes theprocess more scalable by re-using tiles of pre-defined vectorfields to save on repetitious regions of flow that are likely tooccur within the environment. Work by Jin et al. [JXW∗08]presents the uses of continuous vector fields constructed us-ing radial basis functions. Anchor points are used in orderto define directional flows of pedestrian agents and can beplaced dynamically on the scene making crowd control in-teractive. Since the field is continuous, performance is de-pendent on the number of anchor points rather than the sizeof the environment and has been shown to degrade well withincreasing pedestrian sizes. The author does not however,discuss how it well it would apply to more complex environ-ments and goal based situations.

The alternative to global navigation is the use of individ-ual path planning. Whilst simple ray query technique can beused to find paths around obstacles it would be too compu-tationally expensive to apply it to global navigation in real-

c© The Eurographics Association 2010.

T. Karmakharm, P. Richmond & D. Romano / Agent-based pedestrians with adaptive vector fields.

time. To avoid this problem, the inter-connecting areas canbe reduced to a set of graphs where each node represents anarea and edges represent walkable paths [Sha05]. The prob-lem then changes to a graph traversal problem which can besolved by common path-finding algorithms such as A* orDijkstra’s. Pettre et al. [PLT05] shows alternative approachto the graph based navigation where medial axis samplingwas performed on the environment enabling it to be concep-tualized as a series of interconnected circles. In this case theradius of each circle is its maximum clearance from staticobstacles and the radical lines from intersecting circles areused to represent corridors of safe walkable paths. Whilegraph based methods allows highly individualised goal des-tinations, they require more time during the simulation tocalculate routes dynamically.

3. Our Pedestrian Simulation System

3.1. The Agent Modelling Framework

In order to implement our pedestrian simulation as an agentmodel on the GPU we have decided to use the FlexibleLarge-scale Agent Modelling Environment framework forthe GPU (FLAME GPU) [RCR09]. As well as the Com-pute Unified Device Architecture (CUDA) [Nvi09] enabledGPU version of the framework used within this paper thereare a number of simulation backends for hardware architec-ture including a single core CPU and a number of commonHigh Performance Computing (HPC) grid architectures. Theframework is incredibly robust and has been used in a widerange of agent modelling areas that range from the biologicalscience [RWCR10] through to modelling of the Europeaneconomy [DVD08]. This framework itself uses a formalmodel of agents, which is based upon a parallel communi-cating state machine with internal memory more commonlyknown as a communicating stream X-Machine [CSH06].Models are described using both a simple XML model def-inition and a corresponding set of scripted agent functionswhich defines agent behaviour. An XML model file brieflycomprises of the following information:

1. A set of environment, or constant variables, which maybe set between simulation steps - These are useful in con-trolling aspects of the model within a real time simula-tion.

2. A set of X-Machine agents - As with the formal defini-tion of an X-Machine [Eil74] each agent definition con-sists of a description of the agents internal memory (theagent variables), a set of internal states (which may adda degree of diversity to an agent population) and a set offunction definitions (which define the transition betweenany two states including any agent or message input oroutput). Each agent may be either discrete (in which caseit is non mobile and part of a cellular automaton) or con-tinuous in which case it may be spatially distributed orrepresent a more abstract non spatial entity.

3. A set of messages - Each message definition has a set of

Pedestrian AgentFunctions

Navigation AgentFunctions

Message Pool

generate-pedestrians

output-pedestrian-message

output-force-cell-message

apply-avoidance-and-steering-force

apply-collision-and-navigation-

force

move-pedestrians

Tim

e

pedestrianlocation

messages

force cell messages

Figure 1: Sequence diagram for function call of both agentsand their utilization of the message pool.

communicated information (or variables) which may beinput or output from within the agent function scripts al-lowing indirect communication between agents. A mes-sage definition also defines any restriction on messagerange or the type of agent which may use it (discrete orcontinuous). This ensures the back end simulation usesthe most efficient communication algorithm for messageiteration within the agent functions.

4. A set of function layers - This describes the sequentialstepwise order of execution of the agent functions withina single simulation step. A single layer may execute morethan one agent function in parallel if they share no de-pendencies i.e. do not share any common message inputor output. In the case of the GPU these are executed se-quentially regardless due to the Single Program MultipleData(SPMD) architecture.

Model descriptions are processed within FLAME GPUthrough a template engine which translates the model fileinto CUDA source code. This process abstracts the writingof GPU code from the modeller allowing fast prototypingof models without explicit knowledge of the GPUs data par-allel architecture. Common agent based functionality suchas birth and death allocation, communication and efficientdata storage are automatically generated by the template en-gine and which combined with the agent function scriptscan be compiled to produce GPU enabled agent simulations.The processes can be easily extended and in the case of ourpedestrian simulation a visualisation template is used as astarting point to allow more advanced pedestrian simulationwhich includes a parallel LOD rendering technique [RR08],inclusion of detailed urban models and an interactive userinterface for controlling environment variables.

In accordance with the FLAME GPU model specificationtechnique our pedestrian simulation is expressed using twodistinct type of agents, the pedestrian agents and the navi-

c© The Eurographics Association 2010.

T. Karmakharm, P. Richmond & D. Romano / Agent-based pedestrians with adaptive vector fields.

gation agents. Figure 1 illustrates the sequence of functionsthat each agent performs and how the information flow inand out of these functions are managed.

3.2. Navigational Agents

In our work, we have opted to use a variation of the vectorfield based method, force vector fields (FVFs) in order to as-sist the pedestrian agents in their global navigation. Collisionand Navigation FVFs are the two distinct types that are em-ployed in our simulation (abbreviated to CFVF and NFVFrespectively). CFVFs encode repulsion forces radiating fromstatic obstacles within the environment. The strength of theforce at any location is exponentially inversed in propor-tion to the distance from said obstacles over a given config-urable range. Only one CFVF is required for the simulationas repulsion force from obstacles is continuous and staticthroughout the simulation. NFVFs are then used to guideagents to their intended goals. In our case all of the goalsare associated with an entrance/exit to the environment andthe number of NFVFs corresponds to the number of exits.Each cell within a field is encoded with a force that pointsto the shortest non-obstructed direction to the goal. Detailsfor CFVF and NFVF are further discussed in 3.2.1 and 3.2.2respectively.

To represent these fields, our Navigation agents are madeto be Cellular Automaton (CA), i.e. non-mobile, discrete andare arranged as a topologically correct grid. Each naviga-tion agent can then be thought of representing a cell within agrid and so holds information for all CFVF and NFVFs forthat particular location. In our current simulation, the Nav-igation agents have two functions, generate-pedestrians andoutput-force-cell-messages (Figure 1). When the generate-pedestrian function is called, if the navigation agent isdeemed to be an exit it will randomly generate pedestrianagents at that location at a configurable (people per minute)rate. Newly generated pedestrian agents are then assigned arandom exit goal according to a probabilistic function. Sinceall FVFs are currently generated before the start of the simu-lation, at run-time navigation-agents need only to broadcastinformation of their respective FVF cell. This is handled bythe output-force-cell-message function.

An example of a single broadcast message can be foundin Listing 1 which was taken from the initial configurationfile created before the simulation starts. The variable heightis used to encode a discrete height map of the simulated en-vironment and is used within the visualisation to displacepedestrian agents across differing physical levels in the sim-ulated space. The variables collision_x and collision_y en-codes a CFVF cell. In this case a force in the positive xdirection indicates an obstacle to the left of the navigationagent. The variables exit0_x through to exit1_y describe 2normalised navigation force vectors which describe forcedirection leading agents towards one of 2 exits. Finally thevariable exit is used to determine if the force cell indicates

Navigation Agents

Col

lisio

n Fo

rce

Vect

or F

ield

Nav

igat

ion

Forc

e Ve

ctor

Fie

ld 1

Nav

igat

ion

Forc

e Ve

ctor

Fie

ld 2

Navigation Agents Grid

x

y

Destination/Exit

Static Obstacle

Collision Force Vector

Navigation Force Vector

Figure 2: An example of a simplistic 6x6 environment with2 exits and obstacles. Navigation agents are arranged in agrid as shown (top right) and position of the agent relates toa particular cell of the force vector fields.

the presence of an actual exit position within the simulation.Exit positions play two important roles within the simula-tion. The first is the previously described generation of newpedestrian agents. The second is ensuring pedestrian agentscan identify (through message communication of the cell in-formation) that they have successfully reached their destina-tion point.

Listing 1: XML Specification of navigation agents

< x a g e n t ><name> f o r c e _ c e l l < / name><x>1< / x><y>2< / y>< h e i g h t > 0 . 1 < / h e i g h t >< c o l l i s i o n _ x > 1 . 0 < / c o l l i s i o n _ x >< c o l l i s i o n _ y > 0 . 0 < / c o l l i s i o n _ y >< e x i t 0 _ x > 0 . 8 < / e x i t 0 _ x >< e x i t 0 _ y > 0 . 6 < / e x i t 0 _ y >< e x i t 1 _ x > 0 . 8 < / e x i t 1 _ x >< e x i t 1 _ y >−0.6< / e x i t 1 _ y >< e x i t >0< / e x i t >< / x a g e n t >

c© The Eurographics Association 2010.

T. Karmakharm, P. Richmond & D. Romano / Agent-based pedestrians with adaptive vector fields.

S

Search origin

Obstacle

Visible fromorigin

Not visible from origin

Figure 3: Visibility rules for the wave propagation. Startingfrom origin (yellow), the green areas will be included whilethe red area is not due to it being blocked off by obstacles.

3.2.1. Collision Force Vector Fields

After the environment has be discretized, each cell is eitherdetermined to be a walkable area or an obstacle. A wave-front propagation algorithm ( [LaV06] p.378) is then usedwith the origin of the propagation being the list of cells thathas been marked as an obstacle. The algorithm proceeds tocollect all adjacent cells that are not already in the list. Hav-ing now obtained a list of valid and not already visited ad-jacent cells, for each of these cells the final collision vectoris the normalized sum of the vectors pointing away from itsneighbouring cells that was visited last iteration (so for thefirst iteration, it would be the vectors pointing away from ob-stacle cells). The normalized vector is then multiplied by thescalar force that depends on the distance (number of itera-tions). Force used in this simulation decreases exponentiallywith distance. The adjacent cells list is used as the origin forthe next iteration and also added to a list of all visited cells.The process repeats until there are no more cells to visit orby reaching a fixed maximum number of iterations (the forceinfluence distance). An example of a calculated CFVF mapcan be found in Figure 2 (top left) where force influence dis-tance is set to be 1.

3.2.2. Navigation Force Vector Fields

The NFVF map for each destination is generated in a sim-ilar way to the CFVF with the difference that the originsof propagation are pre-defined exit points rather than obsta-cles and the vector points towards the cells of previous iter-ations. Propagation also follow a visibility rule (Figure 3) sothat it does not go through walls or obstacles. Although thismethod will guarantee to find the shortest path to the desti-nation from anywhere in the environment, a straightforwardimplementation of the algorithm results in a common issuewhich we describe as a "diagonal convergence" of vectors(Figure 4, top right). This is a result of the diagonal lineswhich propagate from corners representing the shortest pathwith surrounding flow point attempting to converge towardsthem. This becomes even more apparent as the grid reso-lution is increased around larger areas of open space and re-sults in squashed and unnatural pedestrian flows when withina simulation (Figure 5, left).

Figure 4: Comparison of the generated force vector fields.Top left shows the CFVF with force influence distance of 2.The rest shows NFVFs with simple propagation (top right),with backflow propagation but no limit (bottom left) and theresult of the full algorithm (bottom right).

In order to tackle the problem of "diagonal convergence",it is necessary to smooth out the vector flows. We havefound that a process of backflow smoothing creates a naturallooking navigation flow for pedestrian agents, successfullyavoiding convergence issues. Although simple neighbour-hood averaging of vectors can be used, the progressive na-ture of the backflow smoothing results in an even smootherfield especially in large open areas. It works by propagat-ing a flow in the reverse direction for each cell of the cur-rent iteration and the navigation vector is generated by sum-ming up the vectors pointing from the current cell to thecells in the reverse flow. This reverse propagation also fol-lows the same visibility rules of the main wave propagationand flows around obstacles. Influence of reverse flow vectorsis decreased in proportion to the increase in distance of thebackflow. The final navigation vector is then normalised af-ter the backflow reaches its maximum iteration distance. Asthe resolution of the grid increases it then becomes neces-sary to increase the number of iterations to generate smoothflow especially if there are large open areas in the scene. Us-ing more iterations however, can cause problems in the rest

c© The Eurographics Association 2010.

T. Karmakharm, P. Richmond & D. Romano / Agent-based pedestrians with adaptive vector fields.

Figure 5: Comparison of the simulation using un-optimized(left) and with backflow smoothed (right) navigation vectorfields.

of the scene especially around tight corners where vectorsrun into obstacles (Figure 4, bottom left). A contextual limitis placed on the backflow where the iterations stop when anobstacle is encountered. The final algorithm generates a vec-tor field that is both smooth in open areas but is also cor-rect around corners and narrow corridors (Figure 4, bottomright). The effect of this algorithm can be seen in Figure 5(right) where pedestrians (in blue) can spread out to take upmore space and making the simulation look more natural.

3.3. Pedestrian Agents

Pedestrian agents are continuous spaced mobile agents, eachone representing a single embodied pedestrian entity withinthe simulation. Within a single simulation step they firstcommunicate their locality and velocity (through a messageoutput, shown in Figure 1). Pedestrian agents then performan iteration of the pedestrian locations messages as wellas the navigation cell message information which can beused with any number of agent based steering techniques[Rey99, Hel91]. Within our simulation we combine a mix-ture of Reynolds individually perceptive steering forces andHelbing’s social forces model to determine forced basedsteering behaviour between pedestrians. As in [HFV00],large contact forces are applied between pedestrians whenthey are touching each other and helps to more accuratelysimulate areas of higher congestion. A weighted collisionand navigation force is also determined from the pedestrian’sposition in the FVF and is then applied to the steering ve-locity. The agent finally updates its position by using a nu-merical integration to move in the direction of the resolvedforce vector. This integration step is typically very small (inhundredths of a second) and is adapted depending on per-formance to provide real time pedestrian movement speeds.The exact agent functions are described in Figure 1.

3.4. Environment Editor

The FVF maps (both collision and navigation) are currentlypre-generated through a tool created in order to facilitaterapid generation of different environments. The tool allowsthe user to sketch or trace over a plan of an area and mark-ing it as an obstacle or exit. The program automaticallygenerates a CFVF and individual NFVFs for each destina-tion according to user-specified parameters. The parame-ters are force influence distance, minimum force and max-imum force for CFVF generation and maximum backflowiterations for NFVFs generation (refer to Section 3.2.1 and3.2.2). Finally an XML file is generated in the format com-patible with the navigation agent definition for the FLAMEGPU simulation framework.

4. Simulation & Results

4.1. Simulation Performance Benchmarking

The benchmarking was done on a 64-bit Windows 7 machineusing AMD Athlon 4800+, NVIDIA GeForce 9800GX2with one core used for visualization and one used for CUDA.The simulation’s performance was measured against foursquare grid sizes of 64, 128, 256 and 512 widths. The varia-tion of pedestrian population began from 1024 and increasedby multiples of 4 up to 262144 pedestrians. The pedestrianswere randomly generated and placed in a walkable spacewithin the environment. Pedestrian density is always keptthe same as the environment scales up with increasing pedes-trian population. The graph in Figure 6 (top) shows the resultof this testing. The result shows that the navigation grid sizebecomes less important as the number of pedestrian agentincreases. This is due to the fact that pedestrian behaviouris the most time consuming part of the simulation. It provesthat the use of navigation maps is very scalable and largergrid sizes can be used to represent higher environment detailor a larger area. Currently navigation maps beyond the sizeof 512x512 cannot be run on larger pedestrian counts (morethan 262144 pedestrians) due to the lack of GPU memory asthe list of pedestrian agents are double or triple buffered inorder to allow reallocation for agent births and deaths. An-other factor that contributed to the lack of memory is the factthat as pedestrian population gets larger, in order to keep thesame density the number of space partitions (defined by thecommunication radius of agents [RCR09,LG08]) gets largerand hence requiring a lot more memory.

4.2. Simulation Based on a Real Urban Environment

The test environment was modelled after a busy pedestri-anised area in London. It contains 7 destinations/exits withone being an access to the underground station (Figure 7).Pedestrians are generated at each exit location according toa specified emission rate (measured as people generated perminute) and each have a specific exit location to navigate tobased on a pre-determined probability. All exits can be in the

c© The Eurographics Association 2010.

T. Karmakharm, P. Richmond & D. Romano / Agent-based pedestrians with adaptive vector fields.

0

10

20

30

40

50

60

0 1000 2000 3000 4000 5000 6000 7000 8000

Tota

l Sim

ulati

on T

ime

(mill

isec

onds

)

Simulation Steps

generate_pedestrians()

output_navmap_messages() & output_pedestrian_messages()

apply_avoidance_and_steering_forces()

apply_collision_and_navigation_forces()

move_pedestrians()

0

50

100

150

200

250

1024 4096 16384 65536 262144

Sim

ulati

on S

teps

per

Sec

ond

(Ave

rage

d ov

er 1

00 st

eps)

Pedestrian Population Size

Grid Size: 64x64Grid Size: 128x128Grid Size: 256x256Grid Size: 512x512

Figure 6: Simulation benchmarks. Performance benchmark-ing for environments of different sizes (top). Time utilizationby different agent functions with increasing pedestrian agentdensity (bottom).

state of either open or closed. When a pedestrian reaches aclosed exit, it will randomly choose a different exit and startnavigating to the alternate destination. All FVFs are pre-generated according to Section 3.2 with the whole environ-ment being represented as a 128x128 grid although walkablespace occupies less than 70% of the total area. The purposeof the simulation is to show the effects of areas that havebeen flooded with pedestrian possibly as a result of an evac-uation or a large public event. Result of the simulation is alsoexpected to highlight dangerous conditions which can resultfrom closing exits. Testing of the model will then follow thefollowing sequence.

Firstly the simulation starts unpopulated and pedestriansare continually generated until they reach a steady state. Themodel will then be flooded with pedestrians while an exit isclosed. Inability of pedestrians to leave the environment ina timely fashion results in heavy congestion and potentiallydangerous conditions. Figure 6 (bottom) shows a breakdownof simulation time (in ms) during a real time simulation of

UndergroundStation

Figure 7: Screenshots of the final pedestrian simulation. Onthe street level (top left). Running with 10,000 pedestrians(top right), red lines signify locations of exit.

the London model. More specifically it shows the timings(stacked) for individual or combination of agent functioncalls (Figure 1). Timings have been obtained by averagingthe simulation time of each function call over the period of200 simulation steps to avoid any small fluctuations.

Over the simulation of roughly 9000 simulation steps thegraph shows three distinct phases. The first occurs betweenstep 0 and 800 and shows relative stability in simulationtimes. During this phase the emission rate for each exit inthe model is constant and the total number of pedestriansremains at roughly 3000.The sharp rise in simulation perfor-mance after this phase is a result of increasing the emissionrate of all the exits. The second phase of relative stability oc-curs between steps 1400 and 4400. During this phase of thesimulation the large increase in emission rates has reached astable population of roughly 11,000 pedestrian agents. Thefinal phase of the simulation shows the effect of closing oneof the 7 major exits. Any agent which reaches a closed exitis forced unable to leave the simulation at the exit point andmust navigate to a new exit position. The effect of this isthat first the population increases relatively slowly as a re-sult of pedestrians failing to leave through their preferentialexit (steps 4400 to 5600). After this the area around the exitbecomes very congested and the number of pedestrians con-tinues to rises very sharply to over 2000 agents. The effect ofclosing the exit congests the model to the extent that a stablenumber of pedestrians cannot be reached. It can be clearlyseen that under these conditions dangerous crush conditionsoccur around the exit.

5. Conclusion

The paper described the details of an implementation of ahigh performance, large scale pedestrian simulation. Pedes-trians within the simulation were shown to have the abilityto navigate within complex environments, through force vec-tor field maps which are automatically generated using a fastenvironment prototyping tool. Evaluation of our work showsthat our implementation of the force vector field generationalgorithm produces configurable smooth flows of pedestri-

c© The Eurographics Association 2010.

T. Karmakharm, P. Richmond & D. Romano / Agent-based pedestrians with adaptive vector fields.

ans. The use of discrete agents to host navigation informa-tion has been tested to be an efficient and scales effectivelywith large numbers of pedestrians. The use of real time in-teraction and control of the simulation model within a realurban environment was used to simulate the effect of flood-ing the model with pedestrians which resulted in dangerouscongestion.

As we have abstracted both the agent and navigation plan-ning behaviour to an agent based problem we are also freeto interchange the navigation technique without having tochange the rules of our final forced based behaviour. We arealready experimenting with an agent based implementationof dynamic navigation graphs which avoid the memory over-head of using fine discrete partitions.

References[BKSZ01] BURSTEDDE C., KLAUCK K., SCHADSCHNEIDER

A., ZITTARTZ J.: Simulation of pedestrian dynamics using atwo-dimensional cellular automaton. Physica A 295, 3-4 (June2001), 507–525. 2

[Che04] CHENNEY S.: Flow tiles. In SCA ’04: Proceedings ofthe 2004 ACM SIGGRAPH/Eurographics symposium on Com-puter animation (Aire-la-Ville, Switzerland, Switzerland, 2004),Eurographics Association, pp. 233–242. 2

[CSH06] COAKLEY S., SMALLWOOD R., HOLCOMBE M.: Us-ing x-machines as a formal basis for describing agents in agent-based modelling. In Proceedings of 2006 Spring Simulation Mul-ticonference (April 2006), pp. 33–40. 3

[DVD08] DEISSENBERG C., VANDERHOOG S., DAWID H.: Eu-race: A massively parallel agent-based model of the europeaneconomy. Applied Mathematics and Computation 204, 2 (Oc-tober 2008), 541–552. 3

[Eil74] EILENBERG S.: Automata, Languages, and Machines.Academic Press, Inc., Orlando, FL, USA, 1974. 3

[Hel91] HELBING D.: A mathematical model for the behavior ofpedestrians. Behavioral Science 36, 4 (October 1991), 298–310.2, 6

[HFV00] HELBING D., FARKAS I., VICSEK T.: Simulating dy-namical features of escape panic. Nature 407, 6803 (September2000), 487–490. 2, 6

[Hug02] HUGHES R.: A continuum theory for the flow of pedes-trians. Transportation Research Part B: Methodological 36, 6(July 2002), 507–535. 2

[JXW∗08] JIN X., XU J., WANG C. C. L., HUANG S., ZHANG

J.: Interactive control of large-crowd navigation in virtual en-vironments using vector fields. IEEE Computer Graphics andApplications 28, 6 (November 2008), 37–46. 2

[LaV06] LAVALLE S. M.: Planning Algorithms. Cambridge Uni-versity Press, May 2006. 2, 5

[LG08] LE GRAND S.: Broad-phase collision detection withcuda. GPU Gems 3 (2008), 697–721. 6

[MPG∗10] MOUSSAÏD M., PEROZO N., GARNIER S., HELBING

D., THERAULAZ G.: The walking behaviour of pedestrian socialgroups and its impact on crowd dynamics. PLoS ONE 5, 4 (April2010), e10047+. 2

[Nvi09] NVIDIA: Nvidia cuda programming guide (v 2.3), 2009.3

[PLT05] PETTRE J., LAUMOND J., THALMANN D.: A naviga-tion graph for real-time crowd animation on multilayered and un-even terrain. 3

[RCR09] RICHMOND P., COAKLEY S., ROMANO D.: A highperformance agent based modelling framework on graphics cardhardware with cuda. Proceedings of The Eighth InternationalConference on Autonomous Agents and Multiagent Systems(2009). 3, 6

[Rey87] REYNOLDS C. W.: Flocks, herds and schools: A dis-tributed behavioral model. In SIGGRAPH ’87: Proceedings ofthe 14th annual conference on Computer graphics and interac-tive techniques (New York, NY, USA, July 1987), vol. 21, ACM,pp. 25–34. 2

[Rey99] REYNOLDS C.: Steering behaviors for autonomous char-acters. In Game Developers Conference 1999 (1999). 6

[RR08] RICHMOND P., ROMANO D.: A high performance frame-work for agent based pedestrian dynamics on gpu hardware. Eu-ropean Simulation and Modelling (2008). 3

[RWCR10] RICHMOND P., WALKER D., COAKLEY S., RO-MANO D.: High performance cellular level agent-based simu-lation with flame for the gpu. Briefings in Bioinformatics (2010).3

[SBOT08] SHOPF J., BARCZAK J., OAT C., TATARCHUK N.:March of the froblins: simulation and rendering massive crowdsof intelligent and detailed creatures on gpu. In SIGGRAPH ’08:ACM SIGGRAPH 2008 classes (New York, NY, USA, 2008),ACM, pp. 52–101. 2

[Sha05] SHAO W.: Environmental modeling for autonomous vir-tual pedestrians, 2005. 3

[Sim10] SIMWAL K.: http://fseg.gre.ac.uk/exodus/ [last accessedjan 2010]. 1

[Sof10] SOFTWARE M.: http://www.massivesoftware.com/ [lastaccessed jan 2010]. 1

[ST05] SHAO W., TERZOPOULOS D.: Autonomous pedestrians.In SCA ’05: Proceedings of the 2005 ACM SIGGRAPH/Euro-graphics symposium on Computer animation (New York, NY,USA, 2005), ACM Press, pp. 19–28. 2

[TCP06] TREUILLE A., COOPER S., POPOVIC Z.: Continuumcrowds. In SIGGRAPH ’06: ACM SIGGRAPH 2006 Papers(New York, NY, USA, 2006), ACM, pp. 1160–1168. 2

[TLCC] TECCHIA F., LOSCOS C., CONRY R., CHRYSANTHOU

Y.: Agent behaviour simulator (abs): A platform for urban be-haviour development. 2

[TP02] TURNER A., PENN A.: Encoding natural movement asan agent-based system: an investigation into human pedestrianbehaviour in the built environment. Environment and PlanningB: Planning and Design, 29 (2002), 473–490. 1

c© The Eurographics Association 2010.