AnyLogic 9
Expand
Font size

PedGroupChangeFormation

AnyLogic: The PedGroupChangeFormation block

The PedGroupChangeFormation block causes the group to change its formation to a specified one. The formation is changed when the group leader passes through this block.

The figure below illustrates all supported group formations. Swarms move on the top line, chains on the middle line, fronts on the bottom line.

AnyLogic: The group formations

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

Parameters

Formation
Formation of the group: swarm, front, or chain.
Name: groupFormation
Set new value dynamically: set_groupFormation(new value)
Valid values:
pedGroupFormation.GROUP_FORMATION_SWARM — swarm
pedGroupFormation.GROUP_FORMATION_CHAIN — chain
pedGroupFormation.GROUP_FORMATION_FRONT — front

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.
Local variable: ped — the pedestrian
On formation changes
Code executed right after changing the formation of the group.
Local variables:
PedGroup group — the group of pedestrians
GroupFormation formation — mew formation

Functions

Function Description
long countPeds() Returns total number of pedestrians passed through this block.
long countGroups() Returns the number of groups passed through this block.

Ports

in

The input port.

out

The output port.

How can we improve this article?