PedGoTo

Causes pedestrians to go to the specified location.

Location can be defined by a target line, a rectangular node or polygonal node, or a point with given coordinates. The pedestrian has to reach a given a given point, or any point of the specified line, or a node. Pedestrians find path to the specified destination within current level.

There are two path choice modes:

Demo model: PedGoTo

Parameters

Mode
Here you can choose the movement mode (Reach target or Follow route). In the first case you specify the destination with a target line, or a network node (rectangular or polygonal), or by specifying the coordinates of the target point. In the second case pedestrians will follow along the specified pathway up to its end.
Get value: mode
Set new value dynamically: set_mode(new value)
Valid values:
pedGoTo.MODE_REACH_TARGET - Reach target
pedGoTo.MODE_FOLLOW_ROUTE - Follow route
Target
Here you can choose whether the movement destination is defined by line, area, or point (x,y). Area is defined by a rectangular node or a polygonal node.
Name: locationType
Change value: set_locationType(new value)
Valid values:
pedGoTo.LOCATION_LINE - target line
pedGoTo.LOCATION_POINT - point in the environment with the given coordinates
pedGoTo.LOCATION_AREA - polygonal node or rectangular node
Target line [dynamic]
[ Visible if Target: line] Target line that defines the movement destination for the pedestrians.
Value type: TargetLine
Local variable: ped - the pedestrian
Area [dynamic]
[Visible if Target: area] Rectangular node or Polygonal node that defines the movement destination for the pedestrians.
Value type: AreaNode
Local variable: ped - the pedestrian
X, Y [dynamic]
[Visible if Target: point (x,y)] X (Y) coordinate of the target point.
Value type: double
Local variable: ped - the pedestrian
Route [dynamic]
[Visible if Mode: Follow route] Pathway that pedestrians should follow.
Value type: Pathway
Local variable: ped - the pedestrian
Walk in reverse direction [dynamic]
If this option is selected (or value is equal to true), pedestrians pass through this service in reverse direction (and the reverse queues are used in this case).
Value type: boolean
Local variable: ped - the pedestrian
Advanced
Reach tolerance, m.
Defines range (in meters), at which pedestrian should enclose to its destination for command to complete. In cases of target line distance to any point of this line is assumed.
Syntax: double reachTolerance
Default value: 0.25
Actions
On enter [code]
Code executed when a pedestrian enters the block.
Local variable: ped - the pedestrian
On exit [code]
Code executed when a pedestrian exits the block via out port (in the normal way).
Local variable: ped - the pedestrian
On cancel [code]
Called when a pedestrian exits the block via ccl port.
Local variable: ped - the pedestrian
On remove [code]
Code executed when a pedestrian is intentionally removed from this block after calling the block's remove() function.
Local variable: ped - the pedestrian

Functions

long countPeds() - Returns total number of pedestrians passed through this block.

int size() - Returns number of pedestrians inside the block.

void cancel(Agent ped) - Causes the specified pedestrian to leave the block immediately via ccl port.

void cancelAll() - Causes all pedestrians to leave the block immediately via ccl port.

boolean contains(Agent ped) - Returns true if the specified pedestrian is currently inside the block, and false otherwise.

Set<t> getPeds() - Returns a non-modifiable collection of pedestrians currently located in this block.

Agent remove(Agent agent) - Removes the specified agent from the block.

Ports

in
The input port.
out
The output port for pedestrians leaving the block "normally" after the successful completion of the command.
ccl
The output port for pedestrians leaving the block because of "cancel" event (caused by a call of either cancel() or cancelAll() function).