The 2-dimensional visualizer is a separate application that can be used to visualize the output of a PEDSIM simulation run. It listens on a network socket for update information (agent positions, but also dynamic scene definitions.), which are rendered in real-time. This is perfectly suited to observe stand-allone simulations or optimizations which take a long time to run. Also nice for demonstrations, where the visualizer is installed on the machine connected to the beamer, and the simulation runs on a separate host. Ah and yes, it is able to output png files for each frame, which can be combined into a video easily!
2dvis is built on Qt. If you want to use all the features (especially charts), you need Qt 5.7 or above. It should be possible to compile it using an oder version. However, you will not see the metrics charts in 2dvis then. See documenation for compiling on Linux and Windows.
2dvis is started in network mode, where it listens to incoming data packets on the specified UDP port.
2dvis has the ability to display user-defined metrics coming from the simulation. It can display the latest metrics in numerical form, and also chart the values as line graphs. These two dockable windows are enabled by specifying
--charts respectively on the command line. Note that the charts window needs Qt version 5.7 or above. Otherwise the feature will not be compiled in. Numerical metrics work for all Qt versions.
These metrics are submitted from the simulation using Ped::XMLOutputWriter::writeMetrics(std::unordered_map<std::string, std::string> hash). For example like this:
Here is an example with metrics transmitted:
Instead of a network stream it is also possible to process a XML file containing the messages. This is meant for creating videos. At the moment, 2dvis will try to play all events in full speed, resulting in an overloaded graphics engine. Use it together with the
-o output option only. This mode can be specified using
In order to generate a video sequence out of a PEDSIM run, use these steps:
Find more about mencoder, which is part of the mplayer suite, here.
For example videos, see PEDSIM's YouTube channel.
See here for a list of supported XML tags.
(c) Christian Gloor [ c|h|g|l|o|o|r|@|s|i|l|m|a|r|i|l|.|o|r|g| ]