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 a number 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, and you also can programmatically call the inject() method of this object. 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.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 inject() function calls generation mode is chosen.
long countPeds() - Returns total number of pedestrian arrivals.
long countGroups() - Returns number of created groups (including the group which is currently being created).
int size() - Returns the number of pedestrians in this block.