AnyLogic
Expand
Font size
All Implemented Interfaces:
AggregatableAnimationElement, HasLevel, LevelElement, LevelMarkup, SVGElement, Serializable

public class PedFlowStatistics
extends AbstractLevelMarkup
See Also:
Serialized Form

Constructor Summary

ConstructorDescription
PedFlowStatistics() 
PedFlowStatistics(Agent owner, ShapeDrawMode drawMode, boolean isPublic, double sx, double sy, double ex, double ey, FlowStatisticsDirection direction, Color color)
Deprecated.
deprecated in version 8.4, will be removed in the future releases

Method Summary

Modifier and TypeMethodDescription
booleancontains(double px, double py)
Test if the shape contains the point with the given coordinates (relative to this shape's container, i.e.
longcountPeds()
Returns total number of pedestrians passed through this line
BoundingRectanglegetBoundingRectangle() 
ColorgetColor()
Returns the color of the markup element, or null if markup element has no color
FlowStatisticsDirectiongetDirection()
Returns the current flow direction, for which this element collects statistics.
final doublegetEndX()
Returns the x coordinate of the end point
final doublegetEndY()
Returns the y coordinate of the start point
final doublegetStartX()
Returns the x coordinate of the start point
final doublegetStartY()
Returns the y coordinate of the start point
doubleintensity()
Returns the average pedestrian flow intensity on the line, measured in pedestrians per hour per meter
voidonDestroy() 
voidreset()
Resets the average traffic and intensity.
voidsetColor(Color color)
Sets the color of the markup element.
voidsetDataSource(PedFlowStatisticsDataSource dataSource) 
voidsetDirection(FlowStatisticsDirection direction)
Sets the flow direction, for which this element will collect statistics.
voidsetEndPoint(double x, double y)
Sets the coordinates of the end point
voidsetStartPoint(double x, double y)
Sets the coordinates of the start point
doubletraffic()
Returns the average of traffic flow statistics through the line, measured in pedestrians per hour

Methods inherited from class com.anylogic.engine.markup.AbstractLevelMarkup

getDrawMode, getLevel, setLevel

Methods inherited from class com.anylogic.engine.markup.MarkupShape

error, getFullName, getOutsideLevelZ, getPresentable, getSpace, initialize, isClickHandled, isPublic, onClick, remove, setDrawMode, setOwner

Methods inherited from class java.lang.Object

equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Methods inherited from interface com.anylogic.engine.markup.AggregatableAnimationElement

initializeInternal, onAggregatorVisibilityChanged, postInitialize

Constructor Details

PedFlowStatistics

public PedFlowStatistics()

PedFlowStatistics

@Deprecated
public PedFlowStatistics(Agent owner,
 ShapeDrawMode drawMode,
 boolean isPublic,
 double sx,
 double sy,
 double ex,
 double ey,
 FlowStatisticsDirection direction,
 Color color)
Deprecated.
deprecated in version 8.4, will be removed in the future releases
Parameters:
owner -
drawMode -
isPublic -
sx -
sy -
ex -
ey -
direction -
color -

Method Details

getStartX

public final double getStartX()
Returns the x coordinate of the start point
Returns:
the x coordinate of the start point

getStartY

public final double getStartY()
Returns the y coordinate of the start point
Returns:
the y coordinate of the start point

getEndX

public final double getEndX()
Returns the x coordinate of the end point
Returns:
the x coordinate of the end point

getEndY

public final double getEndY()
Returns the y coordinate of the start point
Returns:
the y coordinate of the start point

setStartPoint

public void setStartPoint(double x,
 double y)
Sets the coordinates of the start point
Parameters:
x - the x coordinate of the start point
y - the y coordinate of the start point

setEndPoint

public void setEndPoint(double x,
 double y)
Sets the coordinates of the end point
Parameters:
x - the x coordinate of the end point
y - the y coordinate of the end point

getDirection

public FlowStatisticsDirection getDirection()
Returns the current flow direction, for which this element collects statistics.
Returns:
Possible values: FLOW_STATISTICS_LEFT, FLOW_STATISTICS_RIGHT, FLOW_STATISTICS_BOTH.

setDirection

public void setDirection(FlowStatisticsDirection direction)
Sets the flow direction, for which this element will collect statistics.
Parameters:
direction - the new direction. Possible values: FLOW_STATISTICS_LEFT, FLOW_STATISTICS_RIGHT, FLOW_STATISTICS_BOTH.

setDataSource

@AnyLogicInternalAPI
public void setDataSource(PedFlowStatisticsDataSource dataSource)

onDestroy

@AnyLogicInternalCodegenAPI
public void onDestroy()

traffic

public double traffic()
Returns the average of traffic flow statistics through the line, measured in pedestrians per hour
Returns:
the traffic, pedestrians per hour

intensity

public double intensity()
Returns the average pedestrian flow intensity on the line, measured in pedestrians per hour per meter
Returns:
the intensity, pedestrians per hour per meter

reset

public void reset()
Resets the average traffic and intensity.

countPeds

public long countPeds()
Returns total number of pedestrians passed through this line
Returns:
total number of pedestrians passed through this line

setColor

public void setColor(Color color)
Sets the color of the markup element.
Parameters:
color - the new color, null = do not draw the markup element

getColor

public Color getColor()
Returns the color of the markup element, or null if markup element has no color
Returns:
the color of the markup element

contains

public boolean contains(double px,
 double py)
Description copied from class: MarkupShape
Test if the shape contains the point with the given coordinates (relative to this shape's container, i.e. in the same system with the coordinates of this shape, x and y)
Specified by:
contains in class MarkupShape
Parameters:
px - the x coordinate relative to this shape's container
py - the y coordinate relative to this shape's container
Returns:
true if the shape contains the point with the given coordinates

getBoundingRectangle

@AnyLogicInternalAPI
public BoundingRectangle getBoundingRectangle()