Queuing steering behavior

In this demonstration, 30 vehicles exhibit queuing behavior as they attempt to leave a large "room" through a narrow "doorway". The queuing results from a steering behavior which produces braking (deceleration) when the vehicle detects other vehicles which are: nearby, in front of, and moving slower than itself. In addition these vehicles are drawn toward the "doorway" by seek behavior, they avoid the gray walls, and maintain separation from each other. A kinematic interpenetration constraint prevents them from overlapping with each other or the walls. In this demonstration, when vehicles exit off the top of the diagram they are randomly repositioned around a half-circle centered below the doorway. Each vehicle's velocity is indicated by a magenta vector, and its steering force is indicated by a blue vector.

From
Steering Behaviors for Autonomous Characters