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
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 –
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.
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.
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
pedestrian flow intensity, in pedestrians/(hour*meter). The intensity
is calculated as the traffic value divided by the line length (in
void reset()- Resets the traffic and intensity values collected by this element.