PedGroupChangeFormation


Causes 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 upper line, chains - in the middle one, fronts in the bottom one.

Demonstration model: Pedestrian Groups

Parameters

Formation
Formation of the group: swarm, front, or chain.
Name: groupFormation  Change value: set_groupFormation(new value)
Valid values: 
   GROUP_FORMATION_SWARM 
swarm
   GROUP_FORMATION_CHAIN
chain  
   GROUP_FORMATION_FRONT
front 
Actions
On enter [code]
Code executed when a pedestrian enters the block.
Local variable: ped - the pedestrian
On exit [code]
Code executed when a pedestrian exits the block.
Local variable: ped - the pedestrian
On formation changes [code]
Code executed right after changing the formation of the group.
Local variables: PedGroup group - the group of pedestrians,
                           PedConstants.GroupFormation formation - new formation.

Functions

long countPeds() - Returns total number of pedestrians passed through this block.

long countGroups() - Returns number of groups passed through this block.

Ports

in
The input port.
out
The output port.