
Generates pedestrians. Is usually used as a starting point of the pedestrian flow. Can produce pedestrians of a custom pedestrian type with arbitrary flow intensity.
This block also can be used to generate groups of pedestrians. Allows defining multiple criteria for groups creation — group size, form, groups arrival rate, pedestrian interarrival delay, etc.
There are multiple of ways to define when and how many pedestrians (or groups of pedestrians) should be generated. You can use:
- arrival rate (and change it dynamically by calling set_rate())
- interarrival time
- rate defined by a schedule
- schedule of exact arrival times and quantities
- inject() method of this block
For example, a Poisson steam of arrivals can be implemented by choosing arrivals with a certain rate, or by specifying the exponentially distributed interarrival time.
You can also set the number of pedestrians in each arrival and limit the total number of arrivals.
If interarrival time is used and it occasionally evaluates to infinity, the PedSource stops generating pedestrians and will never resume. If rate is used and it becomes 0, no next arrival will be scheduled until the rate changes to a positive value.
To generate pedestrians with custom animation or attributes, create a new pedestrian type and select it in the New pedestrian parameter.
- Appears at
-
Here you choose whether you define the place where pedestrians appear with a target line, point (x, y) with specified coordinates, or node (Rectangular node or Polygonal node).
Name: locationType
Type: PedConstants.LocationType
Valid values:
PedSource.LOCATION_LINE — line
PedSource.LOCATION_POINT — point (x, y)
PedSource.LOCATION_NODE — node -
[Visible if Appears at line]
Target line, where pedestrians appear.Type: TargetLine
Local variable: ped — the pedestrian -
[Visible if Appears at point (x, y)]
Level, where pedestrians appear.Type: Level
Local variable: ped — the pedestrian -
[Visible if Target is point (x, y)]
X-coordinate of the point where pedestrians appear.Type: double
Local variable: T ped — the pedestrian -
[Visible if Target is point (x, y)]
Y-coordinate of the point where pedestrians appear.Type: double
Local variable: T ped — the pedestrian -
[Visible if Appears at node]
Rectangular node or polygonal node where pedestrians appear.Type: AreaNode
Local variable: T ped — the pedestrian - Arrive according to
-
Specifies the mode of pedestrians (or groups of pedestrians, if the Create groups option is selected) generation. The available modes are:
Rate — pedestrians are generated at the specified arrival rate (which is equivalent to exponentially distributed interarrival time with mean = 1/rate).
Interarrival time — the time between two subsequent ped arrivals is defined by the specified expression (use this option to generate pedestrians with e.g. regular intervals or with non-exponential interarrival times).
Rate schedule — pedestrians are generated using rate schedule — a schedule defining how the arrival rate changes with time.
Arrival schedule — pedestrians are generated using arrival schedule — a schedule defining how many pedestrians should be generated at particular moments of time.
Calls of inject() function — pedestrians are not generated automatically and are only generated on calls of inject() method.Name: arrivalType
Type: PedConstants.ArrivalType
Set new value at runtime: set_arrivalType()
Valid values:
PedSource.RATE — Rate
PedSource.INTERARRIVAL_TIME — Interarrival time
PedSource.RATE_SCHEDULE — Rate schedule
PedSource.ARRIVAL_SCHEDULE — Arrival schedule
PedSource.MANUAL — Calls of inject() function - Arrival rate
-
[Visible if Arrive according to: Rate]
Rate of pedestrian (or groups of pedestrians, if the Create groups option is selected) arrivals in terms of pedestrians (groups) per selected time unit.Name: rate
Type: double
Default value: 1000 per hour
Set new value at runtime: set_rate(new value) -
[Visible if Arrive according to: Interarrival time]
Expression used to evaluate the interarrival time for each pedestrian (or a group of pedestrians, if the Create groups option is selected) in distribution based generation mode.Type: double - Rate schedule
-
[Visible if Arrive according to: Rate schedule]
The name of the schedule defining how the arrival rate of pedestrians (or groups of pedestrians, if the Create groups option is selected) changes with time.Name: rateSchedule
Type: Schedule
Set new value at runtime: set_rateSchedule(new value) - Modify rate
-
[Visible if Arrive according to: Rate schedule]
If selected, you can modify the rate value from the rate schedule with the expression specified in the field below Rate expression.Name: modifyRate
Type: boolean
Set new value at runtime: set_modifyRate(new value) -
[Visible, if Modify rate is enabled]
Here you can specify the expression to modify rate. The current rate schedule value is available as baseRate.Type: double
Local variable: double baseRate — rate schedule value - Arrival schedule
-
[Visible if Arrive according to: Arrival schedule]
The name of the schedule defining how many pedestrians (or groups of pedestrians, if the Create groups option is selected) should be generated at particular moments of time.Name: arrivalSchedule
Type: Schedule<Integer>
Set new value at runtime: set_arrivalSchedule(new value) - Limited number of arrivals
-
If the checkbox is selected (true), the number of pedestrians (or groups of pedestrians, if the Create groups option is selected) generated by this block is limited with the Maximum number of arrivals.
Name: limitArrivals
Type: boolean
Set new value at runtime: set_limitArrivals(new value) - Maximum number of arrivals
-
[Visible if Limited number of arrivals is selected]
The maximum number of pedestrian (or groups of pedestrians) arrivals.Name: maxArrivals
Type: int
Default value: 1000
Set new value at runtime: set_maxArrivals(new value)
-
Type of pedestrian to generate. If you want to generate pedestrians with custom animation or attributes, create a custom pedestrian type, and set this PedSource generate pedestrians of this type by selecting the pedestrian type name from this list.
Default value: Agent
-
Speed which is comfortable for the pedestrian. In the absence of external factors pedestrian will move with this speed.
Type: double
Default value: uniform(0.5, 1) meters per second
Local variable: T ped — the pedestrian -
Initial speed of the pedestrian in meters per second.
Type: double
Default value: uniform(0.3, 0.7) meters per second
Local variable: T ped — the pedestrian -
Diameter of the pedestrian. Defines how wide are people generated by the block. The value defines the diameter of the default pedestrian’s animation shape (which is shown if you have not specified any custom pedestrian type with custom animation in the New pedestrian property).
In pedestrian movement algorithm calculations, this value represents the width of the pedestrian. The default value (40-50 centimeters) corresponds to the average shoulder width, so we strongly recommend you avoid changing it. If you set a significantly higher value, the pedestrians will be unable to fit into doors, serpentine queues, and so on, and the model will quit with an error.Type: double
Default value: uniform(0.4, 0.5) meters
Local variable: T ped — the pedestrian
- Create groups
-
If the checkbox is selected, this block will create groups of pedestrians.
Name: createGroups
Type: boolean
Set new value at runtime: set_createGroups(new value) -
[Visible if Create groups is selected]
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.Type: int
Default value: uniform_discr(2, 3)
Local variable: T leader — the group leader -
[Visible if Create groups is selected]
Interarrival time between pedestrians making up one group.Type: double
Default value: exponential(3) seconds - Group formation
-
[Visible if Create groups is selected]
Formation of the group: swarm, front, or chain.Name: groupFormation
Type: PedConstants.GroupFormation
Set new value at runtime: set_groupFormation(new value)
Valid values:
PedSource.GROUP_FORMATION_SWARM — swarm
PedSource.GROUP_FORMATION_CHAIN — chain
PedSource.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 block behave while passing the services (if some other behavior is not defined by Service with lines shape).All group members are serviced individually — Each member of the group should be serviced individually. The example of such a service: turnstiles.
Only one 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 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.Name: serviceGroupBehavior
Type: PedConstants.ServiceGroupBehaviorType
Set new value at runtime: set_serviceGroupBehavior(new value)
Valid values:
PedSource.SGB_INDIVIDUAL_SERVING — All group members are serviced individually
PedSource.SGB_ONE_MEMBER_IS_SERVED_OTHERS_WAIT_IN_QUEUE — Only one member is serviced, others wait in a queue
PedSource.SGB_ONE_MEMBER_IS_SERVED_OTHERS_WAIT_IN_AREA — Only one member is serviced, others wait in a waiting area - Cancelling a pedestrian 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.Name: solidCancelling
Type: boolean
Set new value at runtime: set_solidCancelling(new value)
- Add pedestrian to
-
Here you specify where the pedestrians created by this block will be stored: default population of root agent, or in some custom population (specified below in the Population property). The default population (Java collection of type AgentList<Agent> ) contained in the top-level agent can be accessed with the function getDefaultPopulation().
Name: addToCustomPopulation
Type: boolean
Default value: false — default population of root agent
Set new value at runtime: set_addToCustomPopulation(new value) -
[Visible if Add pedestrian to: custom population]
The name of the population to add pedestrians to.Type: AgentList<T>
Local variable: T ped — the pedestrian
- On exit
-
You can type here Java code to be executed when a pedestrian exits the block.
Local variable: T ped — the pedestrian
- On begin grouping
-
[Visible if Create groups is selected]
You can type here Java code executed when the first member of a new group enters the block.Local variables:
PedGroup group — the pedestrian group
T leader — the leader of the group - On end grouping
-
[Visible if Create groups is selected]
You can type here Java code executed when the group assembly is finished.Local variables:
PedGroup group — the pedestrian group
T leader — the leader of the group
| Function | Description |
|---|---|
| void inject() | Inserts a single pedestrian/group (depending on the mode of this block) into simulated environment. Is applicable only when Calls of inject() function generation mode is chosen. |
| void inject(int count) | Inserts the specified number (n) of pedestrians/groups (depending on the mode of this block) into simulated environment. Is applicable only when Calls of inject() function generation mode is chosen. |
| long countPeds() | Returns the total number of pedestrian arrivals. |
| long countGroups() | Returns the number of created groups (including the group which is currently being created). |
| int size() | Returns the number of pedestrians in this block. |
- out
-
The output port.
-
How can we improve this article?
-