hybrid long-range collision avoidance for crowd simulation

13
Hybrid Long-Range Collision Avoidance for Crowd Simulation Abhinav Golas, Rahul Narain, Sean Curtis, and Ming C. Lin, Fellow, IEEE Abstract—Local collision avoidance algorithms in crowd simulation often ignore agents beyond a neighborhood of a certain size. This cutoff can result in sharp changes in trajectory when large groups of agents enter or exit these neighborhoods. In this work, we exploit the insight that exact collision avoidance is not necessary between agents at such large distances, and propose a novel algorithm for extending existing collision avoidance algorithms to perform approximate, long-range collision avoidance. Our formulation performs long-range collision avoidance for distant agent groups to efficiently compute trajectories that are smoother than those obtained with state-of-the-art techniques and at faster rates. Comparison to real-world data demonstrates that crowds simulated with our algorithm exhibit an improved speed sensitivity to density similar to human crowds. Another issue often sidestepped in existing work is that discrete and continuum collision avoidance algorithms have different regions of applicability. For example, low-density crowds cannot be modeled as a continuum, while high-density crowds can be expensive to model using discrete methods. We formulate a hybrid technique for crowd simulation which can accurately and efficiently simulate crowds at any density with seamless transitions between continuum and discrete representations. Our approach blends results from continuum and discrete algorithms, based on local density and velocity variance. In addition to being robust across a variety of group scenarios, it is also highly efficient, running at interactive rates for thousands of agents on portable systems. Index Terms—Crowd simulation, collision avoidance, lookahead, hybrid algorithms Ç 1 INTRODUCTION L ONG-RANGE vision is critical to human navigation; in addition to avoiding nearby obstacles, the human visual system looks ahead to perform dynamic global planning and local navigation. By considering the distribution of other pedestrians and obstacles over large distances, people can anticipate overcrowded regions and navigate around them, thereby finding efficient, uncongested paths to their goals. Thus long-range vision greatly improves crowd flow and progress. Most existing work addresses either global navigation around static obstacles or local avoidance of col- lisions with nearby pedestrians, but often neglects the importance of long-range collision avoidance. Modeling long-range collision avoidance holds tremendous potential, to improve the flow of simulated crowds and help them reach their goals faster. To maximize utility, such a model should improve crowd flow without disrupting existing crowd simulation pipelines. Thus we consider this as the primary goal of this work. The state of the art for this topic is a synthetic-vision based steering algorithm proposed by Ondr ej et al. [1]. This method explores a vision-based approach for colli- sion avoidance among walkers. It offers global efficiency among the agents in terms of overall walking time. Achieving reasonable performance is perhaps the key challenge of using this approach for large-scale, interac- tive applications. Even a parallel, GPU-based implemen- tation cannot handle more than 200 agents at interactive rates. Complementing this approach, our work addresses this problem by offering a simple and efficient alternative that naturally extends existing local collision avoidance (LCA) algorithms to provide long-range collision avoid- ance. Our avoidance algorithm works based on the concept of lookahead, i.e., future agent states are approxi- mated using past and present information; and these states are used to model possible collisions with agents not considered by local collision avoidance. Our method is robust even in presence of obstacles and chaotic crowd motion, and provides improved correspondence to real- world behavior. Collision avoidance algorithms can be broadly classified into two categories: discrete and continuum—based on the underlying representation of crowds. We formulate and demonstrate our lookahead approach for both classes of algorithms, as the problem is not restricted to either class. Though our demonstration in this paper uses specific exam- ples of continuum and discrete algorithms, our technique can be easily applied and generalized to other collision avoidance algorithms. The use of continuum and discrete algorithms for colli- sion avoidance also brings up a common issue with either class, namely their applicability to different ranges of agent density. Continuum algorithms (e.g., [2]) are ideally suited for medium to high densities, since the continuum assump- tion holds when pedestrian paths are tightly constrained by the nearby neighbors found at these levels of density. On the other hand, though discrete algorithms can be applied at any density, their computational costs escalate at high densities, along with numerical issues in some cases. Since A. Golas, S. Curtis, and M.C. Lin are with the University of North Carolina at Chapel Hill. E-mail: {golas, seanc, lin}@cs.unc.edu. R. Narain is with the University of California, Berkeley. E-mail: [email protected]. Manuscript received 8 Apr. 2013; revised 18 Aug. 2013; accepted 14 Sept. 2013. Date of publication 26 Sept. 2013; date of current version 29 May 2014. Recommended for acceptance by S.-E. Yoon and G. Meenakshisundaram. For information on obtaining reprints of this article, please send e-mail to: [email protected], and reference the Digital Object Identifier below. Digital Object Identifier no. 10.1109/TVCG.2013.235 1022 IEEE TRANSACTIONS ON VISUALIZATION AND COMPUTER GRAPHICS, VOL. 20, NO. 7, JULY 2014 1077-2626 ß 2013 IEEE. Personal use is permitted, but republication/redistribution requires IEEE permission. See http://www.ieee.org/publications_standards/publications/rights/index.html for more information.

Upload: ming-c

Post on 27-Mar-2017

216 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: Hybrid Long-Range Collision Avoidance for Crowd Simulation

Hybrid Long-Range Collision Avoidancefor Crowd Simulation

Abhinav Golas, Rahul Narain, Sean Curtis, and Ming C. Lin, Fellow, IEEE

Abstract—Local collision avoidance algorithms in crowd simulation often ignore agents beyond a neighborhood of a certain size. This

cutoff can result in sharp changes in trajectory when large groups of agents enter or exit these neighborhoods. In this work, we exploit

the insight that exact collision avoidance is not necessary between agents at such large distances, and propose a novel algorithm for

extending existing collision avoidance algorithms to perform approximate, long-range collision avoidance. Our formulation performs

long-range collision avoidance for distant agent groups to efficiently compute trajectories that are smoother than those obtained with

state-of-the-art techniques and at faster rates. Comparison to real-world data demonstrates that crowds simulated with our algorithm

exhibit an improved speed sensitivity to density similar to human crowds. Another issue often sidestepped in existing work is that

discrete and continuum collision avoidance algorithms have different regions of applicability. For example, low-density crowds cannot

be modeled as a continuum, while high-density crowds can be expensive to model using discrete methods. We formulate a hybrid

technique for crowd simulation which can accurately and efficiently simulate crowds at any density with seamless transitions between

continuum and discrete representations. Our approach blends results from continuum and discrete algorithms, based on local density

and velocity variance. In addition to being robust across a variety of group scenarios, it is also highly efficient, running at interactive

rates for thousands of agents on portable systems.

Index Terms—Crowd simulation, collision avoidance, lookahead, hybrid algorithms

Ç

1 INTRODUCTION

LONG-RANGE vision is critical to human navigation; inaddition to avoiding nearby obstacles, the human visual

system looks ahead to perform dynamic global planningand local navigation. By considering the distribution ofother pedestrians and obstacles over large distances, peoplecan anticipate overcrowded regions and navigate aroundthem, thereby finding efficient, uncongested paths to theirgoals. Thus long-range vision greatly improves crowd flowand progress. Most existing work addresses either globalnavigation around static obstacles or local avoidance of col-lisions with nearby pedestrians, but often neglects theimportance of long-range collision avoidance. Modelinglong-range collision avoidance holds tremendous potential,to improve the flow of simulated crowds and help themreach their goals faster. To maximize utility, such a modelshould improve crowd flow without disrupting existingcrowd simulation pipelines. Thus we consider this as theprimary goal of this work.

The state of the art for this topic is a synthetic-visionbased steering algorithm proposed by Ondr�ej et al. [1].This method explores a vision-based approach for colli-sion avoidance among walkers. It offers global efficiencyamong the agents in terms of overall walking time.Achieving reasonable performance is perhaps the key

challenge of using this approach for large-scale, interac-tive applications. Even a parallel, GPU-based implemen-tation cannot handle more than 200 agents at interactiverates. Complementing this approach, our work addressesthis problem by offering a simple and efficient alternativethat naturally extends existing local collision avoidance(LCA) algorithms to provide long-range collision avoid-ance. Our avoidance algorithm works based on theconcept of lookahead, i.e., future agent states are approxi-mated using past and present information; and thesestates are used to model possible collisions with agentsnot considered by local collision avoidance. Our methodis robust even in presence of obstacles and chaotic crowdmotion, and provides improved correspondence to real-world behavior.

Collision avoidance algorithms can be broadly classifiedinto two categories: discrete and continuum—based on theunderlying representation of crowds. We formulate anddemonstrate our lookahead approach for both classes ofalgorithms, as the problem is not restricted to either class.Though our demonstration in this paper uses specific exam-ples of continuum and discrete algorithms, our techniquecan be easily applied and generalized to other collisionavoidance algorithms.

The use of continuum and discrete algorithms for colli-sion avoidance also brings up a common issue with eitherclass, namely their applicability to different ranges of agentdensity. Continuum algorithms (e.g., [2]) are ideally suitedfor medium to high densities, since the continuum assump-tion holds when pedestrian paths are tightly constrained bythe nearby neighbors found at these levels of density. Onthe other hand, though discrete algorithms can be appliedat any density, their computational costs escalate at highdensities, along with numerical issues in some cases. Since

� A. Golas, S. Curtis, and M.C. Lin are with the University of NorthCarolina at Chapel Hill. E-mail: {golas, seanc, lin}@cs.unc.edu.

� R. Narain is with the University of California, Berkeley.E-mail: [email protected].

Manuscript received 8 Apr. 2013; revised 18 Aug. 2013; accepted 14 Sept.2013. Date of publication 26 Sept. 2013; date of current version 29 May 2014.Recommended for acceptance by S.-E. Yoon and G. Meenakshisundaram.For information on obtaining reprints of this article, please send e-mail to:[email protected], and reference the Digital Object Identifier below.Digital Object Identifier no. 10.1109/TVCG.2013.235

1022 IEEE TRANSACTIONS ON VISUALIZATION AND COMPUTER GRAPHICS, VOL. 20, NO. 7, JULY 2014

1077-2626 � 2013 IEEE. Personal use is permitted, but republication/redistribution requires IEEE permission.See http://www.ieee.org/publications_standards/publications/rights/index.html for more information.

Page 2: Hybrid Long-Range Collision Avoidance for Crowd Simulation

crowds can exhibit an entire spectrum of densities even inany particular scene, these cases are not exceptions, butcommon occurrences. This insight suggests the need for aninexpensive hybrid scheme that locally blends bothapproaches for efficient collision avoidance over the entirespectrum of crowd densities. Such a scheme should choosethe most suitable underlying algorithm for a particular sim-ulation sub-domain, especially for problem cases where thewrong choice can lead to instabilities or other computa-tional issues such as in scenarios of high or low densities,high variance of agent velocities, etc.

To address these problems, this paper introduces the fol-lowing main results:

� A novel approach for approximate long-range col-lision avoidance that can be used with discrete orcontinuum algorithms with minimal increase incomputational costs.

� An inconsistency metric to measure oscillationsin agent trajectories that can be used to detectchaotic crowd behavior and curtail lookahead orto serve as a basis for comparing crowds, real orsimulated.

� A hybrid algorithm that combines existing contin-uum and discrete collision avoidance algorithms toefficiently compute smooth local collision avoidanceresponses in any sub-domain.

� Comparison to real-world data that demonstratesimproved speed sensitivity to density in simulatedcrowds using our algorithm, similar to humancrowds as measured using the fundamental diagram.

Our results show significant improvements in crowdprogress with minor increases in computational costs InFig. 1, we demonstrate our approach on two scenarios,where improvements in crowd behavior and progress areseen with less than 3x computational overhead. Ourapproach is able to perform interactive long-range steeringfor both large, dense crowds and sparsely populated scenes,but also achieve interactive rates on a commodity laptop.

2 BACKGROUND

We model a crowd as a set of agents, each of which has aspecified goal position that it attempts to reach while avoid-ing collisions with other agents and with static obstacles inthe environment. The standard crowd simulation loop thatwe and others often use is as follows:

1. For each agent, perform global planning to find apath to the goal that avoids collisions with staticobstacles while ignoring other agents. Set the pre-ferred velocity vp along the direction of the initialsegment of the path.

2. For each agent, perform local collision avoidance tosteer the preferred velocity vp away from collisionswith other agents, yielding the actual velocity v thatthe agent moves with.

Below, we briefly discuss some of the prior work relatingto these two steps and discuss some of the data and techni-ques used for validating crowd simulation.

Most algorithms for global planning represent the con-nectivity of free space in the environment as a graph, andperform search queries for each agent to determine a

Fig. 1. Results without lookahead (left) and with lookahead (right) for two demo scenarios. Crossing: (Top) shows two groups of agents seeking toexchange positions at simulation time t ¼ 10 s. Note how, with lookahead, the bigger group parts to allow smaller group through. Circle: (Bottom) showsagents on the edge of a circle heading to diametrically opposite points at simulation time t ¼ 40 s. Note significantly improved progress with lookahead.

GOLAS ET AL.: HYBRID LONG-RANGE COLLISION AVOIDANCE FOR CROWD SIMULATION 1023

Page 3: Hybrid Long-Range Collision Avoidance for Crowd Simulation

collision-free path [3], [4], [5], [6], [7], [8], [9]. We do notdiverge from previous work in this aspect.

A variety of models have been proposed for local colli-sion avoidance among agents. These may use either discreteor continuum representations of the crowd. In discrete mod-els, each agent considers other agents as individualobstacles, and attempts to avoid all of them simultaneously.Collision avoidance in this context can be formulated interms of repulsion forces between agents [9], [10], [11], [12],[13], [14], [15], [16], or geometrically based algorithms [17],[18], [19], [20], [21]; the state of the art involves treating pos-sible collisions as obstacles in velocity space [22], [23], [24],[25]. As considering the interaction of all pairs of agentsbecomes expensive in large crowds, such methods typicallyonly take into account neighboring agents that lie within aspecified radius, limiting the amount of lookahead possible.Guy et al. [26] propose a method to mitigate the computa-tional cost of large neighborhoods by approximately cluster-ing agents.

In a continuum-based approach, one first obtains fromthe set of agents a density field and a velocity field by accu-mulating the agents’ positions and velocities on a back-ground grid. This smoothed representation can then beused to compute the ideal motion of agents while avoidingregions of high density. The method of Treuille et al. [27]performs a global solve over the obtained density and veloc-ity fields, giving compelling results including long-rangecongestion avoidance effects. However, its computationalcost increases steeply with the number of distinct goals inthe simulation, making this approach unsuitable for interac-tive crowd simulation where agents may have many diversegoals. Narain et al. [2] propose a technique that preventsovercrowding in highly dense crowds, but it relies onpurely local information, and thus cannot plan around con-gestion at a large distance.

Validating crowd simulation has always been challeng-ing. Historically, the presence of so-called “emergent phe-nomena” has been considered evidence which suggestedcorrectness. Steerbench is a suite of tests designed to allowcomparison of models [28]. While it suggests some basis forcomparing models, it does not present (or use) a groundtruth; there is no data of human pedestrians used in per-forming the benchmarks.

In the pedestrian dynamics community, the most com-mon quantitative metrics for crowd behavior deal withaggregate crowd properties: flow and density. The relation-ship between flow and density has been referred to as the“fundamental diagram” [29]. In addition to this aggregateanalysis, Guy et al. propose a new statistical metric for mea-suring how likely a particular pedestrian model is to matcha given set of data [30]. In recent years, experiments havebeen performed with human subjects in various scenariosand several data sets have been made publicly available:“one-dimensional” pedestrian movement, uni-directionalmovement [31], uni- and bi-directional flow in a corridor[32], [33], and flow through a bottleneck [34]. The value oflookahead is greatest in the case of conflict. As such, we donot perform validation against the uni-directional corridoror bottleneck flow. Instead, we perform analysis on anexperimental setup similar to [33]. Ideally, we would preferdata of pedestrians moving over a large space, however,

even in this limited scenario, we can show that lookaheadimproves the behavior of the simulated crowds (see Fig. 12).

Our approach aims to extend some of the existing work inLCA algorithms to support long-range collision avoidancequeries. We accomplish this through the simple yet effectiveapproach of extrapolating agents’ motion into the future.Our algorithm is described in Section 3, and we demonstrateits application to continuum and discrete algorithms in Sec-tions 3.1 and 3.2. In some cases lookahead may not be possi-ble, particularly in presence of obstacles and turbulent flow.These are detailed in Section 4 in addition to a novel metricfor measuring oscillation and chaotic behavior in crowds.Furthermore, using discrete models alone can be extremelyexpensive in dense crowds, while continuum models arepoorly suited to representing the motion of sparse crowds.In Section 5, we propose a hybrid algorithm that blendsresults from continuum and discrete algorithms, producingconsistently realistic results for both low and high densitiesunder various velocity conditions. We demonstrate theadvantages of our proposed techniques with examples inSection 6, and compare our proposed lookahead based long-range collision avoidance algorithm with real-world data inSection 7. Finally, we conclude with the limitations of ourmethod, and discuss avenues for future work in Section 8.

3 LOOKAHEAD FOR LONG-RANGE COLLISION

AVOIDANCE

In this section, we describe our approach for efficiently com-puting long-range collision avoidance for both continuum-based and discrete agent-based crowd models. The problemcan be summarized as follows: For each agent with a givenpreferred velocity vp (as computed by the global planningstage), we wish to find an updated velocity v close to thepreferred velocity vp that avoids congestion in front of theagent at a range of distances from far to near, and alsoavoids collisions with neighboring agents. Influences fromnearer agents should receive priority; that is, the agentshould not divert itself to collide with a nearby agent in try-ing to avoid congestion farther away.

Given the extensive amount of already existing work onlocal collision avoidance algorithms, our aim is to takeadvantage of these existing techniques to solve the problemof long-range collision avoidance. In this paper, we proposea general approach for decomposing long-range collisionavoidance into a sequence of simple LCA queries. Thus, ouralgorithm can re-use existing LCA algorithms with minimalincrease in computation and coding effort. We show how toapply this approach to both the discrete and continuum set-tings, resulting in efficient algorithms for long-range colli-sion avoidance in both cases. The crux of the idea lies inevaluating LCA queries not only on the current state ofthe crowd, but on its future state, estimated at a series offuture times, enabling greater lookahead while using onlylocal operations.

When an agent plans its long-term motion, it needs toestimate the motion of other agents over a large time inter-val into the future. While the future motions of other agentsare of course unknown, they can be estimated with somedegree of confidence using the agents’ current velocities. Toreflect the uncertainty in this estimation, we treat an agent’s

1024 IEEE TRANSACTIONS ON VISUALIZATION AND COMPUTER GRAPHICS, VOL. 20, NO. 7, JULY 2014

Page 4: Hybrid Long-Range Collision Avoidance for Crowd Simulation

predicted location in the future not directly as a point, but asa probability distribution representing the expected proba-bility of finding the agent at a given position. Intuitively,one can think of this as a traveling “blob” of probability,whose center xðtÞ is linearly extrapolated from the agent’scurrent position and velocity, and whose spread sðtÞ gradu-ally expands over time, reflecting the increasing uncertaintyas one looks further in the future.

In the continuum representation of the crowd, this hasthe effect of smoothing out the influence of any agent on thecrowd density field, which enlarges the distance over whichit influences the motion of other agents while simulta-neously attenuating the magnitude of its effect. Thus, whenan agent performs a short lookahead, only its nearby agentsare significantly influential, while over a large lookahead, itonly sees a smoothed-out density field that averages overmany agents across a large area. In the discrete model, anagent is treated as a rigid, impenetrable “blocker” of fixedradius. When the agent position is uncertain, we consider apoint to be blocked by the agent if the probability that theagent covers that point is at least a certain threshold p. Ascan be seen in Fig. 2, as the uncertainty increases, the effec-tive size of the blocker decreases. This has the desirableeffect that agents planning far into the future are not exces-sively hindered by the estimated motion of other agents,given that the latter is unreliable.

With this model for uncertainty, we can formulate thebasic lookahead algorithm for long-range collision avoid-ance. The algorithm starts with the preferred velocities vpobtained from the global planning stage, and performs anumber of iterations i ¼ imax; imax�1; . . . ; 0 with decreasingtime horizons Dti ¼ 2i�1Dt; i > 0, and Dt0 ¼ 0. In each itera-tion, we extrapolate the state of the crowd by a time intervalDti into the future, perform an LCA query (with uncer-tainty) using the preferred velocity, and then replace thepreferred velocity with the result of the LCA, as illustratedin Fig 3. In the last iteration, we set the lookahead Dt0 tozero, so that we perform the standard LCA with no uncer-tainty, and thus maintain the collision avoidance guaranteesof the underlying LCA.

With this scheme, agents are sampled in a larger radiusthan in the standard LCA query, and extrapolated queriesare biased towards the direction of motion, providinglookahead. Our approach smoothly merges the effects of

distant and nearby avoidance considerations. Congestionavoidance with a long time horizon takes place in earlierlevels, influencing the final result by updating the pre-ferred velocity; nevertheless, this can still be overridden ifneeded to avoid imminent collisions with nearby agents,which are considered later in the process.

The algorithm is defined formally in Fig. 4, where wedenote by v ¼ Aðvp; vc; x; rÞ an LCA query performed for anagent at position x with current velocity vc and preferredvelocity vp in a region of local density r (people per unitarea), producing a collision-free velocity v. In the followingsections, we apply our generic long-range collisionavoidance algorithm to two examples of LCA algorithms,one continuum-based and one discrete, showing thebroad applicability of our technique. We also describesome optimizations that are possible in the specific cases.

Fig. 2. Effect of extrapolation in time from x ¼ 0; t ¼ 0 to x ¼ 4; t ¼ iDt.Dotted line indicates effective radius (P � 0:4) of agent for collisionavoidance, while spread of gaussian curve indicates splatting area fordensity field creation.

Fig. 3. Effect of lookahead. Note how lookahead allows the orange agentto see the approaching crowd and adjust its velocity from preferredvelocity vp to v by incorporating information from the future crowd stateat time tþ Dt.

Fig. 4. Lookahead Algorithm using LCA algorithm A.

GOLAS ET AL.: HYBRID LONG-RANGE COLLISION AVOIDANCE FOR CROWD SIMULATION 1025

Page 5: Hybrid Long-Range Collision Avoidance for Crowd Simulation

3.1 Continuum Lookahead

Continuum representations treat the crowd as a continuousdistribution of density r and velocity v over space, throughwhich any given agent must navigate. The knowledge ofthe density distribution enables us to determine congestiondirectly as regions of high density. It is well known thatpedestrians walk slower in regions of high density [35], afact that can be formalized into a graph known as the funda-mental diagram relating density, r, to a natural walkingspeed: vmax ¼ fðrÞ Therefore, agents should navigatearound overcrowded regions to avoid lowering their speedand maximize their rate of progress towards their goals. Inthis section, we first describe a simple algorithm that usesthis idea to avoid congestion over a short time horizon,then extend it to look much further in time using our long-range approach.

Consider an agent that has a preferred velocity vp point-ing towards of the goal. Suppose over the planning timehorizon Dt, the agent maintains a constant heading along achosen direction v̂ and walks at the maximum speedallowed by the fundamental diagram f . Then to first order,the density it passes through will change at a rate of fv̂ � rr,and so its displacement after time Dt will be

dðDtÞ ¼ fv̂Dtþ 1

2ðfv̂ � rrÞf 0v̂Dt2; (1)

where f and f 0 are evaluated at the density at the currentposition. We choose v̂ to maximize the progress towards thegoal, vp � dðDtÞ. This formulation reduces to the followingoptimization problem,

argmaxv̂

vp � v̂þf 0Dt

2ðv̂ � rrÞðvp � v̂Þ

� �kv̂k � 1: (2)

We can solve this problem using projected gradient descent,with the direction of the current velocity as the initial guess;this converges in less than ten iterations on average. Thissimple approach produces excellent avoidance results withmaximal progress while still being computationally inex-pensive. Though similar in spirit to [2], it avoids the need tocalculate a global pressure to exert forces.

Before formulating the lookahead algorithm for contin-uum crowds, we first need to estimate the future densitiesof the crowd. In accordance with the uncertainty model,extrapolation further into the future requires that eachagent’s contribution to the density field be spread out overlarger and larger areas, which can become inefficient withthe traditional “splatting” approach. Instead, it is more effi-cient to represent future states on coarser grids, which willautomatically have the effect of increasing the agents’ effec-tive footprint. Each successive grid is coarsened by a user-defined factor c, which represents the increase in uncer-tainty sðDtÞ from one level of lookahead to the next. Thus, apyramid of grids is constructed, where each level is coarserthan the one below it by a factor c. Level i of the pyramidcontains the future state of the crowd at time tþ Dti.

With this representation, the lookahead algorithm asdefined in Fig. 4 can be directly applied. For each cell at thebottom of the pyramid, we solve the LCA problem sepa-rately at multiple levels of the pyramid, starting from the

top and cascading the solution at level i as the preferredvelocity at level i� 1. Though this involves redundantcomputation being a depth-first approach, we prefer thisapproach as opposed to the breadth-first model where allcells at level i are solved, and the solution is cascaded downto level i� 1. This allows improved parallelism since thereis no interdependence of solutions of neighboring cells, areduced memory footprint since intermediate solutionsdo not need to be stored, and reduced interpolation andsmoothing artifacts.

3.2 Discrete Lookahead

We now extend the algorithm to discrete collision avoid-ance. Here, we use an extended reciprocal velocity obsta-cle (RVO) algorithm [25], which is implemented in theRVO2 library [36]. The RVO algorithm performs collisionavoidance in velocity space, that is, the space of possiblevelocities that an agent may choose. In this space, wecreate a “velocity obstacle” for each neighboring agent,which represents the set of velocities that would lead toa collision with that agent. Then, choosing a velocity out-side the union of all these obstacles ensures collisionavoidance. Each obstacle is modeled as a constraint in alinear optimization problem to determine a collision-freevelocity closest to the preferred velocity.

The RVO library requires the choice of a neighbor-hood radius R and time horizon t, and only guaranteescollision-free behavior within time t with nearby agentsno further than R distance away. This technique is lim-ited to local planning in a small neighborhood, asincreasing t and R to large values degrades the perfor-mance of the method. To support long-range collisionavoidance, we apply our algorithm to RVO-based LCAwith minor modifications.

Instead of constructing trees for each future instant, weapproximate future neighbor searches from the currentstate. Recall that our generic algorithm has multiple levels,and at the ith level, we consider a lookahead of Dti time intothe future. In the discrete setting, we search for agentswhich may collide with the current agent within time Dti.Since distance between two agents can change at most by2vmaxDti in this time, where vmax is the maximum agentspeed, the agents relevant at level i are those that lie at dis-tances between Rþ 2vmaxDti�1 and Rþ 2vmaxDti from thecurrent agent at the present time. Once these neighbors aredetermined, we create velocity constraints using the agents’extrapolated future positions, with their effective radii rfreduced by a ratio c for every step into the future. (This con-stant is the same as that grid coarsening factor for the con-tinuum formulation, since both density and effective agentradius are inversely proportional to the standard deviationof the probability distribution assumed for the agent.)

Now, all the long-range interactions considered at differ-ent levels are represented simply as constraints on the finalvelocity of the agent. Instead of solving the levels one afteranother, we may apply all the constraints simultaneously ina single RVO optimization. This means that only one opti-mization solve needs to be performed per agent, but at theexpense of an increase in the number of constraints. Wetherefore adopt a level-of-detail approach to reduce the

1026 IEEE TRANSACTIONS ON VISUALIZATION AND COMPUTER GRAPHICS, VOL. 20, NO. 7, JULY 2014

Page 6: Hybrid Long-Range Collision Avoidance for Crowd Simulation

number of constraints by adaptively grouping distantagents into clusters.

As we extrapolate agents further in time, their effectiveradius reduces further, and thus have a decreased effect onagent velocity. Thus, it is prudent to cluster these agentsboth to improve efficiency, and to increase the probabilityof avoiding a future collision. We use a spatial hierarchy,such as a k� d tree, over the agent positions to choose theclusters. Such a hierarchy already exists in the RVO imple-mentation to support nearest neighbor queries, and so doesnot require additional computational effort. The nodes ofthe tree can provide suitable candidates for agent clusters.

When considering lookahead at level i, that is, untilfuture time Dti, we only consider agents at a distancebetween Rþ 2vmaxDti�1 and Rþ 2vmaxDti. These agentsshould be grouped into clusters of size Dti

Dt as shown inFig. 5. Instead of performing multiple searches to collectnodes at each level, we perform one tree traversal where thelevel of the node can be determined based on its distancefrom the agent. Thus, we perform a tree traversal whereat any node C, we can determine its level i by checkingwhich distance band it lies in, i.e., dC 2 ½Rþ 2vmaxDti�1; R þ2vmaxDti�. However, every node may not form a good candi-date since the distribution of agents in the subtree of thisnode may be sparse. Therefore we use a maximal separationas a quality measure of each node, i.e., maxi2subtreeðCÞdisti,where disti ¼ mink2subtreeðCÞðkxi � xkkÞ. Though exact com-putation of this value is expensive, we compute an approxi-mate value during tree construction by choosing themaximum of child values, and the separation between thenodes themselves. Thus, if a node satisfies this quality con-straint, it can be added as a velocity constraint.

Once we have a chosen a set of agents to form a cluster,we set its position xC and velocity vC as the mean of thepositions and current velocities of its member agents. Wechoose the effective radius rC of the cluster so that it coversall the expected agent positions, and is padded by the

effective agent radius rf for time tþ Dti. In other words, fora cluster of m agents fx1; x2; . . . ; xmg, we define

xC ¼1

m

Xmj¼1

xj; ð3Þ

vC ¼1

m

Xmj¼1

vj; ð4Þ

rC ¼ rf þmaxjkxj � xCk: ð5Þ

With this definition, we define our discrete lookahead algo-rithm in Fig. 6.

4 CURTAILING LOOKAHEAD

The discussion thus far has been based on the assumptionthat agent states can be extrapolated to any future time.However in certain cases, the information available to long-range collision avoidance may be insufficient to create a reli-able future state. In such cases, we curtail lookahead to thelast reliable future time.

If the extrapolated path intersects an obstacle, we caninfer that the agent has a plan to prevent this. However,determining this plan would require a query to the localplanner, which in turn would require positions of all neigh-bors. This can recursively trigger local planning queries foran increasing number of agents, thus increasing computa-tional cost. Thus choosing the simpler alternative of curtail-ing lookahead is a computationally efficient choice. Thisalso has parallels among human crowds, which tend to planwithin their visual range. Since obstacles restrict the visualrange, it is natural to allow obstacles to curtail the planningregion in a simulation as well.

The other scenario where we propose curtailing look-ahead is when an agent has a chaotic trajectory—as mea-sured over a small window of previous time steps.Extrapolating such a trajectory using any low-order polyno-mial function is likely to result in large approximationerrors. This may even be indicative of a chaotic crowd, or anartifact in the underlying algorithm. In either case, the localcrowd state is not amenable for long-range collision avoid-ance, as its future state is hard to predict.

We now detail the exact method utilized to address thesetwo cases.

Fig. 5. Distant agents can be clustered for collision avoidance, clustersize being proportional to distance. Since possible collisions with distantagents lie in future timesteps, extrapolated future agent states have highuncertainty, and hence small effective radii, making individual avoidanceinefficient.

Fig. 6. Lookahead Algorithm using RVO.

GOLAS ET AL.: HYBRID LONG-RANGE COLLISION AVOIDANCE FOR CROWD SIMULATION 1027

Page 7: Hybrid Long-Range Collision Avoidance for Crowd Simulation

4.1 Obstacles

We allow extrapolation step i if and only if the path fromthe agent’s current position to its extrapolated position doesnot intersect any obstacles, which can be modeled as a visi-bility query. Correct extrapolation of the agent’s positionwould necessitate a model for agent response to an obstacle.As previously explained, this can result in a significantincrease in computation. In addition, this may require infor-mation from the global planner. This information is typi-cally not available. While it could be made available, thiswould require significant changes to the simulation pipe-line, undercutting one of the goals of this approach: toextend current systems with minimum modification.

These queries can be efficiently implemented for bothcontinuum and discrete simulations. Continuum simula-tions traditionally model obstacles as distance fields.These can be used to efficiently perform the needed inter-section tests. The extrapolation curve representing theexpected trajectory can be checked for collisions by find-ing the minimum distance to any obstacle in the scene.Such algorithms involve sampling the distance field atmultiple points—either uniformly or adaptively—alongthe curve, with sampling controlled by the cell width ofthe distance field and the curvature of the curve itself.This approach can also be used for discrete simulations.However, in case the underlying simulation representsobstacles as discrete objects, an alternate approach can beused. In such a scenario, the problem can be modeled asa ray shooting problem. Using a hierarchical structure forstatic obstacles in the scene, such visibility queries can beperformed efficiently at run-time.

4.2 Chaotic Crowds

Extrapolation assumes that agent velocity is temporally con-sistent, i.e., the agent is expected to follow a predictablepath. However, if the underlying crowd flow presents cha-otic disturbances, then future agent states cannot be deter-mined reliably with low-order extrapolation. Determiningwhether a crowd exhibits chaotic behavior locally or glob-ally requires the knowledge of agent velocities for a timewindow. Given this information, we propose a new‘inconsistency metric’ to detect chaotic behavior, and mea-sure the suitability of the agent’s state to extrapolation.

4.2.1 Inconsistency Metric

In case of an oscillating agent trajectory, extrapolation of anagent’s position is not feasible due to the uncertainty inthe agent’s velocity. This oscillation can be measured by theacceleration of the agent, determined using its first-orderapproximation as

dv ¼ vi � vi�1

Dt; (6)

where vi is the agent velocity at step i, and Dt is the timestep between the two steps. Thus for each agent, a relativedeviation can be computed at every time step i.

The inconsistency metric is computed using a set of ndeviation vectors. These 2-dimensional deviation vectorsare concatenated into a n� 2 matrix M. We use PrincipalComponent Analysis (PCA) to analyze the deviation vectors

by computing the eigenvalues of the matrix:

C ¼ 1

nMTM: (7)

The eigen-decomposition of this matrix is of the form:

XTL2X; (8)

where L is a diagonal matrix with entries �1 and �2, asshown in Fig. 7. The metric is then defined as the sum of themagnitudes of the eigenvalues:

s ¼ j�1j þ j�2j: (9)

Low values of the metric indicate a smooth low-order trajec-tory of the agent, while higher values indicate chaotic paths.The rows of X give the corresponding eigenvectors x1 andx2, which can be used to further analyze the nature of thedeviation.

To determine whether an agent can be accurately extrap-olated, the inconsistency metric can be computed on a localneighborhood of the agent. In this case the matrix M is con-structed from the deviation vectors of the agent and itsneighbors over a time window of t seconds, i.e., for kagents, data for f time steps, f ¼ t

Dt is concatenated into akf � 2 matrix M. The contribution of older samples can bealso weighted to facilitate graceful degradation. For analysisof the entire crowd, the metric can be computed for allagents using a single matrix containing all deviation vectorsfor the given time window. Such analysis can be useful for

Fig. 7. Our proposed inconsistency metric s is computed as the sum ofthe eigenvalues �1; �2 of the given deviation vectors dv (in red), whichrepresents the variance of these deviations. The eigenvectors x1; x2 (ingreen) corresponding to these eigenvalues represent the principal com-ponents of the space of deviations.

1028 IEEE TRANSACTIONS ON VISUALIZATION AND COMPUTER GRAPHICS, VOL. 20, NO. 7, JULY 2014

Page 8: Hybrid Long-Range Collision Avoidance for Crowd Simulation

comparing collision avoidance algorithms, preferring thosewhich result in smoother paths as indicated by slowly vary-ing velocity.

4.2.2 Curtailing

The inconsistency metric value as computed for the localneighborhood of an agent can be used to curtail the extentof lookahead. Variation of velocity in the vicinity of theagent indicates that the agent velocity is likely to change inthe near future as well. For inconsistency values near zero,the agent can perform the allowed maximum imax look-ahead steps. As the metric value rises to a maximum smax

and beyond, the maximum allowed lookahead stepsdecrease to zero, at which point only local collision avoid-ance is performed. We use linearly spaced transition points,performing at most i lookahead steps if the metric value s

lies in the range:

s 2 ði� 1Þsmax

imax

ismax

imax

� �(10)

for simplicity. The agent’s choice of how far to look aheadis assumed to be based on local crowd conditions. Thus,only neighbors as defined by the local collision avoidancealgorithm are used for computing the inconsistency met-ric for an agent. This metric value controls the agent’slookahead steps, as well as the lookahead of any agentsconsidering this agent for collision avoidance. Thisimplies that if a distant agent cluster has a metric valuehigher than that allowed for the lookahead step, then thatcluster will not be considered for collision avoidance atthat step, since that cluster cannot be expected to behavecoherently as a single entity. Also, though the metric canbe computed for every agent, its value is expected to varysmoothly, hence it can be sampled at certain points andinterpolated for remaining agents, improving the effi-ciency of this computation.

5 HYBRID CROWD SIMULATION

Collision avoidance guarantees, provided by algorithmsdiscussed thus far, are conditional on certain assumptions.In situations where these assumptions are violated, collisionavoidance guarantees do not hold, and this can produceincorrect or at least visually unappealing results. For exam-ple, continuum algorithms work on the assumption that acrowd can be represented accurately as a density field. Inlow density regions, where this assumption does not hold,agents routinely collide with each other, or have to bepushed apart creating oscillatory behavior. In addition, gridrepresentations of these fields can suffer from aliasingissues, resulting in damped or smoothed velocities. Discretealgorithms suffer from numerical issues at high densities,due to low inter-agent separation. For example, force basedmethods use repulsive forces that are inversely proportionalto distance. As a result, strict limits need to be enforced toprevent agents from colliding, either on the time step, or onthe repulsive forces themselves. In geometric methods likeRVO [22], [25], this is reflected in increased constraints onthe solution, meaning that the algorithm needs to spendmore computational time to converge, or risk failing to

compute a collision-free velocity. In addition, computa-tional costs of discrete algorithms are proportional to thenumber of agent neighbors. Since this cost rises sharply forhigh density regions, discrete algorithms can lose their per-formance edge for such scenarios.

Our lookahead formulation performs successive localcollision avoidance queries, thus such errors are likely toaccumulate and cause significant issues. To address thisissue, we propose a simple and efficient hybrid algorithmthat blends discrete and continuum collision avoidanceresults. This is possible since problem cases for either classof algorithms do not overlap. The choice of algorithm isbased on both density and variance in velocity. For varyingdensity, there are three possible cases:

� ½0; rcmin�. Discrete collision avoidance.

� ½rcmin; rdmax�. Blend Discrete and Continuum colli-sion avoidance.

� ½rdmax; rmax�. Continuum collision avoidance.where rdmax is the maximum density at which discrete colli-sion avoidance can be applied, rcmin is the minimum den-sity for continuum collision avoidance, and rcmin � rdmax.By using linear blending, this can be expressed as

v ¼ vdiscð1� wÞ þ vcontw ð11Þ

w ¼ wr ¼ clampr� rcmin

rdmax � rcmin; 0; 1

� �; ð12Þ

where clampðx;min;maxÞ clamps the value of x to therange ½min;max�, and vdisc and vcont are collision-free veloci-ties generated by discrete and continuum algorithms,respectively. In our examples we use rcmin ¼ 2,rdmax ¼ 4; rmax ¼ 5:5. The values of these parameters areguided by the densities observed in human crowds, beingless than 5:5 people per m2 in most cases. For choosingrcmin, we rely on guidance from [37], which states that thecrowds can be represented as a continuum “provided thecharacteristic distance scale between pedestrians is much less thanthe characteristic distance scale of the region in which the pedes-trians move”. In medium-scale examples like those shown inthis paper, densities above rcmin ¼ 2 people per m2 satisfythis constraint in the average sense. At higher densityranges, we observe qualitatively similar results using con-tinuum and hybrid algorithms at densities higher than fourpeople per m2, which guides the choice of rdmax.

To address the case of high velocity variance, we candefine similar linear blending weights. In this case, blendingweights are controlled by the standard deviation sv of thelocal velocity. We blend discrete and continuum velocitiesin a user-defined range ½c1v; c2v�, where v is the local veloc-ity, and c1; c2 are constants. In regions of low velocity vari-ance, continuum avoidance is preferred, with discreteavoidance preferred in regions of low variance, where vari-ance is s2

v. Then, in a manner similar to equation (12), wecan define blending weights for this case as well:

wsv ¼ clampc2v� sv

c2 � c1ð Þv ; 0; 1� �

: (13)

GOLAS ET AL.: HYBRID LONG-RANGE COLLISION AVOIDANCE FOR CROWD SIMULATION 1029

Page 9: Hybrid Long-Range Collision Avoidance for Crowd Simulation

Note that this weight has a slightly different form to main-tain the convention in (11).

We now need to combine these two weights to pro-duce a single interpolation weight. Though a number ofpossible combinations exist, we choose w ¼ wrwsv . Thisis biased towards a discrete solution, which ensures thatthe likelihood of regions with high velocity variancebeing simulated with continuum methods remains low.This weighing can be tuned by appropriately choosing c1

and c2. We find best results by choosing c1 ¼ 1, c2 ¼ 2. Itis important to note that these two weights are not inde-pendent. As has been noted by [2] and others, velocityvariance decreases at high densities. Thus adding aweight for velocity variance does not affect high densitybehavior significantly.

6 RESULTS

Our algorithms were implemented in C/C++ using scalarcode. In Table 1, we provide running times on a quad-coreIntel Core i7 965 at 3.2GHz. Note that these times can be sig-nificantly improved by using appropriate vector instruc-tions. We modified the RVO2 library to remove therestriction of maximum neighbors so as to provide collisionavoidance guarantees for the neighborhood threshold sup-plied. Detailed results and visualizations of our tests pre-sented here, including validation tests, can be found athttp://gamma.cs.unc.edu/lookahead.

Our lookahead and hybrid algorithms were tested on anumber of cases. The first example scenes demonstrate thelookahead algorithm for the continuum and discrete cases.In the discrete case, two groups of agents—one bigger thanthe other—head towards each other on a collision course.

Using our lookahead algorithm, the larger group of agentsparts to allow the smaller group to go through, which is notobserved in the traditional RVO algorithm. Though weencounter a 3.5x slowdown, the progress seen by agents ismore than double, thus over the time of the simulation, theoverall cost is less than 2x. In the continuum case (Fig. 10),where four groups of agents attempt to reach diametricallyopposite regions, more distant agents avoid the high den-sity region in the center. In contrast to a simulation withoutlookahead, agents are able to reach their destination sooner,demonstrating improved crowd flow and progress. Anadvantage of the continuum case is that lookahead isextremely inexpensive, as is seen with this example, wheresignificant improvements in behavior can be seen at almostno cost.

The second example scene demonstrates a four-waycrossing. With traditional collision avoidance schemes, abottleneck quickly develops in the middle of the scenehindering progress and causes spurious behavior. Suchbehavior is significantly reduced with lookahead, both inthe discrete and continuum cases. Using hybrid algorithmin this case provides two benefits. Oscillation of agents inlow density regions is reduced as compared to the contin-uum algorithm, while significant performance benefitsare obtained vs. the discrete algorithm. Though discretelookahead slows down significantly due to the number ofneighbors to be considered, the hybrid algorithm shows aperformance benefit of 3x while retaining the same behav-ior. A visual comparison in Fig. 8 shows the difference inthe four kinds of simulation.

We replicated the well-known circle demo with 2,000agents. In this scenario, agents are seeded on a circle andattempt to reach the diamterically opposite point as shownin Fig. 1. At a 2x extra computational cost, we observe sig-nificant improvement in behavior and progress. Agents areable to reach their goal in less than half the time, which bal-ances the computational cost.

To quantify the benefit of curtailing lookahead weanalyze the circle (Fig. 1) and four-groups (Fig. 10)demos. We examine how the choice of smax and imax

affects the simulation duration, i.e., the total time takenby all agents to reach their goals. Fig. 9 shows the resultsof this experiment. In each graph, dotted lines representsimulation duration of constant lookahead, while solidlines represent curtailed lookahead. In both scenarios, assmax increases, overall performance improves beyondconstant lookahead, as demonstrated by lower simula-tion durations. As smax continues to increase, simulationperformance asymptotically approaches constant look-ahead. It is clear that constant lookahead in scenarioswith inconsistent behavior causes agents to become

TABLE 1Single Thread Performance for Our Examples (dt ¼ 0:01s)

Legend: LA - with lookahead, Disc - Discrete, Cont - Continuum, Hyb -Hybrid. Note: > 20 fps performance in all cases (> 60 fps w Hyb) and1.5x-2.6x reduction in simulation duration with LA.

Fig. 8. Four way crossing of agents with 2,000 agents. (a) Discrete (b) Discrete with lookahead (c) Continuum (d) Continuum with lookahead. Notelack of agent buildup in cases with lookahead.

1030 IEEE TRANSACTIONS ON VISUALIZATION AND COMPUTER GRAPHICS, VOL. 20, NO. 7, JULY 2014

Page 10: Hybrid Long-Range Collision Avoidance for Crowd Simulation

overly conservative, reducing the efficiency of crowdflow. By curtailing lookahead with appropriate parame-ters, agents reach their goals more efficiently, providingimprovements of 10-100 percent. In addition to improve-ments in simulation performance, curtailing lookaheadalso results in reduced computation.

Evaluation of the inconsistency metric for curtailinglookahead increases computation by less than 5 percent,and this extra computation is balanced by the reductionin number of lookahead steps. Performance can beimproved further by coarser evaluation, as noted in Sec-tion 4.2.2.

Most demos in this video use a maximum of eight look-ahead steps. As demonstrated by Fig. 9, different scenariosand collision avoidance algorithms can demonstrate bestperformance for different values of imax and smax. Ourexperiments indicate that imax and smax can be optimizedone at a time in order. This task if simplified by the fact thatthese optimizations do not exhibit local minima.

7 COMPARISON TO REAL-WORLD DATA

We compare the simulation result of our proposed algorithmagainst available open-source data. We use the data pro-vided by [33], specifically a bi-directional flow in a con-strained environment, whose scene setup is shown in Fig. 11.

In this experiment, two groups of pedestrians travel downa narrow corridor 3:6m wide in opposing directions. Thoughthis presents a restricted environment, agents attempt tomove in a constant direction due to which they can look-ahead, and their future position can be determined withsome reasonable accuracy. We compare the behavior of realpedestrians with that of simulated crowds (Fig. 13) first byexamining the relationship between speed and density (com-monly known as the fundamental diagram), and second, byusing the metric defined in Section 4.2.1. We provide com-parison results using the discrete collision avoidance algo-rithm, RVO2 [25], [36]. Fig. 12 demonstrates how addinglookahead causes the simulated agents to exhibit a den-sity-dependent behavior similar to that of real pedes-trians. Real pedestrians demonstrate a significantsensitivity to density. Speeds decrease by a factor of 2-3as crowd density increases for one person per m2 tothree people per m2. However, a significant number ofagents using RVO2 move with a maximum speedtowards the goal as denoted by the number of samplepoints at v ¼ 1:6m=s in Fig. 12 (Top). In Fig. 12 (Bottom),

Fig. 10. Four groups of agents in circular formation exchange their posi-tions. Notice how lookahead (b) shows red and green agents movingaround the built up region in the center and avoid getting stuck as is thecase in (a).

Fig. 9. Effect of Curtailing Lookahead in the circle (Top) and four groups(Bottom) demo. Solid lines show curtailed lookahead, while dotted linesshow constant lookahead. Note how curtailing lookahead with a maxi-mum metric value smax allows agents to reach their goals faster, as dem-onstrated by the reduced duration. In some cases, curtailing can doublethe improvement shown by lookahead (circle, imax ¼ 16). Even with opti-mal choice of mmax, we see benefits of 10 percent.

GOLAS ET AL.: HYBRID LONG-RANGE COLLISION AVOIDANCE FOR CROWD SIMULATION 1031

Page 11: Hybrid Long-Range Collision Avoidance for Crowd Simulation

we note that agents show the same downward trend ofspeed with increasing density as real pedestrians.Though the observed patterns do not match humanbehavior exactly, the graphs demonstrate that addinglookahead improves the behavior of simulated agents.

Exact matching cannot be expected unless the underlyinglocal collision avoidance algorithm models humanbehavior exactly. One caveat is that agents exhibit adecreased aversion to being in dense scenarios, as isindicated by significant clustering in density range of 3-3.5 people per m2. This is partly due to lower speedsresulting in slower dissipation of congestion.

Simulated crowds in the experimental setup get totheir goals in 98:4 seconds with lookahead, while takingapproximately 169:88 seconds with purely local collisionavoidance. For the same example, real crowds are ableto navigate the same scene in 76:75 seconds. Thus, inaddition to improved crowd behavior, lookahead resultsin a 1:73� improvement in crowd progress bringing theprogress of the simulated crowd within 28:2 percent ofobserved crowds. Using a window of 10 time steps, i.e.,0:4 seconds, we computed our inconsistency metric forsimulated crowds. Local collision avoidance producedmetric values in the range ½0; 3:192� with a mean of 0:635,while crowds with lookahead resulted in values in therange ½0; 2:776� with a mean of 0:505. The inconsistencymetric measures path smoothness as indicated by low-acceleration. By this measure, lookahead improves themean path smoothness by 20:55 percent. Real-worldobservations in this experimental setup are made usinghead-trackers, which introduce a minor oscillation intoagent positions. To remove this oscillation, we computemetric values for real-world data after smoothing the tra-jectories over a window of two time steps. The resultingdata produces metric values in the range ½0; 2:213� with amean of 1:45.

8 CONCLUSIONS AND FUTURE WORK

We have presented a new, generic algorithm that can extendboth existing discrete and continuum methods to provide asimple yet effective lookahead to achieve long-range colli-sion avoidance for crowd simulations. This approach resultsin smoother crowd movement and exhibits an agent’s ten-dency to avoid congestion that is often observed in realcrowds. To quantify the smoothness of agent trajectories,we propose a novel metric. This metric also serves as themeans to curtail the extend of lookahead in presence of cha-otic crowd behavior. In addition, we propose the use of thismetric for comparing crowd simulation algorithms basedon smoothness, as well as comparing simulated crowds toreal-world data. We have further introduced a hybrid tech-nique that enables the simulation system to seamlessly

Fig. 11. Experimental setup for bi-directional crowd flow (Image courtesy [33]).

Fig. 12. Speed versus density plots for simulated crowds using (Top) tra-ditional local collision avoidance, and (Bottom) long-range collisionavoidance. Note how simulation with lookahead improves correspon-dence to speeds observed in the real-world data as compared to density,and how collision avoidance with lookahead demonstrates the samedownward trend in speed with increasing density.

1032 IEEE TRANSACTIONS ON VISUALIZATION AND COMPUTER GRAPHICS, VOL. 20, NO. 7, JULY 2014

Page 12: Hybrid Long-Range Collision Avoidance for Crowd Simulation

transition between discrete and continuum formulations bylocally blending the results and by optimizing for perfor-mance and quality of resulting simulations based on thelocal crowd density.

Our stated goal is to improve crowd flow using long-range collision avoidance; measured as crowd progress.With the improvements proposed in this paper, simu-lated crowds reach their desired goals 1:5��2:6� faster(shown in Table 1) while using speeds similar to thoseused by real crowds in similar scenarios (shown inFig. 12). As shown by these measures, lookahead bringsthe behavior of simulated crowds closer to real humans.However, in some cases we observe outliers. Afterdetailed analysis, we believe these cases arise due to theunderlying collision avoidance model. In case of Fig. 12,solitary agents sometimes turn around to avoid collisionswith oncoming groups of agents. This occurs when thespace behind said agent is empty. Thus the geometricallyoptimal solution for collision avoidance as defined by

[25] led the agent to turn around. This behavior is inde-pendent of lookahead and inherent in the underlying col-lision avoidance algorithm. However, lookahead allowsagents behind such agents to preemptively avoid theoncoming group. Though this improves overall flow, itmakes this artifact visually more prominent.

In case of Fig. 1, the larger group parts cleanly for theother. The underlying [36] algorithm optimizes with respectto hard constraints. Thus, constraints from near agents andfar groups are equally important and must be respected. Inthis case, it leads to the clean separation of the larger group.To remedy this artifact, the formulation of constraints in[25] would need to be revisited taking into account ofobserved human behaviors.

ACKNOWLEDGMENTS

This research was supported in part by ARO ContractW911NF-04-1-0088, the US National Science Foundation(NSF) Awards 0917040, 0904990, 100057 and 1117127,and Intel.

REFERENCES

[1] J. Ond�rej, J. Pettr�e, A.-H. Olivier, and S. Donikian, “A Synthetic-Vision Based Steering Approach for Crowd Simulation,” Proc.ACM SIGGRAPH 2010 papers, article 123, 2010.

[2] R. Narain, A. Golas, S. Curtis, and M.C. Lin, “Aggregate Dynam-ics for Dense Crowd Simulation,” ACM Trans. Graphics, vol. 28,article 122, 2009.

[3] W. Shao and D. Terzopoulos, “Autonomous Pedestrians,” Graphi-cal Models, vol. 69, nos. 5/6, pp. 246-274, 2007.

[4] O. B. Bayazit, J.-M. Lien, and N.M. Amato, “Better Group Behav-iors in Complex Environments with Global Roadmaps,” Proc.Eighth Int’l Conf. Artificial Life, pp. 362-370, 2002.

[5] A. Kamphuis and M. Overmars, “Finding Paths for CoherentGroups Using Clearance,” Proc. ACM SIGGRAPH/EurographicsSymp. Computer Animation, pp. 19-28, 2004.

[6] F. Lamarche and S. Donikian, “Crowd of Virtual Humans: A NewApproach for Real-Time Navigation in Complex and StructuredEnvironments,” Computer Graphics Forum, vol. 23, no. 3, pp. 509-518, 2004.

[7] J. Pettr�e, J.-P. Laumond, and D. Thalmann, “A Navigation Graphfor Real-Time Crowd Animation on Multilayered and UnevenTerrain,” Proc. First Int’l Workshop Crowd Simulation, pp. 81-90,2005.

[8] M. Sung, M. Gleicher, and S. Chenney, “Scalable Behaviors forCrowd Simulation,” Computer Graphics Forum, vol. 23, no. 3,pp. 519-528, Sept. 2004.

[9] A. Sud, R. Gayle, E. Andersen, S. Guy, M. Lin, and D. Manocha,“Real-Time Navigation of Independent Agents Using AdaptiveRoadmaps,” Proc. ACM Symp. Virtual Reality Software and Technol-ogy, pp. 99-106, 2007.

[10] C.W. Reynolds, “Flocks, Herds and Schools: A Distributed Behav-ioral Model,” Proc. ACM SIGGRAPH, vol. 21, pp. 25-34, 1987.

[11] D. Helbing and P. Moln�ar, “Social Force Model for PedestrianDynamics,” Physical Rev. E, vol. 51, pp. 4282-4286, May 1995.

[12] C.W. Reynolds, “Steering Behaviors for Autonomous Characters,”Proc. Game Developers Conf., 1999.

[13] L. Heigeas, A. Luciani, J. Thollot, and N. Castagn�e, “A Physically-Based Particle Model of Emergent Crowd Behaviors,” Proc. Graph-ikon ’03, vol. 2, 2003.

[14] T.I. Lakoba, D.J. Kaup, and N.M. Finkelstein, “Modifications ofthe Helbing-Molnar-Farkas-Vicsek Social Force Model for Pedes-trian Evolution,” Simulation, vol. 81, pp. 339-352, 2005.

[15] Y. Sugiyama, A. Nakayama, and K. Hasebe, “2-Dimensional Opti-mal Velocity Models for Granular Flows,” Proc. Int’l Conf. Pedes-trian and Evacuation Dynamics, pp. 155-160, 2001.

[16] N. Pelechano, J.M. Allbeck, and N.I. Badler, “Controlling Individ-ual Agents in High-Density Crowd Simulation,” Proc. ACM SIG-GRAPH/Eurographics Symp. Computer Animation, pp. 99-108, 2007.

Fig. 13. Crowd motion using (Top) real-world data, (Middle) Local colli-sion avoidance, (Bottom) Long-range collision avoidance.

GOLAS ET AL.: HYBRID LONG-RANGE COLLISION AVOIDANCE FOR CROWD SIMULATION 1033

Page 13: Hybrid Long-Range Collision Avoidance for Crowd Simulation

[17] P. Fiorini and Z. Shiller, “Motion Planning in Dynamic Environ-ments Using Velocity Obstacles,” Intl. J. Robotics Research, vol. 17,no. 7, pp. 760-772, 1998.

[18] F. Feurtey, “Simulating the Collision Avoidance Behavior ofPedestrians,” master’s thesis School of Eng., Univ. of Tokyo, Feb.2000.

[19] S. Paris, J. Pettre, and S. Donikian, “Pedestrian Reactive Naviga-tion for Crowd Simulation: A Predictive Approach,” ComputerGraphics Forum, vol. 26, no. 3, pp. 665-674, Sept. 2007.

[20] A. Sud, E. Andersen, S. Curtis, M. Lin, and D. Manocha, “Real-Time Path Planning in Dynamic Virtual Environments UsingMulti-Agent Navigation Graphs,” IEEE Trans. Visualization andComputer Graphics, vol. 14, no. 3, pp. 526-538, 2008.

[21] M. Kapadia, S. Singh, W. Hewlett, and P. Faloutsos, “EgocentricAffordance Fields in Pedestrian Steering,” Proc. Symposium Inter-active 3D Graphics and Games (I3D ’09), pp. 215-223, 2009.

[22] J. van den Berg, M.C. Lin, and D. Manocha, “Reciprocal VelocityObstacles for Realtime Multi-Agent Navigation,” Proc. IEEE Conf.Robotics and Automation, pp. 1928-1935, 2008.

[23] J. van den Berg, S. Patil, J. Sewall, D. Manocha, and M.C. Lin,“Interactive Navigation of Individual Agents in Crowded Envi-ronments,” Proc. ACM Symp. Interactive 3D Graphics and Games,pp. 139-147, 2008.

[24] S. Guy, J. Chhugani, C. Kim, N. Satish, M.C. Lin, D. Manocha, andP. Dubey, “Clearpath: Highly Parallel Collision Avoidance forMulti-Agent Simulation,” Proc. ACM SIGGRAPH/EurographicsSymp. Computer Animation, 2009.

[25] J.van den Berg, S.J. Guy, M.C. Lin, and D. Manocha, “ReciprocalN-body Collision Avoidance,” Proc. Int’l Symp. Robotics Research,2009.

[26] S.J. Guy, J. Chhugani, S. Curtis, P. Dubey, M. Lin, and D.Manocha, “Pledestrians: A Least-Effort Approach to CrowdSimulation,” Proc. ACM SIGGRAPH/Eurographics Symp. Com-puter Animation (SCA ’10), pp. 119-128, 2010.

[27] A. Treuille, S. Cooper, and Z. Popovic, “Continuum Crowds,”ACM Trans. Graphics, vol. 25, no. 3, pp. 1160-1168, 2006.

[28] S. Singh, M. Kapadia, P. Faloutsos, and G. Reinman, “Steerbench:A Benchmark Suite for Evaluating Steering Behaviors,” ComputerAnimation and Virtual Worlds, vol. 20, no. 5-6, pp. 533-548, 2009.

[29] U. Weidmann, “Transporttechnik Der Fussgaenger,” TechnicalReport 90, ETH Z€urich, 1993.

[30] S.J. Guy, J. van den Berg, W. Liu, R. Lau, M.C. Lin, and D.Manocha, “A Statistical Similarity Measure for AggregateCrowd Dynamics,” ACM Trans. Graphics, vol. 31, no. 6,http://doi.acm.org/10.1145/2366145.2366209, article 190, Nov.2012.

[31] A. Seyfried, B. Steffen, W. Klingsch, and M. Boltes, “The Funda-mental Diagram of Pedestrian Movement Revisited,” J. StatisticalMechanics, vol. 2005, no. 10, p. P10002, Oct. 2005.

[32] J. Zhang, W. Klingsch, A. Schadschneider, and A. Seyfried,“Transitions in Pedestrian Fundamental Diagrams of StraightCorridors and t-Junctions,” J. Statistical Mechanics, vol. 2011, no. 6,p. P06004, 2011.

[33] J. Zhang, W. Klingsch, A. Schadschneider, and A. Seyfried,“Ordering in Bidirectional Pedestrian Flows and Its Influence onthe Fundamental Diagram,” J. Statistical Mechanics: Theory andExperiment, vol. 2, p. 2, Feb. 2012.

[34] A. Seyfried, O. Passon, B. Steffen, M. Boltes, T. Rupprecht, andW. Klingsch, “New Insights into Pedestrian Flow throughBottlenecks,” Transportation Science, vol. 43, pp. 395-406, 2009.

[35] J. Fruin, Pedestrian Planning and Design. Metropolitan Assoc. ofUrban Designers and Environmental Planners, 1971.

[36] J. van den Berg, S.J. Guy, J. Snape, M.C. Lin, and D. Manocha.RVO2 Library: Reciprocal Collision Avoidance for Real-TimeMulti-Agent Simulation. [Online]. Available: http://gamma.cs.unc.edu/RVO2/.

[37] R.L. Hughes, “The Flow of Human Crowds,” Ann. Rev. of FluidMechanics, vol. 35, no. 1, pp. 169-182, 2003.

Abhinav Golas received the BTech and MTechdegrees in computer science and engineeringfrom the Indian Institute of Technology, Delhi in2008, and the MS degree in computer sciencefrom the University of North Carolina at ChapelHill, where he is currently working towards thePhD degree. His research interests include com-puter graphics, physically-based modeling andsimulation, and architecture-aware algorithms.His current research relates to large-scale flowsimulations of fluids and crowds.

Rahul Narain received the BTech degree incomputer science and engineering from theIndian Institute of Technology, Delhi, and MSand PhD degrees in computer science from theUniversity of North Carolina at Chapel Hill. He isa postdoctoral scholar at the University of Cali-fornia, Berkeley. His research interests includesimulation of fluids, crowds, cloth, and otherdynamical systems.

Sean Curtis received the BA degree in Germanfrom Brigham Young University, the BS degreein computer science from the University of Utah,and MS and PhD degrees in computer sciencefrom the University of North Carolina at ChapelHill. His research interests include pedestrianmodeling, multiagent navigation, motion synthe-sis, crowd visualization, and collision detection.

Ming C. Lin received the BS, MS, and PhDdegrees in electrical engineering and computerscience from the University of California,Berkeley. She is currently the John R. & LouiseS. Parker distinguished professor of computerscience at the University of North Carolina atChapel Hill. Her research interests includephysically-based modeling, real-time interactive3D graphics, virtual environments, geometricmodeling, and GPU-Computing. She has (co-)authored more than 250 refereed publications

and coedited/ authored four books. She is the editor-in-chief of theIEEE Transactions on Visualization and Computer Graphics and amember of six editorial boards of scientific journals. She has served asa program/paper committee member for more than 120 leading confer-ences and cochaired more than 25 international conferences andworkshops. She has received several honors and awards, includingIEEE VGTC VR Technical Achievement Award 2010, and eight BestPaper Awards. She is a Fellow of the IEEE and the ACM.

" For more information on this or any other computing topic,please visit our Digital Library at www.computer.org/publications/dlib.

1034 IEEE TRANSACTIONS ON VISUALIZATION AND COMPUTER GRAPHICS, VOL. 20, NO. 7, JULY 2014