Phase 3. Displaying pedestrian density map

We have created the model simulating pedestrian flows inside the subway entrance building. Now we want to get some statistics on the flow. The most powerful tool used in pedestrian simulation is Pedestrian density map.

Display the pedestrian density map

  1. Drag the element  Pedestrian Density Map from the Space Markup section of the palette Pedestrian Library into the graphical editor. The element acts as the color scheme. At the runtime it will show the density map legend. This density map legend helps to understand what colors on the density map mean what values. Legend displays the correspondence between density values and colors on the density map. 

Now you can run the model and observe its behavior.


Density map

You will see that as pedestrians move in the simulated space, the layout is gradually painted in different colors. The color of every point of the space corresponds to the current density in this particular area. The density map is constantly repainted according to the actual values: when the density changes in some point, the color changes dynamically to reflect this change. In case of zero density the area is not painted at all.

The density map is commonly used to detect the areas with critical densities. Red color indicates the critical density (by default it is equal to 1,5 pedestrians/m2). You can change this value in the Pedestrian Density Map's parameter Critical density (shown in red), peds/m2. Blue color is used for low densities. When the density in some area is zero, the density map for this particular area is not drawn at all. The legend shown in the figure above tells us e.g. that yellow color on the map corresponds to the density 0,75 pedestrians/m2.  

By default AnyLogic uses logarithmic color scheme. In this case the color changes logarithmically from the "minimum" (blue) color to the "maximum" (red) color. This color scheme is frequently used when you need to pay attention only to the density values close to the critical value threshold. You can change the logarithmic color scheme to the linear scheme by choosing Linear option in the Pedestrian Density Map parameter Color scheme. It is the simplest color scheme: color changes linearly from the "minimum" color to the "maximum" (red) color. You can even define your own color scheme by choosing the Custom Color scheme and defining the correspondence between colors and density values in the Custom color paremeter of the Pedestrian Density Map

You may notice that even when there are no pedestrians at all in the area, the density map may be drawn there. The reason is that density map may either display maximum observed density values (if attenuation is turned off), or the actual density map for the recent period of time (if attenuation is turned on). By default attenuation is turned on. With the attenuation being turned on, when the density goes down, the color for the corresponding zone on the density map changes correspondingly (but not immediately, with the specified delay). To turn the attenuation on, select the checkbox Enable attenuation in the Pedestrian Density Map properties.

If you are not satisfied with the density map painted over the layout and making it hardly visible, you may increase the transparency level for the density map using the slider Transparency in the Pedestrian Density Map properties. 

You can turn the density map off and only collect the statistics on pedestrian density, without displaying the map on the model animation. To do this, just clear the checkbox Show density map on animation. This way you may make your model simulate faster. You can write statistics to dataset and then export it to some special software for analysis.

The statistics collected by the block Pedestrian Density Map are accessible via the following functions of this block:

double maximumDensity( double x, double y ) -  Returns the maximum observed density value for the point with the specified x and y coordinates, in pedestrians/m2.

double currentDensity( double x, double y ) -  Returns the current density value for the area neighboring the specified point, in pedestrians/m2

Reference model: Subway Entrance Hall - Phase 3

OK, almost everything was said about the pedestrian density map, and we can go on further with adding new logical details in our model.


          Phase 2. Adding fare gates

          Phase 4. Adding ticket vending machines