AnyLogic
Expand
Font size

PedElevator

Simulates how pedestrians are transported by an elevator (lift). The elevator itself is drawn graphically with the specific space markup shape elevator.

Elevator typically transports pedestrians to another level. You do not need to add PedChangeLevel block to simulate the "changing level" operation when pedestrians take elevators, PedElevator block moves pedestrians to another level automatically.

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

Behavior specifics

Behavior at the failure moment

Pedestrians who have entered the block and are currently moving to the elevator, continue their movement and stop nearby it. Waiting can be interrupted by using the block's function cancel(), cancelAll(), or remove().

Pedestrians who are currently boarding the elevator, enter the elevator and wait inside. Waiting can be interrupted by calling the remove() function, if the pedestrian has crossed the elevator border, or cancel(), if has not yet.

Pedestrians who are inside the elevator, continue to reside there. They can be freed using the remove() function.

Pedestrians who have reached the required level and are currently waiting for their turn to leave the elevator, leave the elevator and move further according to their flowchart.

The automatic removal of pedestrians from the block upon the elevator failure is not supported.

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

Behavior at the repair moment

When repaired, an elevator continues its movement in the same direction it was moving before the failure, if any pedestrians inside the elevator have requests to move in this direction. If the elevator does not have any tasks, and at the failure moment it was located between two levels, it moves to the nearest level.

Transferring pedestrian groups

If pedestrians, waiting for an elevator arrival, are members of a pedestrian group, all group members are required to enter the elevator. If an elevator has arrived, and it has enough space for all members of a group, and some members of the group already reached the elevator, the elevator will stay on the level until all the members will gather in the waiting area, and enter the elevator cabin afterwards.

Parameters

Elevator
Here you should choose the space markup shape Elevator that graphically defines the elevator which will be used by pedestrians. It should be set to serve the level where pedestrians are currently located.
Type of value: Elevator
Local variable: ped — the pedestrian
Pedestrian is transferred
Here you can choose the pedestrian transfer mode (how pedestrians will be transferred).
The options are:
automatically — the default option. Pedestrians will be transferred by an elevator automatically, you do not need to setup anything. A pedestrian will leave the elevator when the elevator will reach the target level specified in this block. We advise you to use this transfer mode if the default elevator control system suits you. using elevator API — in this transfer mode pedestrians enter the elevator, leave the elevator, and are transferred by the elevator as the result of calling specific functions of the space markup shape elevator. You may need to switch to the manual control mode only if you require implementing some custom elevator control system.
Possible values:
ElevatorTransferMode.TRANSFER_MODE_AUTOMATIC — automatically
ElevatorTransferMode.TRANSFER_MODE_MANUAL — using elevator API
Default value: ElevatorTransferMode.TRANSFER_MODE_AUTOMATIC — automatically
Local variable: ped — the pedestrian
Target level
[Visible and applies only if the Pedestrian is transferred option is set to automatically]
Level where a pedestrian should be transferred by an elevator. Elevator should be able to serve this level. If the user specifies here the same level where the pedestrian is currently located, the pedestrian will instantly go through the PedElevator block, and will neither call the elevator, nor move to the elevator’s waiting area.
Type of value: Level
Local variable: ped — the pedestrian
Enable exit on timeout
If the option is selected (true), pedestrian's waiting time is limited by the timeout specified in the Timeout property. When the timeout period, set for a pedestrian, elapses, the pedestrian stops waiting and leaves the block through the outTimeout port.
Syntax: boolean enableTimeout
Set new value at runtime: set_enableTimeout(new value)
Timeout
[Visible if the Enable exit on timeout option is enabled]
Expression evaluated to obtain the timeout for the pedestrian. After spending the specified time waiting for the elevator, the pedestrian leaves the block through the outTimeout port.
Type of value: double
Default value: 100 seconds
Local variable: ped — the pedestrian

Actions

On enter
Code executed when a pedestrian enters the block.
Local variable: ped — the pedestrian
On start waiting
Code executed when a pedestrian reaches the point where it will wait for the elevator. If the pedestrian does not stop, the code is not executed.
Local variable: ped — the pedestrian
On enter elevator
Code executed when a pedestrian enters the elevator.
Local variables: ped — the pedestrian
Level level — the level
On exit elevator
Code executed when a pedestrian exits the elevator on the target level.
Local variables: ped — the pedestrian
Level level — the level
On exit
Code executed when a pedestrian exits the block via out port (in the normal way).
Local variable: ped — the pedestrian
On exit (timeout)
[Visible and applies only if the Enable exit on timeout option is set] Code executed when a pedestrian exits the block via outTimeout port upon the specified waiting timeout expiration.
Local variable: ped — the pedestrian
On cancel
Called when the cancel() or cancelAll() function of the block was called, and a pedestrian exits the block via ccl port (in emergency case).
Local variable: ped — the pedestrian
On remove
Called when a pedestrian is intentionally removed from this block by calling the function remove(). This code is automatically executed after the remove() function call.
Local variable: ped — the pedestrian

Functions

Statistics
Function Description
int size() Returns number of pedestrians inside the block.
int elevatorQueueSize() Returns number of pedestrians waiting for the elevator inside the block.
long countPeds() Returns total number of pedestrians passed through this block.
long countPedsTimeout() Returns total number of pedestrians that left this block due to timeout expiration.
Pedestrians in the block
Function Description
Set<Agent> getPeds() Returns a non-modifiable collection of pedestrians currently located in this block.
boolean contains(Agent ped) Returns true if the specified pedestrian is currently inside the block, and false otherwise.
Canceling operation / removing pedestrians
Function Description
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 elevator yet, otherwise raises an error.
void cancelAll() Causes all pedestrians to leave the block immediately via ccl port. Applies only if the pedestrians have not entered the elevator yet, otherwise raises an error.
Agent remove(Agent agent) Removes the specified pedestrian from the block (regardless the current phase of the pedestrian's process) and also removes it from it’s current space (or elevator). Returns null if the pedestrian is not inside the block. The removed pedestrian could be added back to the flowchart with the PedEnter 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).

outT

The output port for pedestrians leaving the block because of timeout expiration.

How can we improve this article?