PEDSIM is a microscopic pedestrian crowd simulation library. It is suitable for use in crowd simulations (e.g. indoor evacuation simulation, large scale outdoor simulations), where one is interested in output like pedestrian density or evacuation time. Also, the quality of the individual agent's trajectory is high enough for creating massive pedestrian crowd animations (e.g. for motion pictures or architectural visualization). Since libpedsim is easy to use and extend, it is a good starting point for science projects. See the examples page for example pictures, short movies, and for screenshots.
The PEDSIM library allows you to use pedestrian dynamics in your own software. Based on pure C++ without additional packages, it runs virtually on every operating system. PEDSIM has been developed and tested on Linux. Also supported, but slightly less tested, is Visual Studio on Windows. In the ecosystem directory you find additional parts that use or extend the PEDSIM library. They are meant to give a quick overview of the capabilities, and are starting points for your own experiments. Most of them are built using the Qt Framework, which you'll need to download separately.
The pedestrians are visible on the user interface in real-time. Using the file or network-based output, both batch and real-time processing is possible.
To create video sequences the output of PEDSIM is usually fed into a rendering engine, where realistically looking humans are created. These humans walk based on the trajectories generated by PEDSIM.
See the Code Example further down, and have a look at the full source code, available on the download page.
There is a complete documentation of the classes in the library. It is automatically generated out of the source code. You can access this documentation online here. This same documentation is delivered as PDF file with the library for offline use.
This example shows the very basic usage of the library. No fancy graphics, of course, only text output to the console. This is example01.cpp in the examples folder.
example01.cppand copy-paste the code into it. In the project's Properties, under Linker/Input, add
libpedsim.libin front of the Additional Dependencies list. Click run. Also see Using PEDSIM on Windows.
On a typical linux system, if you are in the libpedsim folder, use this to compile, link and run:
It will create 100 agents, which are placed somewhat randomly distributed around -50/0. They should walk between -100/0 and 100/0. An obstacle (wall) is placed from 0/-50 to 0/50. The agents must walk around that obstacle. That's it, as simple as that: the agents will walk with that little code.
If you want to display some graphics, write a file, or send data over the network, you will get the agent's positions with a->getPosition(). Of course, you can inherit your own classes from Tagent, Tobctacle etc, if you want to have more control. See the Demo App Source for an example.
(c) Christian Gloor [ c|h|g|l|o|o|r|@|s|i|l|m|a|r|i|l|.|o|r|g| ]