Ped Flow Statistics

Ped Flow Statistics is a graphical markup element that collects statistics on pedestrians crossing the drawn cross-section.

You draw its line on animation, and it will collect statistics on the number of pedestrians crossing this particular line. For example, you can draw the element's line across a corridor, and it will count statistics on pedestrians passing through this corridor.

You can count pedestrians crossing the line either in one particular direction or in both directions (this is configured by the element parameters).

Using the element's traffic()and intensity() functions, you can know the pedestrian traffic and intensity value correspondingly. 

Traffic is calculated as the number of pedestrians that crossed the line in the specified direction during the last hour (in terms of model time). The flow direction is set by the object's parameters.

Intensity is calculated as the traffic value divided by the line length (in meters) and is measured in pedestrians/(hour*meter). 

Demo model: Pedestrian Flow Statistics

 To add Ped Flow Statictics line on the graphical diagram

  1. Drag the  Ped Flow Statictics  element from the Space Markup section of the  Pedestrian Library palette to the graphical diagram.
  2. Place the line as you need by moving its end point with the mouse.

Properties

General

Name – The name of the shape. The name is used to identify and access the shape from code.

Ignore – If selected, the shape is excluded from the model.

Visible on upper level – If selected, the shape is also visible on the upper level where this agent lives.

Visible – Here you specify whether the shape is visible on animation at model runtime, or not. Using the control, choose yes or no.

Direction – Here you can choose the pedestrian movement direction that will be considered while collecting the statistics. You may collect statistics for pedestrians crossing the element's line only to the Left, only to the Right, or crossing it in Both directions. The arrow indicating the chosen direction is drawn in graphical editor to simplify the things for the modeler.

Line color – The line color.

Position and size

Ground– The ground this line belongs to. Here you should specify the name of the ground, that defines the ground where pedestrians move. This element will collect the statistics on the pedestrians moving on this particular ground and crossing the element's line in the specified Direction.

X – X-coordinate of the line (its start point).

Y – Y-coordinate of the line (its start point).

dX – X-offset of the end point regarding the start point of the line.

dY – Y-offset of the end point regarding the start point of the line.

Advanced

Show in - Here you can choose whether you want the shape to be shown both In 2D and 3D animation, or in 2D only, or in 3D only.

Show name – If selected, the shape's name is displayed on the graphical diagram.

Functions

Flow statistics

Function

Description

long countPeds()

Returns the total number of pedestrians passed through the line.

double traffic()

Returns the pedestrian flow traffic value (in pedestrians/hour). Traffic is calculated as the number of pedestrians that crossed the cross section line in the specified direction during the last hour (in terms of model time). The flow direction is set by the object's parameters.

double intensity()

Returns the pedestrian flow intensity, in pedestrians/(hour*meter). The intensity is calculated as the traffic value divided by the line length (in meters).

void reset()

Resets the traffic and intensity values collected by this element.


Flow direction

Function

Description

FlowStatisticsDirection getDirection()

Returns the current flow direction, for which this element collects statistics.

Possible values: FLOW_STATISTICS_LEFTFLOW_STATISTICS_RIGHTFLOW_STATISTICS_BOTH.

void setDirection
(FlowStatisticsDirection direction)

Sets the flow direction, for which this element will collect statistics.

Parameter: direction - the new direction. Possible values: FLOW_STATISTICS_LEFTFLOW_STATISTICS_RIGHTFLOW_STATISTICS_BOTH.


Сolor

Function

Description

Color getColor()

Returns the color of the shape.

void setColor(Color color)

Sets the color of the shape.

Parameter: color - the new color


Visibility

Function

Description

boolean isVisible()

Returns true if the shape is visible; returns false otherwise.

void setVisible(boolean v)

Sets the visibility of the shape.

Parameter: v - visibility. If v is true - the shape is set to be visible, if it is false - not visible.


Ground

Function

Description

Ground getGround()

Returns the ground this space markup shape belongs to.



Related topics

Markup for pedestrian simulation

 Pedestrian density map

 API reference:PedFlowStatistics class