AnyLogic
Expand
Font size

PedSettings

The PedSettings block specifies general parameters related to all blocks of the Pedestrian Library and tunes the models for specific tasks in order to get maximum model performance.

Social distancing

With this block, you can enable customizable social distancing between pedestrians. This may come handy when modeling pedestrian flows and service areas during pandemic or when you want to model pedestrian flow in areas with low density of population.

Individual pedestrians

Moving pedestrians will strive to keep the specified social distance between each other unless the density of pedestrians is too high (e.g. in bottle-neck situations). After passing such choke points, pedestrians will resume observing the social distance.

Moving pedestrians do not keep social distance with pedestrians who wait in queues or waiting areas.

Groups

Group members do not keep social distance with each other during movement, in queues, or in waiting areas.

Elevators

Social distancing is not kept when pedestrians are inside an elevator. However, the pedestrians waiting for an elevator, will try to maintain the social distancing.

Queues

Pedestrians in service queues keep social distance if it is enabled. The distance is observed only along the service line. If the curves of serpentine queue are less than the specified social distance, each pedestrian will keep the distance only between themselves and two other pedestrians: in front of them and behind them. The distance between a person inside the service (servicePoint) and the queue is not observed.

Waiting areas

Pedestrians that enter the waiting area and remain there until the waiting period is over will strive to observe social distance with each other if it is enabled. If the density of pedestrians inside the waiting area becomes too high, a new pedestrian that enters the area will ignore the social distance.

Attractors in waiting areas have priority over social distance requirements.

Parameters

Enable social distancing
Selecting this option lets you specify a social distance between pedestrians. They will try to keep it while moving or waiting in area or queue. When moving inside an elevator, or within a group, or moving through the waiting pedestrians, social distance is not maintained.
Syntax: boolean enableSocialDistancing
Default value: true
Social distance
[Visible only if Enable social distancing is enabled]
Here you can specify the distance in meters that pedestrians should keep between each other.
Syntax: double socialDistance
Time step, sec.
[Visible only if Enable social distancing is disabled]
Synchronous model time step. Value should never be equal to 0. Setting this parameter to lower values cause pedestrians to move more precisely, however requires much more performance. Recommended value is 0.3 seconds. If social distance is enabled, model time step automatically equals 0.1 seconds.
Syntax: double timeStep
Allow pedestrian selection by click
If the value of this parameter is true, user may select/deselect a pedestrian by clicking on it.
Syntax: boolean allowPedestrianSelectionByClick
Default value: true

Actions

On pedestrian selected
Code executed when a pedestrian becomes selected. You can select a pedestrian by clicking on his animation shape, or programmatically using the function select(ped) of PedSettings block.
Local variable: Agent ped — the selected pedestrian
On pedestrian deselected
Code executed when pedestrian becomes deselected. You can deselect a pedestrian by clicking anywhere in the presentation, or programmatically using the function deselect(ped) of PedSettings block.
Local variable: Agent ped — the deselected pedestrian
On group assembled
Code executed when pedestrian group is assembled.
Local variable: PedGroup group — the group being assembled
On group disassembled
Code executed when pedestrian group is disassembled.
Local variable: PedGroup group — the group being disassembled
On group leader changed
Code executed when pedestrian group is disassembled.
Local variables:
Agent oldLeader — old leader of the group
Agent newLeader — new leader
PedGroup group — the group
On group formation changed
Code executed when pedestrian group is disassembled.
Local variables:
GroupFormation oldFormation — old group formation
GroupFormation newFormation — new formation
PedGroup group — the group
On group member added
Code executed when pedestrian group is disassembled.
Local variables:
Agent ped — the pedestrian being added to group
PedGroup group — the group
On group member removed
Code executed when pedestrian group is disassembled.
Local variables:
Agent ped — the pedestrian being removed from group
PedGroup group — the group

Functions

Function Description
int countGroups() Returns the number of groups in this model.
int countPeds() Returns total number of pedestrians in this model.
void selectPed(Agent ped) Selects the pedestrian (specified via the function argument) on the animation of the running model.
void deselectPed() Deselects the currently selected pedestrian.
Agent getSelectedPed() Returns the currently selected pedestrian (if some pedestrian is selected at the moment, null otherwise).
Set<Agent> getPeds() Returns a non-modifiable collection of all pedestrians in the model.
Set<PedGroup> getGroups() Returns a non-modifiable collection of all groups in the model.
double pixelsToMeters(double value) Returns a non-modifiable collection of all groups in the model.
double metersToPixels(double value) Converts the specified length in meters to the number of pixels according to the animation scale defined by this block.
How can we improve this article?