AnyLogic
Expand
Font size

PedEscalator

AnyLogic: The PedEscalator block

The PedEscalator block shows how pedestrians are transported by an escalator or a travelator. The escalator/travelator itself is drawn graphically with the specific space markup shape: escalator group

The escalator typically transports pedestrians to another level. You do not need to add thePedChangeLevel block to simulate the “changing level” operation when pedestrians take escalators, the PedEscalator block automatically moves pedestrians to another level.

Demo model: Escalator Open the model page in AnyLogic Cloud. There you can run the model or download it (by clicking Model source files).

Parameters

Escalators
Here you should choose the space markup shape Escalator Group that graphically defines the escalator(s).
Syntax: EscalatorGroup escalators
Direction
Choose whether the pedestrians take the escalator to go Up or Down. You can select the option using the radio buttons, or switch to dynamic value editor, and specify the expression that will return one of two valid values depending on some external conditions, or pedestrian attributes.
Local variable: ped — the pedestrian
Valid values:
PedEscalator.MOVEMENT_DIRECTION_UP
PedEscalator.MOVEMENT_DIRECTION_DOWN
Escalator choice policy
Here you can choose whether pedestrians should choose the Closest escalator from the specified escalator group, or there is some Custom rule.
Syntax: PedConstants.EscalatorChoicePolicy escalatorChoicePolicy
Change value: set_escalatorChoicePolicy(new value)
Valid values:
PedConstants.EscalatorChoicePolicy.CLOSEST
PedConstants.EscalatorChoicePolicy.CUSTOM
Escalator
[Visible if Escalator choice policy is Custom]
Here you can specify expression returning a specific escalator (from the specified Escalators group) the pedestrians will take. The expression will be dynamically re-evaluated for each pedestrian. It can return different escalators depending on some external conditions, or pedestrian attributes.
Value type: Escalator
Local variable: ped — the pedestrian

Actions

On enter
Code executed when a pedestrian enters the block.
Local variable: ped — the pedestrian
On exit
Code executed when a pedestrian exits the block via out port (in the normal way).
Local variable: ped — the pedestrian
On cancel
Called when a pedestrian exits the block via ccl port (in emergency case).
Local variable: ped — the pedestrian

Functions

int size() Returns the number of pedestrians inside the block.
long countPeds() Returns total number of pedestrians passed through this block.
void cancel(Agent ped) Causes the specified pedestrian to leave the block immediately via ccl port. Applies only if the pedestrian has not entered the escalator yet.
void cancelAll() Causes all pedestrians who have not entered the escalator 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<Agent> getPeds() Returns a non-modifiable collection of pedestrians currently located in this block.

Ports

in

The input port.

out

The output port for pedestrians leaving the block “normally” (being successfully transported by escalator).

ccl

The output port for pedestrians leaving the block because of “cancel” event (caused by a call of either cancel() or cancelAll() function).

How can we improve this article?