crowd simulation i

76
CROWD SIMULATION I Introduction to Microscopic Crowd Simulation Techniques

Upload: hung

Post on 24-Feb-2016

59 views

Category:

Documents


1 download

DESCRIPTION

Crowd Simulation I. Introduction to Microscopic Crowd Simulation Techniques. Outline. Introduction to Crowd Simulation Fields of Study & Applications Visualization vs. Realism Microscopic vs. Macroscopic Flocking Social Forces 2D Cellular Automaton. Introduction. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Crowd Simulation I

CROWD SIMULATION IIntroduction to Microscopic Crowd Simulation Techniques

Page 2: Crowd Simulation I

Outline Introduction to Crowd Simulation

Fields of Study & Applications Visualization vs. Realism Microscopic vs. Macroscopic

Flocking Social Forces 2D Cellular Automaton

Page 3: Crowd Simulation I

Introduction Crowd simulation attempts to model the

motions of objects within an environment.

The topic has been researched from several different areas of study: Entertainment and Visual Effects Architecture and Civil Engineering Psychology Computer Science

Page 4: Crowd Simulation I

Applications of Crowd Simulation Entertainment and Visual Effects

Goal: Create a visually realistic model of crowds for use in movies, television, and video games.

Architecture and Civil Engineering Goal: Study the flow of people/vehicles through

environments. Analyze road network efficiency. Building evacuation characteristics.

Psychology Goal: Validate behavior models of the human mind under

different environmental conditions (ex. panic). Computer Science

Goal: Help out in any of the three areas above with algorithmic

know-how. Study AI models and behavior.

Page 5: Crowd Simulation I

Visualization vs. Realism The various crowd simulation techniques

can generally be divided into two categories: Visualization

Entertainment and Visual Effects Realism

Architecture and Civil Engineering Psychology

Techniques have begun to merge over the last decade.

Page 6: Crowd Simulation I

Crowd Visualization Goal: Create a visually realistic model of

crowds. Simulation does not have to be physically

accurate. Techniques may have to integrate with motion

captured animations. Algorithms frequently exploit Level-of-Detail.

Movies and television applications can afford offline processing as long as simulation time is reasonable.

Video games have real-time requirements.

Page 7: Crowd Simulation I

Crowd VisualizationLord of the Rings Trilogy(2000 – 2003).Using the tool “Massive.”

Disney’s Lion King (1994).

Page 8: Crowd Simulation I

Crowd Realism Goal: Study the flow of people/vehicles

through environments. Must be as physically accurate as possible.

Studies constantly compare simulation results with empirical data.

Simple visualizations such as a single point per object.

May have a very high order of objects to simulate.

Page 9: Crowd Simulation I

Crowd RealismSimulation of a ship evacuation,using the tool EXODUS.

Paths of pedestrian exploration driven byspace syntax architectural concepts.

Page 10: Crowd Simulation I

Microscopic vs. Macroscopic Simulations techniques can also be

categorized as microscopic vs. macroscopic. Microscopic techniques simulate the individual

object. Crowd behavior is an emergent property of the

microscopic-level algorithms driving the simulation. Macroscopic techniques simulate groups of

objects. Example: Treating a transit system as a flow problem.

The rest of this lecture will study three different approaches to microscopic crowd simulation techniques.

Page 11: Crowd Simulation I

FLOCKING

Page 12: Crowd Simulation I

Flocking Flocking technique introduced by Craig W.

Reynolds and his Boids. Techniques to simulate animal flocking, herds,

and schooling. Sets the stage for further study into crowd

simulation. Each agent in the simulation is called a “boid.”

Big Idea: Complex crowd behaviors can be achieved through individual agents following simple rules.

Page 13: Crowd Simulation I

Demos Boids:

http://www.red3d.com/cwr/boids/applet/

Disney’s Lion King: http://www.youtube.com/watch?v=ruNv7uA

TZTQ

How was this done?

Page 14: Crowd Simulation I

Flocking – Geometry in Flight Each boid has its own local coordinate system:

X axis is left/right Y axis is up/down Z axis is ahead/back

Rotations too: Rotation about X is pitch Rotation about Y is yaw Rotation about Z is roll

Each boid moves along its positive Z axis where pitch and yaw realign the global orientation of the Z axis.

Page 15: Crowd Simulation I

Flocking – Geometry in Flight (2)

Page 16: Crowd Simulation I

Flocking – Geometry in Flight (3) For realism in the simulation…

Momentum is conserved. Speed dampening achieved by setting a

maximum speed and acceleration. Gravity is only used for banking of boids.

Banking orientation a function of path curvature and direction of gravity.

Not physically realistic. Does not capture that traveling up is harder than traveling down.

Page 17: Crowd Simulation I

Flocking – Steering Behaviors Flocking is closely related to particle

systems. Forces between particles cause motion. Interactions take place within a local

neighborhood of each Boid. Three basic steering behaviors:

Separation Alignment Cohesion

Each steering behavior directs thrust in a desired direction.

Page 18: Crowd Simulation I

Flocking – Steering Behaviors (2) Separation

Boids steer to avoid crowding local flockmates. Collision avoidance. Keeps boids a realistic distance apart.

Page 19: Crowd Simulation I

Flocking – Steering Behaviors (3) Alignment (AKA Velocity Matching)

Boids attempt to match the velocity of their neighbors. Complements separation. Causes boids to move in the same general

direction.

Page 20: Crowd Simulation I

Flocking – Steering Behaviors (4) Cohesion

Boids steer to move towards the average position of local flockmates. Causes boids to keep together in a local flock. Allows flocks to both merge and bifurcate.

Page 21: Crowd Simulation I

Flocking – Boid Brain Each steering behavior may yield a

different thrust vector. The Boid Brain combines, prioritizes, and

arbitrates between potentially conflicting urges.

Page 22: Crowd Simulation I

Flocking – Boid Brain (2) Averaging (and weighted averaging) of

steering vectors works “pretty well” but can yield poor behavior in cases where steering urges are in opposite directions. Hesitation or indecision can lead to

collisions with obstacles. Example:

(Turn -90 degrees + Turn 90 degrees) / 2 = 0.

Page 23: Crowd Simulation I

Flocking – Boid Brain (3) Better Solution:

A fixed amount of “acceleration” is available to each boid each simulation iteration.

Steering vectors are processed in order of priority with a weighted average. Priorities may be reassigned dynamically.

Steering vectors are processed until all acceleration credits have been used up. The last processed vector is attenuated to keep

within acceleration credit limits.

Page 24: Crowd Simulation I

Flocking – Simulated Perception As mentioned earlier, boid perception is

limited to a local field of view. Local neighborhood is a spherical zone of

sensitivity centered around a boid’s origin. Sensitivity is weighted with the inverse

exponential of distance. (1/r2) Early Boid implementation used linear

weighting which yielded unrealistic spring-like animations.

Additional parameters can be used to simulated different fields of view: Extra weighting in forward direction to increase

awareness of what is ahead.

Page 25: Crowd Simulation I

Flocking – Simulated Perception (2) Implications of local perception:

Flocks of boids are allowed to bifurcate as groups of boids may break away from others and still satisfy the cohesion steering behavior. Global cohesion/centering models were used early in

Boids’ development. Generated unusual effects causing all members of a

scattered flock to simultaneously converge towards the flock’s centroid.

Spatially-oriented data structures may be used to reduce complexity below O(n2).

Page 26: Crowd Simulation I

SOCIAL FORCES

Page 27: Crowd Simulation I

Social Forces Developed by Dirk Helbing and Peter

Molnar in 1995 with several advancements over the last decade. Later contributions from Illes Farkas and

Tamas Vicsek. A frequently referenced piece of work.

Widely successful because it elegantly reproduces many common features observed in pedestrian movement.

Page 28: Crowd Simulation I

Social Forces Social Forces are not exerted by the

environment on a pedestrian’s body, but rather a quantity that describes the motivation to act. Respect personal space. Follow others at a safe distance. Avoid getting too close to walls and obstacles.

Can be thought of as a developed model of “flocking for human pedestrians” as humans follow a set of social rules that guide their movement.

Page 29: Crowd Simulation I

Desired Motion Obstacle Avoidance

Social Force Attractive Forces

Let’s work backwards. Here’s the equation describing all forces acting on an individual agent:

Social Forces ’95 – Equations

Page 30: Crowd Simulation I

Social Forces ’95 – Equations Acceleration towards a goal.

Given current location, desired location, current speed, and desired speed, an equation describing acceleration towards the destination is given by:

Where eα is a unit vector towards the destination.

The τα term is a relaxation time that causes a delay after the agent has performed deceleration processes.

Page 31: Crowd Simulation I

Social Forces ’95 – Equations Respect the personal space of others.

Pedestrians will keep a certain distance from others that depends upon the pedestrian density and desired speed. This behavior can be implemented as a repulsive force

between agents with the following equations:

Where Vαβ is a monotonic decreasing function of b with equipotential lines having the form of an ellipse that is in the direction of motion.

Elliptical range allows for an agent to leave room for their own subsequent steps.

Helbing et al later revise and simplify this equation in 2000. This will be discussed in a little bit.

Page 32: Crowd Simulation I

Social Forces ’95 – Equations

Respect the personal space of others. (cont.) Pedestrians have a limited cone of vision, so forces from agents

outside an agent’s immediate attention should be attenuated. This is done with the following weight function:

This gives us the final inter-agent repulsive forces:

Care must be taken for inter-agent forces to not cross between obstacles. For example, agents on opposite sides of a wall should not affect each other.

Page 33: Crowd Simulation I

Social Forces ’95 – Equations Avoid colliding with obstacles.

Pedestrians will also keep a certain distance from borders of buildings, walls, obstacles, etc. to avoid injury. This behavior can be described by the

following:

Where UαB is a monotonic decreasing potential. The vector rαB denotes the distance between

the agent and the nearest portion of the obstacle.

Page 34: Crowd Simulation I

Social Forces ’95 – Equations

Social Forces also allows attractive forces. Examples:

Friends Street Performers Window Displays

The equation for these forces has the same form as the inter-agent repulsive forces.

This force is also attenuated with a field of attention, giving:

Page 35: Crowd Simulation I

Social Forces ’95 – Equations Here is the final Social Force equation one

more time:

The social force model is now defined by:

The fluctuation term takes into account random variations in behavior. Enhances realism.

m/s2

Page 36: Crowd Simulation I

Social Forces ’95 – Equations The previous equation described

changes in acceleration. Changes in velocity are given by the

following equation:

The trailing g-term caps speed.

m/s

Page 37: Crowd Simulation I

Social Forces ’95 – Simulations Repulsive potentials were assumed

decrease exponentially:

Parameter values: Vo

αβ = 2.1m2/s2

σ = 0.3m Uo

αB = 10m2/s2

R = 0.2m τα = 0.5s (smaller times more

aggressive)

Page 38: Crowd Simulation I

Social Forces ’95 – Simulations (2) Two pedestrian phenomena were

observed with these equations: Lane Formation Door Oscillation

Page 39: Crowd Simulation I

Social Forces ’95 – Simulations (3) Lane Formation

The empty circles and full circles have desired direction of motion in opposite directions.

Circle diameter reflects actual velocity.

Page 40: Crowd Simulation I

Social Forces ’95 – Simulations (4)

Door Oscillation If one pedestrian has been

able to pass a narrow door, other pedestrians with the same desired walking direction can follow easily. Others have to wait.

The door can be “captured” as pressure on the opposite side builds up, allowing pedestrians in the other direction to pass.

Page 41: Crowd Simulation I

Social Forces – Additions Several additions to Social Forces has been made over the

years. In 2000, the equations were revised to study panic and

evacuation dynamics. Characteristics of panic:

People move or try to move considerably faster than normal. Individuals start pushing each other (violating repulsive

forces from earlier work). Moving becomes uncoordinated. Arching and clogging appears at exits. Jams build up. Physical interactions in jams can build up to dangerous

pressures, injuring people and breaking of obstacles. Injured people become obstacles to the rest of the crowd. People show a tendency towards mass behavior. Alternative exits are often overlooked or not efficiently used.

The bold items were addressed in 2000.

Page 42: Crowd Simulation I

Social Forces ’00 – Equations

The revised inter-agent force equation is given by:

“Body force” counteracts body compression. k is a large constant.

“Sliding friction force” impedes relative tangential motion if pedestrians come too close. Κ is another large constant.

Inspired by granular interactions. Obstacle repulsion force updated in the

same manner.

Page 43: Crowd Simulation I

Social Forces ’00 – Equations The desired direction of motion updated

to also include mass behavior:

Simulations found that a mix of both individual and mass directions worked best. Panic (high mass behavior) is realized

through a high pi value.

Page 44: Crowd Simulation I

Social Forces ’00 – Simulations Arching/Clogging at exits:

Page 45: Crowd Simulation I

Social Forces ’00 – Simulations Corridor widening can lead to

bottlenecks:

Page 46: Crowd Simulation I

Social Forces ’00 – Simulations Mass behavior and inefficient use of

exits:

Page 47: Crowd Simulation I

Social Forces – More Results Below shows the effects of fire, which is

said to have a socio-psychological strength 10x greater than a normal wall.

Incapacitated agents are shown as full circles.

Page 48: Crowd Simulation I

Social Forces – More Results (2)

Suggestions for improved motion. Environments

more conducive to efficient motion are shown on the right.

Page 49: Crowd Simulation I

Social Forces – More Results (3)

Breaking of a corridor doorway into two helps in lane formation and avoid door clogging and oscillation.

Page 50: Crowd Simulation I

Social Forces – More Results (4)

Placing a column in front of an exit can alleviates problems due to arching by reducing pressure. More efficient egress. Fewer or no injuries.

Injured agents are shown as full circles on the left.

Page 51: Crowd Simulation I

2D CELLULAR AUTOMATA

Page 52: Crowd Simulation I

2D Cellular Automata Definition (courtesy wikipedia):

“Cellular automaton (plural: cellular automata) … consists of a regular grid of cells, each in one of a finite number of states. The grid can be in any finite number of dimensions. Time is also discrete, and the state of a cell at time t is a function of the states of a finite number of cells (called its neighborhood) at time t − 1. These neighbors are a selection of cells relative to the specified cell, and do not change (though the cell itself may be in its neighborhood, it is not usually considered a neighbor). Every cell has the same rule for updating, based on the values in this neighborhood.”

Cellular Automaton commonly abbreviated as “CA.”

Page 53: Crowd Simulation I

Continuous vs. Discrete The Flocking and Social Forces models are

examples of spatially continuous simulations. Pros:

Easy to support heterogeneous agents. Each agent may have unique parameter sets for such things as mass, maximum speed, aggressiveness.

Agents may occupy fractional coordinates in space. Cons:

Obstacle avoidance is hard as distance to obstacles must be frequently computed.

Obstacles may occlude forces between agents. Difficult to compute.

Even with local neighborhoods, algorithms still have relatively complex runtimes.

Difficulty scaling.

Page 54: Crowd Simulation I

Continuous vs. Discrete (2) Why consider a CA approach?

IT’S FAST! Pros:

Obstacle avoidance is automatic. Cells are occupied or they are not.

No spatial partitioning required. All forces are within local neighborhood which are

captured through simple index lookups. No need to solve agent-agent force occlusion. Highly parallelizable and thusly highly scalable.

Cons: Very difficult to simulate heterogeneous agents. Very difficult to simulate variable pedestrian speeds. Not easy to integrate into a realistic visualization

system.

Page 55: Crowd Simulation I

2D Cellular Automata The following is a description of work by C.

Burstedde, K. Klauck, A. Schadschneider, and J. Zittartz.

The authors develop a 2D CA system for modeling pedestrian crowds. Goal to replicate the phenomena generated by

Social Forces. Lane formation Door oscillations Arching and clogging

By replicating these phenomena, they hope to prove CA is a valid approach to pedestrian modeling.

Historical Note: Most cellular automata solutions are 1D and in the domain of traffic analysis.

Page 56: Crowd Simulation I

2D Cellular Automata The 2D CA pedestrian model presented

here breaks an environment (floor plan) down into a grid of cells. Each cell may be occupied by one particle

(agent) or by an obstacle. Particles move through the environment by

moving to adjacent unoccupied cells.

Page 57: Crowd Simulation I

2D Cellular Automata – Grids

There are three CA grids: Primary Grid

Space in which pedestrians live and move. Obstacles live here too.

Static Floor Field Grid Grid of potentials that directs pedestrian flow. Different species of pedestrians (different goal

destinations) have different static grids. Dynamic Floor Field Grid

Grid that stores the “wake” or “trail” of pedestrians as they travel through the environment.

Page 58: Crowd Simulation I

2D Cellular Automata – Movement

Burstedde et al’s work is a Vmax = 1 solution where particles may only move one cell per iteration/generation.

Particles may move in 1 of 9 directions with probabilities denoted by Mij. (One direction is to stay put.) Each particle may have its own local probability

grid. If the target cell is occupied, the particle stays

put.

Page 59: Crowd Simulation I

2D Cellular Automata – Movement (2) The movement matrix M, can be computed

from desired average velocity and deviation.

This gives {p-1, p0, p1} from parameters {v, σv} which corresponds to forward and backward movement.

Repeat computation with parameters {0, σt} to compute set {q-1, q0, q1} which corresponds to transversal movement.

Mij = qi * pj

Page 60: Crowd Simulation I

σ is confined by range [σl, σh]:

This region.

2D Cellular Automata – Movement (3)

Page 61: Crowd Simulation I

Conflicts may arise as two or more particles may wish to move to the same unoccupied cell. This can be resolved by choosing among

relative probabilities*. The loser stays put.

* Later simulations show that this complication is not really necessary. Random arbitration gives similar simulation results.

2D Cellular Automata – Movement (4)

Page 62: Crowd Simulation I

To avoid pedestrians being trapped too long by others, add state counters to pedestrians to implement “happy” and “unhappy” states.

State becomes “unhappy” if pedestrian is unable to make three desired moves consecutively.

State becomes “happy” if pedestrian is able to make four desired moves consecutively.

Use different Mij probabilities for each state.

2D Cellular Automata – Movement (5)

Page 63: Crowd Simulation I

The particle’s movement probability grid is modified by the static and dynamic fields. The probability for each action is computed by:

pij = NMijDijSij Dij is the modifier value from the dynamic field. Sij is the modifier value from the static field. N is a normalization factor to insure

probabilities sum to 1. Note: Formula for pij does not have to be a

simple product. Generalized as pij = N f(Mij, Dij, Sij). f(…) may include exponentials for different behavior.

2D Cellular Automata – Movement (6)

Page 64: Crowd Simulation I

2D Cellular Automata – Fields Particles have no intelligence and do not

carry any complex state. How can Social Force phenomena be

generated? Through the use of secondary CA grids:

static and dynamic.

Page 65: Crowd Simulation I

2D Cellular Automata – Static Field

The static field simply directs particle flow through an environment towards a particle’s goal. It’s a potential field. Normalization factor counteracts small potential field

values. The field does not change throughout the

simulation.

Page 66: Crowd Simulation I

2D Cellular Automata – Dynamic Field Social Forces requires forces act from a

distance greater than the CA’s immediate neighborhood.

The Dynamic Field grid stores the “history” of particle movement and propagates the forces derived from movement. Subject to diffusion and decay.

Inspired by chemotaxis (example: ant trails).

Page 67: Crowd Simulation I

2D Cellular Automata – Dynamic Field (2)

Rules for Dynamic Field CA: If a pedestrian leaves a cell (x, y) the dynamic

floor field Dxy corresponding to this cell is increased by ΔDxy. A virtual trace is left by the motion of pedestrians.

A certain amount of the field is distributed among the neighboring cells to model diffusion. Diffusion is necessary because pedestrians do not

necessarily follow exactly in the footsteps of others. The field strength is reduced by a decay

constant δ to model decay of the field. Implies that the lifetime of the trace is finite.

Page 68: Crowd Simulation I

2D Cellular Automata – Dynamic Field (3)

Dynamic Field In Action

Page 69: Crowd Simulation I

2D Cellular Automata – Algorithm Simulation Iteration Algorithm:

1. Dynamic Field D is modified according to diffusion and decay rules.

2. Determine the matrix of transition preference for each pedestrian. (NMijDijSij)

3. Each pedestrian chooses a target cell.4. Resolve transition conflicts5. Execute transitions.6. Update Dynamic Field Dxy for all

previously occupied cells.

Page 70: Crowd Simulation I

2D Cellular Automata – Simulations Lane Formation

Two different species of pedestrians traveling in different directions across the screen.

Page 71: Crowd Simulation I

2D Cellular Automata – Simulations (2) More Lane Formation (with two doors)

Page 72: Crowd Simulation I

2D Cellular Automata – Simulations (3) Door Oscillation

Species of light-grey pedestrians can be seen breaking through.

break-throughs

Page 73: Crowd Simulation I

2D Cellular Automata – Simulations (4) Arching/Clogging

Pedestrians exit the room. Arching is clearly visible around the exit.

Page 74: Crowd Simulation I

2D Cellular Automata – Simulations (5) A full simulation: Lecture hall

evacuation.

Page 75: Crowd Simulation I

2D Cellular Automata – Extras Vmax > 1

simulations. Pros:

Better variable speeds.

Cons: Parallel Update vs.

Shuffled Update Path Crossing

See Klupfel’s dissertation for more.

Finer resolution. Allow pedestrians

to occupy more than one cell at a time.

Page 76: Crowd Simulation I

References General

Ulicny B., de Heras Ciechomski P., Musse S. R., & Thalmann D.: State-of-the-Art: Real-time Crowd Simulation. In EuroGraphics 2006 Course on Populating Virtual Environments with Crowds.

M. Schreckenberg, S. D. Sharma: Pedestrian and Evacuation Dynamics. Proceedings from the first Pedestrian and Evacuation Dynamics Conference, 2001.

Boids Reynolds C. W.: Flocks, herds, and schools: A distributed behavioral model. In Proc. SIGGRAPH ’87

(1987), pp. 25-34. http://www.red3d.com/cwr/boids/ http://cs.unc.edu/~lin/COMP259-S03/LEC/19a.ppt http://www.evl.uic.edu/vchand2/projects/527/boids.ppt

Social Forces Helbing D., Molnar P.: Social force model for pedestrian dynamics. Phys. Rev. E 51 (1995), 4282-4286. Helbing D., Farkas I., Vicsek T.: Simulating dynamical features of escape panic. Nature (September

2000), pp. 487-490. Helbing D., Farkas I., Molnar P., Vicsek T.: Simulation of Pedestrian Crowds in Normal and Evacuation

Situations. In Pedestrian and Evacuation Dynamics Conference (February 2001). 2D Cellular Automaton

Burstedde C., Klauck K, Schadschneider A., Zittartz J.: Simulation of pedestrian dynamics using a 2-dimensional cellular automaton. (February 2001).

Burstedde C., Klauck K, Schadschneider A., Zittartz J.: Cellular Automaton Approach to Pedestrian Dynamics. Proceedings from the first Pedestrian and Evacuation Dynamics Conference, 2001. pp. 87-97

Klupfel H. L.: A Cellular Automaton Model for Crowd Movement and Egress Simulation. Dissertation (2003) for the University Duisburg-Essen, Germany.