Acceleration Behavior

A behavior for calculating an agent's acceleration from a force acting on it. It can limit the resulting acceleration by clamping its linear and angular components.

The AccelerationBehavior has been explained as part of the Hello World 1: Moving Agents code example.

Input Parameters

mass (1-dim)

velocity (n-dim)

force (n-dim)

Output Parameters

acceleration (n-dim)

Internal Parameters

BEHAVIOR_NAME_maxLinearAcceleration (n-dim) default = 0.5

BEHAVIOR_NAME_maxAngularAcceleration (n-dim) default = 0.5

BEHAVIOR_NAME_active (1-dim) default = 1.0


Example

swarm.addBehavior( "accel",
                   AccelerationBehavior( "mass velocity force", "acceleration") );
swarm.set("accel_maxAngularAcceleration", math::Vector<float>( 3, 0.1, 0.1, 0.1 ) );
swarm.set("accel_maxAngularAcceleration", math::Vector<float>( 3, 1.0, 1.0, 1.0 ) );