Escalator


Escalator element is an integral part of the  Escalator Group markup element. It enables you to set the movement direction for an escalator as well as perform other tasks dynamically at runtime using the element's functions (turn the escalator on/off, change its speed, etc.).

Properties

General

Name – The name of the escalator shape. The name is used to identify the escalator and refer to this shape from code.

Ignore – If selected, the shape is excluded from the model.

Visible on upper level – If selected, the shape is also visible on the upper level where this agent lives.

Lock – If selected, the shape is locked. Locked shape does not react to mouse clicks - it is impossible to select it in the graphical editor until you unlock it.

Visible – Here you specify whether the shape is visible on animation at model runtime, or not. Using the control, choose yes or no.

Direction – Sets the escalator steps movement direction (Up or Down). In the graphical editor, you will see that the arrow changes its direction in accordance with the selected option.

Functions

Blocking/unblocking escalator
When you block an escalator, the gate before the escalator gets closed, and no more pedestrians are allowed to enter this escalator.

boolean isBlocked() - Checks whether the escalator is blocked, or not. If the escalator is blocked, the function returns true, otherwise it returns false.

block() - Blocks the escalator. 

unblock() - Unblocks the escalator

Turning escalator on/off
When you turn off an escalator, the escalator power supply stops, so the escalator steps are not moving anymore, but pedestrians can move on their own.

boolean isRunning() - Checks whether the escalator is running, or not. If the escalator is running, the function returns true, returns false otherwise.

turnOff() - Turns the escalator off

turnOn()Turns the escalator on.

setRunning(boolean isRunning)-  Turns the escalator on if isRunning value is true; turns the escalator off otherwise.

Getting/Setting escalator speed

getSpeed() - Returns the speed of the escalator (in meters per second).

getSpeed(SpeedUnits units)Returns the speed of the escalator (in the units passed via the units argument).
Parameter:
SpeedUnits units - one of the AnyLogic speed constants.

setSpeed() - Sets the speed of the escalator (in meters per second).

setSpeed(SpeedUnits units) - Returns the speed of the escalator (in the units passed via the units argument).
Parameter: SpeedUnits units - one of the AnyLogic speed constants.

Movement direction

getMovementDirection() - Returns the current movement direction for the escalator. The possible return values are: EscalatorMovementDirection.UP and EscalatorMovementDirection.DOWN

setMovementDirection(movementDirection)Sets new movement direction for the escalators. You set the new value by passing one of the folowing values as the function argument: EscalatorMovementDirection.UP or EscalatorMovementDirection.DOWN.

Getting the list of pedestrians on the escalator
java.util.List<Agent> getPeds() - Returns the collection of pedestrians currently present on the escalator.