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:
It’s also possibile to specify an image path for including obstacles in the environment
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:
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:
Updating the physics engine
The EnvironmentWithDynamics hosts a
PhysicsUpdate Reaction
that updates the positions of the nodes.
As every reaction hosted by the environment rather than by a node,
it is declared among the global-programs of the environment.
By default, this reaction uses a DiracComb
with a default rate.
Declaring a PhysicsUpdate among the global programs replaces the
default one, allowing for a custom update rate or TimeDistribution.
Here’s some examples: