crowd simulation i

Post on 24-Feb-2016

62 Views

Category:

Documents

1 Downloads

Preview:

Click to see full reader

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

CROWD SIMULATION IIntroduction 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 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

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.

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.

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.

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

Disney’s Lion King (1994).

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.

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

Paths of pedestrian exploration driven byspace syntax architectural concepts.

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.

FLOCKING

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.

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?

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.

Flocking – Geometry in Flight (2)

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.

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.

Flocking – Steering Behaviors (2) Separation

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

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.

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.

Flocking – Boid Brain Each steering behavior may yield a

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

arbitrates between potentially conflicting urges.

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.

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.

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.

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).

SOCIAL FORCES

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.

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.

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

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.

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.

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.

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.

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:

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

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

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)

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

observed with these equations: Lane Formation Door Oscillation

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.

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.

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.

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.

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.

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

Social Forces ’00 – Simulations Corridor widening can lead to

bottlenecks:

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

exits:

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.

Social Forces – More Results (2)

Suggestions for improved motion. Environments

more conducive to efficient motion are shown on the right.

Social Forces – More Results (3)

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

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.

2D CELLULAR AUTOMATA

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.”

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.

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.

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.

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.

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.

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.

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

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

This region.

2D Cellular Automata – Movement (3)

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)

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)

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)

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.

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.

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).

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.

2D Cellular Automata – Dynamic Field (3)

Dynamic Field In Action

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.

2D Cellular Automata – Simulations Lane Formation

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

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

2D Cellular Automata – Simulations (3) Door Oscillation

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

break-throughs

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

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

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

evacuation.

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.

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.

top related