Simulate physical interactions among pedestrians

Before reading the following explanation you may want to look at the explanation of the cognitive agents and then at how to work with them.

Configuring the physics environment

The simulator is equipped with a special type of Environment named EnvironmentWithDynamics which performs collision detection and response between nodes and with obstacles.

Here’s a minimal configuration of a physics simulation:

Click to show / hide code

It’s also possibile to specify an image path for including obstacles in the environment

Click to show / hide code

Adding nodes to the environment

Nodes added to the EnvironmentWithDynamics are required to have at least a PedestrianProperty, a PhysicalPedestrian and a OccupiesSpaceProperty.

Here’s an example:

Click to show / hide code

Configuring nodes programs

When using the EnvironmentWithDynamics, any suitable Reaction can be used, however, in order to take advantage of the physical micro-interactions between nodes such as avoidance, pushing behavior and falls, derived from the work of Pelechano et al. you need to use the PhysicalBlendedSteering.

Here’s an example:

Click to show / hide code

Updating the physics engine

The EnvironmentWithDynamics internally uses a GlobalReaction called PhysicsUpdate to update nodes positions. By deault this reaction uses a DiracComb with a default rate. If you want, it’s possible to override the reaction with a custom TimeDistribution and update rate.

Here’s some examples:

Click to show / hide code

Click to show / hide code
Click to show / hide code