Pedestrian API

Pedestrian supports functions that are sufficient for the Pedestrian Library blocks to handle and animate it. You can extend that functionality by creating a custom pedestrian type and defining any functions, parameters and statecharts defining the pedestrian behavior on the diagram of the pedestrian type. You will be able to simply access these fields by specifying your pedestrian type in the Pedestrian type property of Pedestrian Library blocks.

Functions supported by pedestrian of the default type

Every pedestrian provides the following API for working with it programmatically at the model runtime:

double getX() - Returns x-coordinate (in meters) of this pedestrian in the model.

double getY() - Returns y-coordinate (in meters) of this pedestrian in the model.

double getZ() - Returns z-coordinate (in meters) of this pedestrian in the model.

double getTargetX() - Returns x-coordinate (in meters) of the target where this pedestrian moves.

double getTargetY() - Returns y-coordinate (in meters) of the target where this pedestrian moves.

double getTargetZ() - Returns z-coordinate (in meters) of the target where this pedestrian moves.

double getSpeed() - Returns current speed of this pedestrian, in meters per second.

double getComfortableSpeed() - Returns speed this pedestrian is comfortable to go.

void setComfortableSpeed(double comfortableSpeed) - Sets new speed this pedestrian is comfortable to go.

double getDiameter() - Returns diameter of the pedestrian, in meters.

void setDiameter(double diameter) - Sets new diameter of the pedestrian, in meters.

double getRadius() - Returns radius of the pedestrian, in meters.

void setRadius(double radius) - Sets new radius of the pedestrian, in meters.

Ground getGround() - Returns current ground.

PedGroup getGroup() - Returns the group this pedestrian belongs to, or null if this pedestrian isn't grouped.

int getId()- Returns unique identifier for the pedestrian. Returns -1 if pedestrian hasn't yet been added to the pedestrian model environment.