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.
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).- Formation
-
Formation of the group: swarm, front, or chain.
Syntax: PedConstants.GroupFormation groupFormation
Set new value dynamically: set_groupFormation(new value)
Valid values:
PedConstants.GroupFormation.SWARM — swarm
PedConstants.GroupFormation.CHAIN — chain
PedConstants.GroupFormation.FRONT — front
- 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
PedConstants.GroupFormation formation — new formation
Function | Description |
---|---|
long countPeds() | Returns total number of pedestrians passed through this block. |
long countGroups() | Returns the number of groups passed through this block. |
- in
-
The input port.
- out
-
The output port.
-
How can we improve this article?
-