|
PEDSIM is a simple, microscopic pedestrian crowd simulation system. It
consists, for the time being, of only a small simulation core
and some functions to direct the pedestrians' desire. The
output of the program is some POV-Ray files generated directly
from the main executable (someone needs to separate this eventually),
and a data stream in an XML-like format. This stream can be used to attach
external viewers in order to watch progress of the simulation in real time.
These viewers are available, but are at the moment not under GPL.
This package is suitable for use in crowd
simulation (e.g. evacuation), games, and movies.
At the moment, it will produce a hard-coded animation sequence of some
sword-fighting warriors as an example. If there is enough interest in this
simulation package, I will definitely improve the code in a way
that it becomes more generally usable (e.g. add a user interface). See the examples page for example pictures, a short
movie, and for screenshots.
PEDSIM was initially developed for RedHat Linux (i686) using gcc
3.2.2, and was tested on a Opteron 64bit machine with Fedora Core 1.
It should compile on every POSIX compatible operating system. However,
for windos, you might have to change the networking code. You can download the source code.
There is much more code available than presented here. However,
not all of that code is under the GPL. Please contact me if you are
interested in other software related to this simulation package. Note
that the simulation presented here is very similar to the one used in
our academical
project, but was basically rewritten from scratch.
Therefore, contact me as well if you consider using PEDSIM, since my
future efforts on this GPL'ed project depend on the feedback I get.
Please let me know in which direction this project
should be extended, and for which purpose this could be of interest to
you.
Here follows a small introduction to the technique used in the code of
PEDSIM. Much more about PEDSIM, pedestrian simulations and distributed
computing in general can be found in the book
"Distributed Intelligence in Real-Word Mobility Simulations" by
Christian Gloor, Hartung-Gorre, ISBN 3-86628029-7, available e.g. here (if you can
not order this book, contact
me).
The simulation core takes care of the physical
aspects of the system, such as interaction of the agents with the
environment or with each other. Typical simulation techniques for such
problems are:
- In microscopic simulations, each particle is represented
individually.
- In macroscopic or field-based simulations, particles are
aggregated into fields. The corresponding mathematical models are
partial differential equations, which need to be discretized for
computer implementations.
- It is possible to combine microscopic and field-based methods,
which is sometimes called smooth particle hydrodynamics.
In SPH, the individuality of
each particle is maintained. During each time step, particles are
aggregated to field quantities such as density, then velocities are
computed from these densities, and then each individual particle is
moved according to these macroscopic velocities.
- As a fourth method, somewhat on the side, exist the queuing
simulations from operations research. Here, particles move in a
networks of queues, where each queue has a service rate. Once a
particle is served, it moves into the next queue.
For PEDSIM, we need to maintain individual particles, since
they need to be able to make individual decisions, such as route
choices, throughout the simulation. This immediately rules out
field-based methods. We also need a realistic representation of
inter-pedestrian interactions, which rules out both the queue models
and the SPH models.
For microscopic simulations, there are essentially two techniques:
methods based on coupled differential equations, and cellular automata
(CA) models. In our situation, it is important that agents can move
in arbitrary directions without artifacts caused by the modeling
technique, which essentially rules out CA techniques.
A generic coupled differential equation model for pedestrian movement
is the social force model (by Helbing et al., see here)
where m is the mass of the pedestrian and v its velocity.
v0 is its desired velocity; in consequence, the first term on
the RHS models exponential approach to that desired velocity, with
a time constant tau. The second term on the RHS models
pedestrian interaction, and the third models interaction of the
pedestrian with the environment. The social force model should be
considered as an example on how to model the pedestrian interaction.
It is easy to understand and simple to implement. However, a future
implementation of PEDSIM might use a different model.
Pedestrians interact with each other, which includes avoiding
collisions (short range interaction), and attraction to enemies (long
range, which represents the "will" of the agents. This attraction to
enemies is just an example and should be replaced by some more
complicated and meaningful functions). Also avoidance of objects like
trees is implemented.
|