PedEnter


Accepts pedestrians generated somewhere (e.g. in some other pedestrian flowchart, that the pedestrians exited via PedExit block) at input port, assigns their physical parameters and injects pedestrians into the simulated environment at specified location. 

This object also can be used to organize groups from sequence of pedestrians on input port. Allows defining multiple criteria for groups creation - group size, form, groups arrival rate, pedestrians interarrival delay, etc.

Also, this object can be used to change pedestrian parameters like speed, color, diameter, etc.

Parameters

Appears at
Here you choose whether you define the place where pedestrians appear with a line, point, or area.
Get value: locationType
Set new value dynamically: set_locationType()
Default value: PedEnter.LOCATION_LINE
Valid values: PedEnter.LOCATION_LINE
                     PedEnter.LOCATION_POINT
                     PedEnter.LOCATION_AREA
Target line [dynamic]
[ Visible if Appears at line ] Target line, where pedestrians appear.
Value type: TargetLine
Local variable: ped - the pedestrian
Ground [dynamic]
[ Visible if Appears at point (x,y) ] Ground, where pedestrians appear.
Value type: Ground
Local variable: ped - the pedestrian.
X, Y [dynamic]
[ Visible if Target is point (x,y) ] X (Y) coordinate of the point where pedestrians appear. 
Value type: double
Local variable: ped - the pedestrian
Area [dynamic]
[ Visible if Appears at area ] Area where pedestrians appear.
Value type: AreaNode
Local variable: ped - the pedestrian
Comfortable speed [dynamic]
Speed which is comfortable for the pedestrian. In the absence of external factors pedestrian will move with this speed.
Value type: double
Default value: uniform(0.5,1) meters per second
Local variable: ped - the pedestrian.
Initial speed [dynamic]
Initial speed of the pedestrian.
Value type: double
Default value: uniform(0.3, 0.7) meters per second
Local variable: ped - the pedestrian.
Diameter [dynamic]
Diameter of the pedestrian.
Value type: double
Default value: uniform(0.4, 0.5) meters
Local variable: ped - the pedestrian.
Groups
Create groups
If the checkbox is selected, this block will create groups of pedestrians.
Syntax: boolean createGroups
New group is created 
[Visible if Create groups is selected] Defines how groups are created: whether a group is created when the specified group size is reached (on size reached), or when the specified timeout expires (on timeout), or when delay between pedestrian arrivals exceeds the specified gap value (on time gap).
Get value: groupingMode  Change value: set_groupingMode(new value)
Valid values: PedEnter.GROUPING_MODE_SIZE_REACHED
           PedEnter.GROUPING_MODE_TIMEOUT
           PedEnter.GROUPING_MODE_TIME_GAP
Group size [dynamic]
[Visible if Create groups is selected and New group is created on size reached] Size of newly created group (number of pedestrians making up one group).
If you leave the default value here, groups containing 2 and 3 pedestrians will be created with equal probabilities. 
Value type: int
Default value: uniform_discr( 2, 3 )
Local variable:  leader - the leader of the group
Group assembly time [dynamic]
[Visible if Create groups is selected and New group is created on timeout] Time given for group creation. When this timeout elapses, the group creation is finished and next group starts forming.
Value type: double
Maximum gap between members [dynamic]
[Visible if Create groups is selected and New group is created on time gap] Maximum pedestrian interarrival time, for them to be collected in one group. In case pedestrian interarrival time exceeds this value, new group is created.
Value type: double
Default value: seconds
Group formation
[Visible if Create groups is selected] Form of the group: swarm, front, or chain.
Get value: groupFormation  Change value: set_groupFormation(new value)
Valid values: 
   GROUP_FORMATION_SWARM 
swarm
   GROUP_FORMATION_CHAIN
chain  
   GROUP_FORMATION_FRONT
front 
Group behavior in services
[Visible if Create groups is selected] Here you can define how the groups of pedestrians created by this object behave while passing the services (if some other behavior is not defined in the object PedService).
All group members are serviced individually - Each member of the group should be serviced individually. The example of such a service: turnstiles. 
Only one group member is serviced, others wait in a queue - The example: a family buying cinema tickets at the counter. All the family members wait in a queue to choose the seats together, but only one of them - the head of the family pays and gets serviced.
Only one group member is serviced, others wait in a waiting area - The example: a tourist group buying museum tickets. The tourists do not wait in the queue, they just wait for their tour guide to buy the tickets for the whole group. The waiting area in this case is defined with PedArea object. The name of this area should be specified in the Waiting area (PedArea) of the PedService object defining this particular service.
Get value: serviceGroupBehavior  Change value: set_serviceGroupBehavior(new value)
Valid values: PedEnter.SGB_INDIVIDUAL_SERVING
           PedEnter.SGB_ONE_MEMBER_IS_SERVED_OTHERS_WAIT_IN_QUEUE
           PedEnter.SGB_ONE_MEMBER_IS_SERVED_OTHERS_WAIT_IN_AREA
Cancelling a ped cancels the group
[Visible if Create groups is selected] If the checkbox is selected (true), canceling command for one pedestrian will cancel it for all pedestrians from his group. 
Syntax: boolean solidCancelling
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 begin grouping [code]
Code executed when the first member of a new group enters the object.
Local variables: leader - the leader of the current group
             PedGroup group - the group being currently created.
On end grouping [code]
Code executed when the group assembly is finished.
Local variables: leader - the leader of the current group
             PedGroup group - the just assembled group 

Functions

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

long countGroups() - Returns number of created groups (including the group which is currently being created).

int size() - Returns number of pedestrians that are currently inside the block.

Ports

in
The input port.
out
The output port.