PedSettings


PedSettings object allows specifying general parameters related to all objects of the Pedestrian Library and allows tuning the models for a specific task in order to get maximum model performance.

Parameters

Time step, sec.
Synchronous model time step. Value should never be equal to 0. Setting this parameter to lower values cause pedestrians to move more precisely, however requires much more performance. Recommended value is 0.3 seconds.
Syntax: double timeStep
Allow pedestrian selection by click
If the value of this parameter is true, user may select/deselect a pedestrian by clicking on it.
Syntax:
 boolean allowPedestrianSelectionByClick
Default value: true
Actions
On pedestrian selected [code]
Code executed when a pedestrian becomes selected. You can select a pedestrian by clicking on his animation shape, or programmatically using the function select(ped) of PedSettings block.
Local variable: Agent ped - the selected pedestrian
On pedestrian deselected [code]
Code executed when pedestrian becomes deselected. You can deselect a pedestrian by clicking anywhere in the presentation, or programmatically using the function deselect(ped) of PedSettings block.
Local variable: Agent ped - the deselected pedestrian
On group assembled [code]
Code executed when pedestrian group is assembled. 
Local variable: PedGroup group - the group being assembled
On group disassembled [code]
Code executed when pedestrian group is disassembled. 
Local variable: PedGroup group - the group being disassembled
On group leader changed [code]
Code executed when pedestrian group is disassembled. 
Local variables: Agent oldLeader - old leader of the group,
                          Agent newLeader - new leader,
             PedGroup
group - the group
On group formation changed [code]
Code executed when pedestrian group is disassembled. 
Local variables: GroupFormation oldFormation - old group formation,
             
GroupFormation newFormation - new formation,
             PedGroup
group - the group
On group member added [code]
Code executed when pedestrian group is disassembled. 
Local variables: Agent ped - the pedestrian being added to group,
             PedGroup
group - the group
On group member removed [code]
Code executed when pedestrian group is disassembled. 
Local variables: Agent ped - the pedestrian being removed from group,
                          PedGroup group - the group

Functions

int countGroups - Returns number of groups in this model.

int countPeds - Returns total number of pedestrians in this model.

void selectPed(Agent ped)
- Selects the pedestrian (specified via the function argument) on the animation of the running model.

void deselectPed() - Deselects the currently selected pedestrian.

Agent getSelectedPed() - Returns the currently selected pedestrian (if some ped is selected at the moment, null otherwise).

Set<Agent> getPeds() - Returns a non-modifiable collection of all pedestrians in the model.

Set<PedGroup> getGroups - Returns a non-modifiable collection of all groups in the model

double pixelsToMeters(double value) - Converts the specified number of pixels to the length in meters according to the animation scale defined by this block.

double metersToPixels(double value)- Converts the specified length in meters to the number of pixels according to the animation scale defined by this block.