Emergent Crowd Grouping via Heuristic Self-Organization

Xiao-Cheng Liao, Wei-Neng Chen§∗, Xiang-Ling Chen§ and Yi Mei Centre for Data Science and Artificial Intelligence & School of Engineering and Computer Science,
Victoria University of Wellington, Wellington, New Zealand
§School of Computer Science and Engineering, South China University of Technology, Guangzhou, China{xiaocheng, yi.mei}@ecs.vuw.ac.nz, §cschenwn@scut.edu.cn, §linger.xlchen@gmail.com
Abstract.

Modeling crowds has many important applications in games and computer animation. Inspired by the emergent following effect in real-life crowd scenarios, in this work, we develop a method for implicitly grouping moving agents. We achieve this by analyzing local information around each agent and rotating its preferred velocity accordingly. Each agent could automatically form an implicit group with its neighboring agents that have similar directions. In contrast to an explicit group, there are no strict boundaries for an implicit group. If an agent’s direction deviates from its group as a result of positional changes, it will autonomously exit the group or join another implicitly formed neighboring group. This implicit grouping is autonomously emergent among agents rather than deliberately controlled by the algorithm. The proposed method is compared with many crowd simulation models, and the experimental results indicate that our approach achieves the lowest congestion levels in some classic scenarios. In addition, we demonstrate that adjusting the preferred velocity of agents can actually reduce the dissimilarity between their actual velocity and the original preferred velocity. Our work is available online111https://pypi.org/project/pyfollower/.

Crowd simulation, multi-agent system, emergent behavior, collision avoidance, robotics control
*Wei-Neng Chen is the corresponding author.
ccs: Computing methodologies Agent / discrete modelsccs: Computing methodologies Real-time simulation
Refer to caption
Figure 1. A classic scenario where 100 agents are distributed evenly on a circle, and their destination is to navigate to the antipodal position on the circle. In contrast to the severe trajectory oscillations produced by the Dutra method (dutra2017gradient, ) at agent meeting area and the congestion with slow movement generated by the implicit crowd (karamouzas2017implicit, ) in the same locations, our method achieved organized motion, realizing congestion-free scenarios. Due to the symmetry in the motion of all agents, they self-organize into the same group, moving in the “same direction” (clockwise rotation).

1. Introduction

Large multi-agent systems, such as the real-time simulation of human crowds, are important tasks in games (colas2022interaction, ; wolinski2014parameter, ), animation (gustafson2016mure, ; zhang2023orcanet, ) and visual effects (kanyuk2015headstrong, ; van2021algorithms, ; hu2021heterogeneous, ). In the realm of crowd simulation studies, the classification typically involves two categories: flow-based, wherein the entire crowd is conceptualized as a substance with fluid-like characteristics, and agent-based, where each individual of the crowd is represented as an intelligent agent. The focus of this work is specifically on microscopic approaches, delving into the intricacies of addressing the crowd simulation problem at the individual scale. This work focuses on agent-based approaches that generate crowd dynamics from the micro perspective of individuals.

In agent-based methods, the primary focus is to model local interactions among agents which specifies how the movement of each agent is impacted by the presence of neighboring agents and obstacles. Subsequently, macroscopic collective behaviors emerge through the microscopic interactions among individuals. Amidst various modeling considerations, a significant portion (van2020generalized, ; van2011reciprocal, ; lee2018crowd, ) is dedicated to addressing collision avoidance. Typically, a local navigation algorithm needs to calculate a velocity for an agent at a given moment, enabling it to navigate its path safely around other nearby agents and obstacles without collisions. In many modern techniques for procedural animation of intelligent systems and crowd dynamics, this local navigation algorithm could be optimizing a cost or energy function (karamouzas2017implicit, ), performing low-dimensional linear programming under the constraint of velocity obstacles (fiorini1998motion, ; van2008reciprocal, ) and leaning to interact with agents(charalambous2023greil, ; talukdar2023learning, ; lee2018crowd, ; kwiatkowski2023reward, )

In addition to the necessary collision avoidance characteristics, human crowds usually display a rich variety of self-organized behaviors that support efficient motion under everyday conditions (moussaid2011simple, ). One of the best-known examples is the spontaneous formation of uni-directional lanes in bi-directional pedestrian flows (helbing1995social, ). This intricate ability of crowds to self-organize has not only practical implications for everyday scenarios but also holds promise for optimizing crowd flow in controlled environments.

Group dynamics modeling is an effective crowd organizing method that reduces internal conflicts among crowds by organizing individuals into groups (gorrini2014empirical, ; li2017grouping, ; nicolas2023social, ). Existing crowd simulation methods for modeling group behaviors often require explicit grouping or the establishment of heterogeneous leaders. Previous research on modeling group behavior has predominantly focused on cohesive motion or spatial structures within the crowd. Fundamental algorithms involve clustering agents into predefined groups, with each group maintaining a constant size (static grouping) (bruneau2015going, ; tang2023crowd, ). However, these methods fall short in capturing the evolving sizes of groups, dividing large crowds into subgroups, or merging smaller groups into larger ones (he2016dynamic, ). Therefore, how to produce group dynamics via self-organization need further exploration.

In response to this limitation, this work proposes a method to facilitate the spontaneous emergence of group dynamics in crowds. The primary objective of this paper is to facilitate the emergence of self-organizing phenomena by adjusting the preferred velocity of agents, thereby improving the efficiency of crowd movement. In terms of collision avoidance, Optimal Reciprocal Collision Avoidance (ORCA) (van2011reciprocal, ) is employed as the underlying model, where the preferred velocity is a crucial variable compared to other collision avoidance models. Our approach enables agents with similar forward directions to implicitly organize into groups. As agents move, changes in their positions result in individuals diverging automatically from the group when their target directions deviate. The formation, merging, splitting, and redistribution of these implicit groups are spontaneously driven by interactions among agents. This paper achieves the emergence of automatic implicit grouping behavior in crowds through a bottom-up approach, potentially offering a novel perspective in the realm of crowd simulation. The main contributions of this paper are as follows:

  1. (1)

    Focusing on promoting the emergence of group dynamics, this paper proposes a method that allows agents to make slight adjustments to their preferred velocity in the direction based on the surrounding information. This enables the crowd to autonomously generate implicit groups, which can reduce internal conflicts among intelligent agents experiencing significant disparities in movement directions.

  2. (2)

    The proposed method is compared with many agent-based crowd models, including the state-of-the-art method, implicit crowd (karamouzas2017implicit, ), a crowd simulation model that utilizes implicit integration to produce highly smooth trajectories while maintaining strong robustness. Experimental results indicate that the proposed method performs better than compared algorithms in terms of crowd congestion level and the alignment between preferred velocity and actual velocity.

  3. (3)

    We encapsulated our method into a Python package, accessible via the Pip package management tool. This facilitates easy integration and usage for researchers seeking to apply the developed approach in their work.

2. Background

2.1. Related Work

Social Force model (helbing1995social, ) is one of the earliest proposed models for simulating crowd dynamics. Each agent in this model is influenced by surrounding agents and obstacles. This influence is defined as virtual physical forces, and, therefore, the movement of agents can be calculated based on principles of mechanics. The concept of Velocity Obstacle (VO) space, denoting the velocities of an agent that would result in a collision between the agent and an obstacle or another agent at some future time, was introduced in (fiorini1998motion, ). Therefore, collision avoidance can be transformed into a linear programming problem, considering velocity obstacles with respect to other agents or obstacles. Numerous subsequent studies, building upon the concept of VO, have been proposed. Rather than opting for a new velocity outside the velocity obstacle of the other agent in VO method, Reciprocal Velocity Obstacle (RVO) (van2008reciprocal, ) selects a different velocity by averaging its current velocity with a velocity positioned outside the velocity obstacle of the other agent. Compared to the original VO method, RVO can generate safer and smoother trajectories. The formulation of RVO can only guarantee collision-free in certain specific conditions and Optimal Reciprocal Collision Avoidance (ORCA) was proposed to provide a sufficient condition for multiple agents to avoid collision (van2011reciprocal, ). Some studies (karamouzas2009predictive, ; karamouzas2014universal, ) also use the notion of time to collision to achieve collision avoidance and describe human interactions. Vision information was also useful in agent-based crowd simulation and was explored in many studies (ondvrej2010synthetic, ; hughes2015davis, ; dutra2017gradient, ). In these methods, each agent movement can be calculated by evaluating the future collisions based on the time to collision, time to closet approach or distance of closest approach of each pixel. Karamouzas et al. (karamouzas2017implicit, ) presented an optimization integrator named "Implicit Crowds," tailored to harmonize with nonlinear, anticipatory forces, and physics-based animation in multi-agent systems. Through the incorporation of dissipation functions, this approach demonstrates insensitivity to parameters and achieves the generation of remarkably smooth and collision-free trajectories for crowd movement. In recent years, with the continuous increase in computational power, some researchers tried to use machine learning (alahi2016social, ; zhong2022data, ; hu2021heterogeneous, ; kwiatkowski2023reward, ) to discover crowd behavior patterns and employ reinforcement learning (lee2018crowd, ; talukdar2023learning, ; charalambous2023greil, ) to explore interaction strategies within crowds. The above algorithms effectively model crowds and are sufficient to reproduce many known crowd phenomena. However, limited attention has been given to how the emergence of self-organizing phenomena in crowds can be facilitated through the local interactions of agents.

There is also some research on group dynamics. Bruneau et al.(bruneau2015going, ) studied collision avoidance among predefined and fixed pedestrian groups. Tang et al. (tang2023crowd, ) group individuals via machine learning methods. Dynamic grouping (he2016dynamic, ) was also explored to introduce a process for maintaining and updating groupings within the crowd after agents update their positions and velocities. Despite these efforts, many real-world scenarios involve crowds exhibiting spontaneous cooperative behaviors, such as the emergence of channeling effects, without explicit grouping and criteria for grouping. Further investigation is required into the emergence of crowd grouping.

2.2. Agent-based Crowd Simulation

In the setting of agent-based crowd simulation, the task involves navigating N𝑁Nitalic_N agents to their individual destinations while avoiding collisions with other agents or obstacles. These agents traverse a two dimensional plane and are commonly depicted as discs with radii r𝑟ritalic_r. The simulation includes a loop with frames of a fixed duration ΔtΔ𝑡\Delta troman_Δ italic_t. At the simulation time step t𝑡titalic_t, the state of agents can be characterized by three 1×N1𝑁1\times N1 × italic_N matrixes:

(1) 𝐗t=[𝐱1t,𝐱2t,,𝐱it,,𝐱Nt]superscript𝐗𝑡superscriptsubscript𝐱1𝑡superscriptsubscript𝐱2𝑡superscriptsubscript𝐱𝑖𝑡superscriptsubscript𝐱𝑁𝑡\displaystyle\mathbf{X}^{t}=\left[\mathbf{x}_{1}^{t},\mathbf{x}_{2}^{t},\cdots% ,\mathbf{x}_{i}^{t},\cdots,\mathbf{x}_{N}^{t}\right]bold_X start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT = [ bold_x start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT , bold_x start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT , ⋯ , bold_x start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT , ⋯ , bold_x start_POSTSUBSCRIPT italic_N end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT ]
(2) 𝐕t=[𝐯1t,𝐯2t,,𝐯it,,𝐯Nt]superscript𝐕𝑡superscriptsubscript𝐯1𝑡superscriptsubscript𝐯2𝑡superscriptsubscript𝐯𝑖𝑡superscriptsubscript𝐯𝑁𝑡\displaystyle\mathbf{V}^{t}=\left[\mathbf{v}_{1}^{t},\mathbf{v}_{2}^{t},\cdots% ,\mathbf{v}_{i}^{t},\cdots,\mathbf{v}_{N}^{t}\right]bold_V start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT = [ bold_v start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT , bold_v start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT , ⋯ , bold_v start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT , ⋯ , bold_v start_POSTSUBSCRIPT italic_N end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT ]
(3) 𝐏t=[𝐩1t,𝐩2t,,𝐩it,,𝐩Nt]superscript𝐏𝑡superscriptsubscript𝐩1𝑡superscriptsubscript𝐩2𝑡superscriptsubscript𝐩𝑖𝑡superscriptsubscript𝐩𝑁𝑡\displaystyle\mathbf{P}^{t}=\left[\mathbf{p}_{1}^{t},\mathbf{p}_{2}^{t},\cdots% ,\mathbf{p}_{i}^{t},\cdots,\mathbf{p}_{N}^{t}\right]bold_P start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT = [ bold_p start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT , bold_p start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT , ⋯ , bold_p start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT , ⋯ , bold_p start_POSTSUBSCRIPT italic_N end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT ]

where each 𝐱itsuperscriptsubscript𝐱𝑖𝑡\mathbf{x}_{i}^{t}bold_x start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT,𝐯itsuperscriptsubscript𝐯𝑖𝑡\mathbf{v}_{i}^{t}bold_v start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT,𝐩itsuperscriptsubscript𝐩𝑖𝑡\mathbf{p}_{i}^{t}bold_p start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT represent the position, velocity, and preferred velocity of agent Aisubscript𝐴𝑖A_{i}italic_A start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT at time step t𝑡titalic_t, respectively.

The preferred velocity signifies the direction in which the agent intends to move forward. In its most basic form, the preferred velocity for each agent is represented as a vector starting from the agent’s current position and pointing towards a local destination. Its magnitude is equal to a user-specified preferred speed Sprefsubscript𝑆𝑝𝑟𝑒𝑓S_{pref}italic_S start_POSTSUBSCRIPT italic_p italic_r italic_e italic_f end_POSTSUBSCRIPT.

Typically, a global path planner is assumed to operate outside local navigation, calculating a global path for each agent in the scenario. This path can be decomposed into multiple local destinations. Then, at each simulation time step t𝑡titalic_t, the preferred velocities 𝐕tsuperscript𝐕𝑡\mathbf{V}^{t}bold_V start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT for all agents can be determined based on their current positions and local destinations.

To ascertain the state of agents in the subsequent time step t+1𝑡1t+1italic_t + 1, local navigation is required to calculate 𝐗t+1superscript𝐗𝑡1\mathbf{X}^{t+1}bold_X start_POSTSUPERSCRIPT italic_t + 1 end_POSTSUPERSCRIPT and 𝐕t+1superscript𝐕𝑡1\mathbf{V}^{t+1}bold_V start_POSTSUPERSCRIPT italic_t + 1 end_POSTSUPERSCRIPT for the agents first. Then, 𝐏t+1superscript𝐏𝑡1\mathbf{P}^{t+1}bold_P start_POSTSUPERSCRIPT italic_t + 1 end_POSTSUPERSCRIPT can be determined based on current positions 𝐗tsuperscript𝐗𝑡\mathbf{X}^{t}bold_X start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT and the local destinations of agents. Usually, 𝐗t+1superscript𝐗𝑡1\mathbf{X}^{t+1}bold_X start_POSTSUPERSCRIPT italic_t + 1 end_POSTSUPERSCRIPT can be calculated from 𝐕t+1superscript𝐕𝑡1\mathbf{V}^{t+1}bold_V start_POSTSUPERSCRIPT italic_t + 1 end_POSTSUPERSCRIPT, and 𝐕t+1superscript𝐕𝑡1\mathbf{V}^{t+1}bold_V start_POSTSUPERSCRIPT italic_t + 1 end_POSTSUPERSCRIPT also can be inferred from 𝐗t+1superscript𝐗𝑡1\mathbf{X}^{t+1}bold_X start_POSTSUPERSCRIPT italic_t + 1 end_POSTSUPERSCRIPT. Thus, local navigation only needs to compute either of these two. For example, in (karamouzas2017implicit, ), the calculation is for 𝐗t+1superscript𝐗𝑡1\mathbf{X}^{t+1}bold_X start_POSTSUPERSCRIPT italic_t + 1 end_POSTSUPERSCRIPT, while in (van2011reciprocal, ; dutra2017gradient, ; van2008reciprocal, ), the calculation is for 𝐕t+1superscript𝐕𝑡1\mathbf{V}^{t+1}bold_V start_POSTSUPERSCRIPT italic_t + 1 end_POSTSUPERSCRIPT.

When the surrounding environment is crowded, the actual velocity 𝐕t+1superscript𝐕𝑡1\mathbf{V}^{t+1}bold_V start_POSTSUPERSCRIPT italic_t + 1 end_POSTSUPERSCRIPT of agents often deviates from their preferred velocity 𝐕tsuperscript𝐕𝑡\mathbf{V}^{t}bold_V start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT. Agents aspire to advance towards their local goals but are required to adhere to certain local navigation constraints, such as avoiding collisions with other agents, maintaining proximity to a specific agent or group, and other relevant considerations. According to some crowd simulation models, such as (van2008reciprocal, ; karamouzas2014universal, ; karamouzas2017implicit, ), the agent repeatedly makes a local adjustment to step in a certain direction. In this work, for convenience, we use a function to represent this local adjustment/navigation:

(4) 𝐕t+1=(𝐗t,𝐕t,𝐏t).superscript𝐕𝑡1superscript𝐗𝑡superscript𝐕𝑡superscript𝐏𝑡\mathbf{V}^{t+1}=\mathcal{F}\left(\mathbf{X}^{t},\mathbf{V}^{t},\mathbf{P}^{t}% \right).bold_V start_POSTSUPERSCRIPT italic_t + 1 end_POSTSUPERSCRIPT = caligraphic_F ( bold_X start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT , bold_V start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT , bold_P start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT ) .

where ()\mathcal{F}(\cdot)caligraphic_F ( ⋅ ) serves as an abstraction for the process of local navigation algorithms (collision avoidance in particular). It take the state of agents as input and output the velocities of all agents of the next time step.

3. Method

3.1. Preferred Velocity Correction

So far, the calculation of preferred velocity is still based on a greedy rule, where each agent wishes to move in the direction that brings it closest to its destination in the shortest distance. This holds true for an individual pedestrian, but in a crowd, individual preferences are often influenced by the collective (le2002crowd, ). In real-life scenarios such as subway stations, airports, etc., the movement preferences of crowds often exhibit a tendency to follow the pedestrians in front, and even create channeling effects (helbing1995social, ) in some scenes. These autonomously emerging crowd phenomena can often enhance the efficiency of crowd movement. The basic idea in this work is to adjust the preferred velocity of each agent based on the surrounding crowd state, trying to create some beneficial crowd dynamics to enhance the efficiency of crowd movement. Therefore, we modify the calculation of 𝐕tsuperscript𝐕𝑡\mathbf{V}^{t}bold_V start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT as follows:

(5) 𝐕t+1=(𝐗t,𝐕t,𝐆t).superscript𝐕𝑡1superscript𝐗𝑡superscript𝐕𝑡superscript𝐆𝑡\mathbf{V}^{t+1}=\mathcal{F}\left(\mathbf{X}^{t},\mathbf{V}^{t},\mathbf{G}^{t}% \right).bold_V start_POSTSUPERSCRIPT italic_t + 1 end_POSTSUPERSCRIPT = caligraphic_F ( bold_X start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT , bold_V start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT , bold_G start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT ) .

where 𝐆tsuperscript𝐆𝑡\mathbf{G}^{t}bold_G start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT is considered as the new preferred velocities of agents after being influenced by the surrounding crowd. Each 𝐠itsubscriptsuperscript𝐠𝑡𝑖\mathbf{g}^{t}_{i}bold_g start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT in 𝐆tsuperscript𝐆𝑡\mathbf{G}^{t}bold_G start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT for each agent Aisubscript𝐴𝑖A_{i}italic_A start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT should be a more promising direction for the agent when the surroundings are crowded, compared with its original preferred velocity 𝐩itsuperscriptsubscript𝐩𝑖𝑡\mathbf{p}_{i}^{t}bold_p start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT. At the same time, 𝐠itsubscriptsuperscript𝐠𝑡𝑖\mathbf{g}^{t}_{i}bold_g start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT must also possess the functionality of 𝐩itsuperscriptsubscript𝐩𝑖𝑡\mathbf{p}_{i}^{t}bold_p start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT, guiding the agent towards its (local) destination.

How to find a reasonable 𝐆tsuperscript𝐆𝑡\mathbf{G}^{t}bold_G start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT is the focus of our work. The proposed method in this paper is to make a slight rotation, by an angle θisubscript𝜃𝑖\theta_{i}italic_θ start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT, to the original preferred velocity of each agent Aisubscript𝐴𝑖A_{i}italic_A start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT based on its current neighboring agents. Therefore, the relationship between 𝐆tsuperscript𝐆𝑡\mathbf{G}^{t}bold_G start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT and 𝐏tsuperscript𝐏𝑡\mathbf{P}^{t}bold_P start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT is as follows.

(6) 𝐆t=𝐑t𝐏t,superscript𝐆𝑡superscript𝐑𝑡superscript𝐏𝑡\displaystyle\mathbf{G}^{t}=\mathbf{R}^{t}\circ\mathbf{P}^{t},bold_G start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT = bold_R start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT ∘ bold_P start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT ,
(7) 𝐑t=R(Θt)=[R(θ1t),R(θ2t),,R(θit),,R(θNt)],superscript𝐑𝑡𝑅superscriptΘ𝑡𝑅superscriptsubscript𝜃1𝑡𝑅superscriptsubscript𝜃2𝑡𝑅superscriptsubscript𝜃𝑖𝑡𝑅superscriptsubscript𝜃𝑁𝑡\displaystyle\mathbf{R}^{t}=R\left(\Theta^{t}\right)=\left[R\left(\theta_{1}^{% t}\right),R\left(\theta_{2}^{t}\right),\cdots,R\left(\theta_{i}^{t}\right),% \cdots,R\left(\theta_{N}^{t}\right)\right],bold_R start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT = italic_R ( roman_Θ start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT ) = [ italic_R ( italic_θ start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT ) , italic_R ( italic_θ start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT ) , ⋯ , italic_R ( italic_θ start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT ) , ⋯ , italic_R ( italic_θ start_POSTSUBSCRIPT italic_N end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT ) ] ,

in which R(θi)𝑅subscript𝜃𝑖R(\theta_{i})italic_R ( italic_θ start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ) donates the rotation matrix corresponding to the angle θisubscript𝜃𝑖\theta_{i}italic_θ start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT, \circ represents the Hadamard product (horn2012matrix, ). In this case, the goal of this work is to calculate for N𝑁Nitalic_N offset angles Θt=[θ1t,θ2t,,θNt]superscriptΘ𝑡superscriptsubscript𝜃1𝑡superscriptsubscript𝜃2𝑡superscriptsubscript𝜃𝑁𝑡\Theta^{t}=[\theta_{1}^{t},\theta_{2}^{t},\cdots,\theta_{N}^{t}]roman_Θ start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT = [ italic_θ start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT , italic_θ start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT , ⋯ , italic_θ start_POSTSUBSCRIPT italic_N end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT ] at each time step t𝑡titalic_t, which can be characterized by (8).

(8) Θt=𝒢(𝐗t,𝐕t,𝐏t)superscriptΘ𝑡𝒢superscript𝐗𝑡superscript𝐕𝑡superscript𝐏𝑡\Theta^{t}=\mathcal{G}\left(\mathbf{X}^{t},\mathbf{V}^{t},\mathbf{P}^{t}\right)roman_Θ start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT = caligraphic_G ( bold_X start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT , bold_V start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT , bold_P start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT )

In the next subsection, a simple and efficient method for producing ΘtsuperscriptΘ𝑡\Theta^{t}roman_Θ start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT is presented.

3.2. Factors Influencing the Rotation Angle

Most existing crowd simulation models calculate 𝐯it+1superscriptsubscript𝐯𝑖𝑡1\mathbf{v}_{i}^{t+1}bold_v start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_t + 1 end_POSTSUPERSCRIPT for each agent Aisubscript𝐴𝑖A_{i}italic_A start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT based on several kinds of information, including the current velocity 𝐯itsuperscriptsubscript𝐯𝑖𝑡\mathbf{v}_{i}^{t}bold_v start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT and position 𝐱itsuperscriptsubscript𝐱𝑖𝑡\mathbf{x}_{i}^{t}bold_x start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT of Aisubscript𝐴𝑖A_{i}italic_A start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT, the agent’s preferred velocity 𝐩itsuperscriptsubscript𝐩𝑖𝑡\mathbf{p}_{i}^{t}bold_p start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT, and the positions and velocities of other agents around Ajsubscript𝐴𝑗A_{j}italic_A start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT. While these pieces of information primarily serve the purpose of collision avoidance, they also have the potential to offer guidance for optimizing crowd movement efficiency—a facet that has not received adequate attention in prior research. In this section, we examine the potentially viable offset direction for each agent, considering the information mentioned above. By simulating common behavioral patterns observed in real-life crowds, we hope to construct a following effect among individuals, thereby achieving crowd implicit grouping.

3.2.1. View field

In real-world scenarios, the preferences of pedestrians are often influenced only by the states of the crowd in front of them (within their field of view). Therefore, we introduce a term to model this phenomenon. We define a vector ΦtsuperscriptΦ𝑡\Phi^{t}roman_Φ start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT as the directions of the agents at the current time step t𝑡titalic_t:

(9) Φt=[ϕ1t,ϕ2t,,ϕit,,ϕNt].superscriptΦ𝑡subscriptsuperscriptitalic-ϕ𝑡1subscriptsuperscriptitalic-ϕ𝑡2subscriptsuperscriptitalic-ϕ𝑡𝑖subscriptsuperscriptitalic-ϕ𝑡𝑁\Phi^{t}=\left[\phi^{t}_{1},\phi^{t}_{2},\cdots,\phi^{t}_{i},\cdots,\phi^{t}_{% N}\right].roman_Φ start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT = [ italic_ϕ start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT , italic_ϕ start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT , ⋯ , italic_ϕ start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT , ⋯ , italic_ϕ start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_N end_POSTSUBSCRIPT ] .

In this work, we do not consider the actual velocity of an agent at time step t as its direction because the actual velocity may result in a very strange direction when avoiding collisions. Instead, we take a compromise between the actual velocity and the preferred velocity as the direction of an agent:

(10) Φt=𝐕t+𝐏t.superscriptΦ𝑡superscript𝐕𝑡superscript𝐏𝑡\Phi^{t}=\mathbf{V}^{t}+\mathbf{P}^{t}.roman_Φ start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT = bold_V start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT + bold_P start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT .

Whether other agents are in front of agent Aisubscript𝐴𝑖A_{i}italic_A start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT can be inferred using the following formula:

(11) T0=H((Φt)𝟏1×NΔ𝐗t),subscript𝑇0𝐻direct-producttensor-productsuperscriptsuperscriptΦ𝑡topsubscript11𝑁Δsuperscript𝐗𝑡T_{0}=H\left(\left(\Phi^{t}\right)^{\top}\otimes\mathbf{1}_{1\times N}\odot% \Delta\mathbf{X}^{t}\right),italic_T start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT = italic_H ( ( roman_Φ start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT ) start_POSTSUPERSCRIPT ⊤ end_POSTSUPERSCRIPT ⊗ bold_1 start_POSTSUBSCRIPT 1 × italic_N end_POSTSUBSCRIPT ⊙ roman_Δ bold_X start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT ) ,

where H()𝐻H(\cdot)italic_H ( ⋅ ) is the Heaviside step function (zhang2020feature, ), Δ𝐗tΔsuperscript𝐗𝑡\Delta\mathbf{X}^{t}roman_Δ bold_X start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT is the matrix of relative positions of all agents:

(12) Δ𝐗t=𝐗t𝟏N×1(𝐗t)𝟏1×N,Δsuperscript𝐗𝑡tensor-productsuperscript𝐗𝑡subscript1𝑁1tensor-productsuperscriptsuperscript𝐗𝑡topsubscript11𝑁\Delta\mathbf{X}^{t}=\mathbf{X}^{t}\otimes\mathbf{1}_{N\times 1}-\left(\mathbf% {X}^{t}\right)^{\top}\otimes\mathbf{1}_{1\times N},roman_Δ bold_X start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT = bold_X start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT ⊗ bold_1 start_POSTSUBSCRIPT italic_N × 1 end_POSTSUBSCRIPT - ( bold_X start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT ) start_POSTSUPERSCRIPT ⊤ end_POSTSUPERSCRIPT ⊗ bold_1 start_POSTSUBSCRIPT 1 × italic_N end_POSTSUBSCRIPT ,

in which tensor-product\otimes donates the Kronecker product (henderson1983history, ), direct-product\odot donates element-wise dot product, 𝟏n×msubscript1𝑛𝑚\mathbf{1}_{n\times m}bold_1 start_POSTSUBSCRIPT italic_n × italic_m end_POSTSUBSCRIPT means an all-ones matrix with size of n×m𝑛𝑚n\times mitalic_n × italic_m. T0subscript𝑇0T_{0}italic_T start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT is a matrix of dimensions n-by-m, comprised of ones and zeros. The element in the i𝑖iitalic_i-th row and j𝑗jitalic_j-th column signifies whether Ajsubscript𝐴𝑗A_{j}italic_A start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT is positioned in front of Aisubscript𝐴𝑖A_{i}italic_A start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT, with one indicating yes and zero indicating no. When calculating θitsubscriptsuperscript𝜃𝑡𝑖\theta^{t}_{i}italic_θ start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT, T0subscript𝑇0T_{0}italic_T start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT can be used as a mask to control which agents’ information needs to be included in the calculation.

3.2.2. The similarity and dissimilarity in directions

The movement of a pedestrian is often influenced by the velocities of the surrounding crowd. The velocities of other pedestrians commonly serve as a foundation for achieving collision avoidance. Simultaneously, the preferred velocity of a pedestrian is also influenced by these velocities. In real-world situations, when a pedestrian encounters a group of individuals walking towards them, there is a tendency to avoid them. Conversely, the pedestrian is inclined to follow a group of people moving in a similar direction as them. Inspired by this phenomenon, this work uses this observation as partial basis to calculate ΘisuperscriptΘ𝑖\Theta^{i}roman_Θ start_POSTSUPERSCRIPT italic_i end_POSTSUPERSCRIPT.

The degree of difference in the direction between an agent Aisubscript𝐴𝑖A_{i}italic_A start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT and another agent Ajsubscript𝐴𝑗A_{j}italic_A start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT can be calculated by their inner product ϕitϕjtsubscriptsuperscriptitalic-ϕ𝑡𝑖subscriptsuperscriptitalic-ϕ𝑡𝑗\mathbf{\phi}^{t}_{i}\cdot\mathbf{\phi}^{t}_{j}italic_ϕ start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ⋅ italic_ϕ start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT. In this work, we assume that agents can only know the actual velocities of other agents at time step t, without knowing their preferred velocities. Therefore, for agent Aisubscript𝐴𝑖A_{i}italic_A start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT, we use ϕit𝐯jtsubscriptsuperscriptitalic-ϕ𝑡𝑖subscriptsuperscript𝐯𝑡𝑗\mathbf{\phi}^{t}_{i}\cdot\mathbf{v}^{t}_{j}italic_ϕ start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ⋅ bold_v start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT as an indicator of the difference in velocity between Aisubscript𝐴𝑖A_{i}italic_A start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT and Ajsubscript𝐴𝑗A_{j}italic_A start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT. When ϕit𝐯jtsubscriptsuperscriptitalic-ϕ𝑡𝑖subscriptsuperscript𝐯𝑡𝑗\mathbf{\phi}^{t}_{i}\cdot\mathbf{v}^{t}_{j}italic_ϕ start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ⋅ bold_v start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT is positive, the larger the value, the closer the directions of Aisubscript𝐴𝑖A_{i}italic_A start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT and Ajsubscript𝐴𝑗A_{j}italic_A start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT. When ϕit𝐯jtsubscriptsuperscriptitalic-ϕ𝑡𝑖subscriptsuperscript𝐯𝑡𝑗\mathbf{\phi}^{t}_{i}\cdot\mathbf{v}^{t}_{j}italic_ϕ start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ⋅ bold_v start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT is negative, the larger the absolute value, the more conflicting the directions of Aisubscript𝐴𝑖A_{i}italic_A start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT and Ajsubscript𝐴𝑗A_{j}italic_A start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT. These indicators form a N×N𝑁𝑁N\times Nitalic_N × italic_N matrix, which can be calculated by (13).

(13) T1=(𝚽t)𝐕t.subscript𝑇1superscriptsuperscript𝚽𝑡topsuperscript𝐕𝑡T_{1}=\left(\mathbf{\Phi}^{t}\right)^{\top}\mathbf{V}^{t}.italic_T start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT = ( bold_Φ start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT ) start_POSTSUPERSCRIPT ⊤ end_POSTSUPERSCRIPT bold_V start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT .

The value of ϕit𝐯jtsubscriptsuperscriptitalic-ϕ𝑡𝑖subscriptsuperscript𝐯𝑡𝑗\mathbf{\phi}^{t}_{i}\cdot\mathbf{v}^{t}_{j}italic_ϕ start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ⋅ bold_v start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT can be positive or negative. If it is negative, Aisubscript𝐴𝑖A_{i}italic_A start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT needs to avoid Ajsubscript𝐴𝑗A_{j}italic_A start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT; if it is positive, Aisubscript𝐴𝑖A_{i}italic_A start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT could follow Ajsubscript𝐴𝑗A_{j}italic_A start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT. The magnitude of θitsubscriptsuperscript𝜃𝑡𝑖\theta^{t}_{i}italic_θ start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT, which represents the degree of correction to the preferred velocity of Aisubscript𝐴𝑖A_{i}italic_A start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT, can partially depend on the absolute value of ϕit𝐯jtsubscriptsuperscriptitalic-ϕ𝑡𝑖subscriptsuperscript𝐯𝑡𝑗\mathbf{\phi}^{t}_{i}\cdot\mathbf{v}^{t}_{j}italic_ϕ start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ⋅ bold_v start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT.

3.2.3. Detour

The magnitude of the angle between the direction of an agent Aisubscript𝐴𝑖A_{i}italic_A start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT and the relative position of another agent Ajsubscript𝐴𝑗A_{j}italic_A start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT with respect to Aisubscript𝐴𝑖A_{i}italic_A start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT can serve as an indicator of the potential obstruction that Ajsubscript𝐴𝑗A_{j}italic_A start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT might pose to the movement of Aisubscript𝐴𝑖A_{i}italic_A start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT in future time steps. When there are numerous other agents in the front of an agent, it suggests the possibility of potential congestion ahead (liao2023towards, ). Aisubscript𝐴𝑖A_{i}italic_A start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT can make some detour-like adjustments, i.e., offsetting the preferred velocity. In this work, this indicator is utilized as a component in calculating ΘtsuperscriptΘ𝑡\Theta^{t}roman_Θ start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT.

(14) T2=(Φt)𝟏1×NΔ𝐗tΔ𝐗tΔ𝐗t,subscript𝑇2direct-producttensor-productsuperscriptsuperscriptΦ𝑡topsubscript11𝑁Δsuperscript𝐗𝑡direct-productΔsuperscript𝐗𝑡Δsuperscript𝐗𝑡T_{2}=\left(\Phi^{t}\right)^{\top}\otimes\mathbf{1}_{1\times N}\odot\Delta% \mathbf{X}^{t}\oslash\sqrt{\Delta\mathbf{X}^{t}\odot\Delta\mathbf{X}^{t}},italic_T start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT = ( roman_Φ start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT ) start_POSTSUPERSCRIPT ⊤ end_POSTSUPERSCRIPT ⊗ bold_1 start_POSTSUBSCRIPT 1 × italic_N end_POSTSUBSCRIPT ⊙ roman_Δ bold_X start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT ⊘ square-root start_ARG roman_Δ bold_X start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT ⊙ roman_Δ bold_X start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT end_ARG ,

where T2subscript𝑇2T_{2}italic_T start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT is a N×N𝑁𝑁N\times Nitalic_N × italic_N matrix, \oslash donates Hadamard division (cyganek2013object, ). The element in the i𝑖iitalic_i-th row and j𝑗jitalic_j-th column of T2subscript𝑇2T_{2}italic_T start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT signifies the degree of proximity between the movement direction of Aisubscript𝐴𝑖A_{i}italic_A start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT and the direction of Ajsubscript𝐴𝑗A_{j}italic_A start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT relative to Aisubscript𝐴𝑖A_{i}italic_A start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT.

3.2.4. Distance

A basic intuition is that distant agents have a reduced impact on oneself. This work uses the reciprocal of the relative distance to describe this influence:

(15) T3=(Δ𝐗tΔ𝐗t)1.subscript𝑇3superscriptdirect-productΔsuperscript𝐗𝑡Δsuperscript𝐗𝑡absent1T_{3}=\left(\sqrt{\Delta\mathbf{X}^{t}\odot\Delta\mathbf{X}^{t}}\right)^{\circ% -1}.italic_T start_POSTSUBSCRIPT 3 end_POSTSUBSCRIPT = ( square-root start_ARG roman_Δ bold_X start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT ⊙ roman_Δ bold_X start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT end_ARG ) start_POSTSUPERSCRIPT ∘ - 1 end_POSTSUPERSCRIPT .

The impact on agent Aisubscript𝐴𝑖A_{i}italic_A start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT from other agents positioned at a greater distance should be diminished. This idea has also been widely adopted in many previous studies, such as neighbor region (van2008reciprocal, ). When adjusting the preferred velocity, it is also not necessary to consider all other agents. A new mask T4subscript𝑇4T_{4}italic_T start_POSTSUBSCRIPT 4 end_POSTSUBSCRIPT can be used to achieve this:

(16) T4=1H(Δ𝐗tΔ𝐗tLm),subscript𝑇41𝐻direct-productΔsuperscript𝐗𝑡Δsuperscript𝐗𝑡subscript𝐿𝑚T_{4}=1-H\left(\sqrt{\Delta\mathbf{X}^{t}\odot\Delta\mathbf{X}^{t}}-L_{m}% \right),italic_T start_POSTSUBSCRIPT 4 end_POSTSUBSCRIPT = 1 - italic_H ( square-root start_ARG roman_Δ bold_X start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT ⊙ roman_Δ bold_X start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT end_ARG - italic_L start_POSTSUBSCRIPT italic_m end_POSTSUBSCRIPT ) ,

where Lmsubscript𝐿𝑚L_{m}italic_L start_POSTSUBSCRIPT italic_m end_POSTSUBSCRIPT is the radius of the neighbor region. When the distance between Ajsubscript𝐴𝑗A_{j}italic_A start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT and Aisubscript𝐴𝑖A_{i}italic_A start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT is greater than Lmsubscript𝐿𝑚L_{m}italic_L start_POSTSUBSCRIPT italic_m end_POSTSUBSCRIPT, Ajsubscript𝐴𝑗A_{j}italic_A start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT is not considered to have an impact on the preferred velocity of Aisubscript𝐴𝑖A_{i}italic_A start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT.

3.2.5. Rotation direction of preferred velocity

The indicators introduced above can provide a basis for the magnitude of the preferred velocity offset angle, but we need to introduce a new component to control the direction of the preferred velocity offset. This work proposes a method to control the rotation direction of the preferred velocity via cross product. Because the cross product of 𝐱jt𝐱itsubscriptsuperscript𝐱𝑡𝑗subscriptsuperscript𝐱𝑡𝑖\mathbf{x}^{t}_{j}-\mathbf{x}^{t}_{i}bold_x start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT - bold_x start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT and ϕitsubscriptsuperscriptitalic-ϕ𝑡𝑖\phi^{t}_{i}italic_ϕ start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT, and the sine of the angle between them have a linear relationship, we can use their cross product to determine whether Ajsubscript𝐴𝑗A_{j}italic_A start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT positioned in the left or right half area of Aisubscript𝐴𝑖A_{i}italic_A start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT. Therefore, we use T5subscript𝑇5T_{5}italic_T start_POSTSUBSCRIPT 5 end_POSTSUBSCRIPT to control the rotation direction of each preferred velocity:

(17) T5=2H((Φt)𝟏1×NΔ𝐗t)1,subscript𝑇52𝐻tensor-productsuperscriptsuperscriptΦ𝑡topsubscript11𝑁Δsuperscript𝐗𝑡1T_{5}=2H\left(\left(\Phi^{t}\right)^{\top}\otimes\mathbf{1}_{1\times N}\star% \Delta\mathbf{X}^{t}\right)-1,italic_T start_POSTSUBSCRIPT 5 end_POSTSUBSCRIPT = 2 italic_H ( ( roman_Φ start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT ) start_POSTSUPERSCRIPT ⊤ end_POSTSUPERSCRIPT ⊗ bold_1 start_POSTSUBSCRIPT 1 × italic_N end_POSTSUBSCRIPT ⋆ roman_Δ bold_X start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT ) - 1 ,

where \star donates element-wise cross product. T5subscript𝑇5T_{5}italic_T start_POSTSUBSCRIPT 5 end_POSTSUBSCRIPT is a matrix consisting of 1111s and 11-1- 1s. If the value in the i𝑖iitalic_i-th row and j𝑗jitalic_j-th column is 1111, it means that Ajsubscript𝐴𝑗A_{j}italic_A start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT is on the left side of Aisubscript𝐴𝑖A_{i}italic_A start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT; otherwise, on the right side.

3.3. Overall Framework

Based on the analysis in the previous subsection, we have obtained some useful information (i.e., T0subscript𝑇0T_{0}italic_T start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT to T5subscript𝑇5T_{5}italic_T start_POSTSUBSCRIPT 5 end_POSTSUBSCRIPT) for calculating ΘtsuperscriptΘ𝑡\Theta^{t}roman_Θ start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT. This subsection employs a straightforward multiplication approach to organize the potential information outlined earlier. As T5subscript𝑇5T_{5}italic_T start_POSTSUBSCRIPT 5 end_POSTSUBSCRIPT is obtained via the cross-product operation that is associated with the sine function. Its values are distributed around 00 when the state of crowd is completely random. Therefore, this work establishes the following relationship:

(18) sin(Θt)𝟏1×Ni=05(Ti).superscriptΘ𝑡similar-toproportional-tosubscript11𝑁5𝑖0superscriptsubscript𝑇𝑖top\sin\left(\Theta^{t}\right)\underset{\sim}{\varpropto}\mathbf{1}_{1\times N}% \overset{5}{\underset{i=0}{\bigcirc}}\left(T_{i}\right)^{\top}.roman_sin ( roman_Θ start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT ) under∼ start_ARG ∝ end_ARG bold_1 start_POSTSUBSCRIPT 1 × italic_N end_POSTSUBSCRIPT over5 start_ARG start_UNDERACCENT italic_i = 0 end_UNDERACCENT start_ARG ○ end_ARG end_ARG ( italic_T start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ) start_POSTSUPERSCRIPT ⊤ end_POSTSUPERSCRIPT .

We can finally obtain the calculation formula for ΘtsuperscriptΘ𝑡\Theta^{t}roman_Θ start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT by normalization and the addition of the coefficient K𝐾Kitalic_K:

(19) Θt=sin1(12tanh(K𝟏1×Ni=05(Ti))),superscriptΘ𝑡superscript112𝐾subscript11𝑁5𝑖0superscriptsubscript𝑇𝑖top\Theta^{t}=\sin^{-1}\left(\frac{1}{2}\tanh\left(K\mathbf{1}_{1\times N}% \overset{5}{\underset{i=0}{\bigcirc}}\left(T_{i}\right)^{\top}\right)\right),roman_Θ start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT = roman_sin start_POSTSUPERSCRIPT - 1 end_POSTSUPERSCRIPT ( divide start_ARG 1 end_ARG start_ARG 2 end_ARG roman_tanh ( italic_K bold_1 start_POSTSUBSCRIPT 1 × italic_N end_POSTSUBSCRIPT over5 start_ARG start_UNDERACCENT italic_i = 0 end_UNDERACCENT start_ARG ○ end_ARG end_ARG ( italic_T start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ) start_POSTSUPERSCRIPT ⊤ end_POSTSUPERSCRIPT ) ) ,

where the term 1212\frac{1}{2}divide start_ARG 1 end_ARG start_ARG 2 end_ARG is used to control the deviation of the preferred velocity, ensuring it does not exceed π2𝜋2\frac{\pi}{2}divide start_ARG italic_π end_ARG start_ARG 2 end_ARG.

The overall framework of the algorithm is illustrated in Algorithm 1. The simulation initiates with the assignment of initial positions 𝐗0superscript𝐗0\mathbf{X}^{0}bold_X start_POSTSUPERSCRIPT 0 end_POSTSUPERSCRIPT and velocities 𝐕0superscript𝐕0\mathbf{V}^{0}bold_V start_POSTSUPERSCRIPT 0 end_POSTSUPERSCRIPT for the agents. In typical situations, 𝐕0superscript𝐕0\mathbf{V}^{0}bold_V start_POSTSUPERSCRIPT 0 end_POSTSUPERSCRIPT is composed of N𝑁Nitalic_N zero vectors, indicating that agents are initially stationary. The simulation proceeds through discrete time steps until reaching a predefined maximum time limit Tmaxsubscript𝑇𝑚𝑎𝑥T_{max}italic_T start_POSTSUBSCRIPT italic_m italic_a italic_x end_POSTSUBSCRIPT. At each time step, the preferred positions 𝐏tsuperscript𝐏𝑡\mathbf{P}^{t}bold_P start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT for agents are calculated based on their global paths. Then, the rotation angles ΘtsuperscriptΘ𝑡\Theta^{t}roman_Θ start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT of 𝐏tsuperscript𝐏𝑡\mathbf{P}^{t}bold_P start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT are calculated via the proposed method. Accordingly, 𝐏tsuperscript𝐏𝑡\mathbf{P}^{t}bold_P start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT is rotated and the new preferred velocities 𝐆tsuperscript𝐆𝑡\mathbf{G}^{t}bold_G start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT of agents can be obtained. The velocities of agents are updated by collision avoidance model ()\mathcal{F}(\cdot)caligraphic_F ( ⋅ ) that considers the current positions 𝐗tsuperscript𝐗𝑡\mathbf{X}^{t}bold_X start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT, velocities 𝐕tsuperscript𝐕𝑡\mathbf{V}^{t}bold_V start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT, and rotated preferred velocities 𝐆tsuperscript𝐆𝑡\mathbf{G}^{t}bold_G start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT. In this work, ORCA (van2011reciprocal, ) is adopted as the foundational collision avoidance model. Given its emphasis on preferred velocity as the objective, it aligns seamlessly with our approach. The positions are updated accordingly, and the current state of the simulation is visualized. This iterative process continues until the maximum time limit is reached.

1 Initial 𝐗0superscript𝐗0\mathbf{X}^{0}bold_X start_POSTSUPERSCRIPT 0 end_POSTSUPERSCRIPT and 𝐕0superscript𝐕0\mathbf{V}^{0}bold_V start_POSTSUPERSCRIPT 0 end_POSTSUPERSCRIPT;
2
3t0𝑡0t\leftarrow 0italic_t ← 0;
4 while t<Tmax𝑡subscript𝑇𝑚𝑎𝑥t<T_{max}italic_t < italic_T start_POSTSUBSCRIPT italic_m italic_a italic_x end_POSTSUBSCRIPT do
5       Calculate 𝐏tsuperscript𝐏𝑡\mathbf{P}^{t}bold_P start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT based on the global paths of agents;
6       Θtsin1(12tanh(K𝟏1×Ni=05(Ti)))superscriptΘ𝑡superscript112𝐾subscript11𝑁5𝑖0superscriptsubscript𝑇𝑖top\Theta^{t}\leftarrow\sin^{-1}\left(\frac{1}{2}\tanh\left(K\mathbf{1}_{1\times N% }\overset{5}{\underset{i=0}{\bigcirc}}\left(T_{i}\right)^{\top}\right)\right)roman_Θ start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT ← roman_sin start_POSTSUPERSCRIPT - 1 end_POSTSUPERSCRIPT ( divide start_ARG 1 end_ARG start_ARG 2 end_ARG roman_tanh ( italic_K bold_1 start_POSTSUBSCRIPT 1 × italic_N end_POSTSUBSCRIPT over5 start_ARG start_UNDERACCENT italic_i = 0 end_UNDERACCENT start_ARG ○ end_ARG end_ARG ( italic_T start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ) start_POSTSUPERSCRIPT ⊤ end_POSTSUPERSCRIPT ) ) ;
7       𝐆tR(Θt)𝐏tsuperscript𝐆𝑡𝑅superscriptΘ𝑡superscript𝐏𝑡\mathbf{G}^{t}\leftarrow R\left(\Theta^{t}\right)\circ\mathbf{P}^{t}bold_G start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT ← italic_R ( roman_Θ start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT ) ∘ bold_P start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT ;
8       𝐕t+1(𝐗t,𝐕t,𝐆t)superscript𝐕𝑡1superscript𝐗𝑡superscript𝐕𝑡superscript𝐆𝑡\mathbf{V}^{t+1}\leftarrow\mathcal{F}\left(\mathbf{X}^{t},\mathbf{V}^{t},% \mathbf{G}^{t}\right)bold_V start_POSTSUPERSCRIPT italic_t + 1 end_POSTSUPERSCRIPT ← caligraphic_F ( bold_X start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT , bold_V start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT , bold_G start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT ), 𝐗t+1𝐗t+𝐕t+1Δtsuperscript𝐗𝑡1superscript𝐗𝑡superscript𝐕𝑡1Δ𝑡\mathbf{X}^{t+1}\leftarrow\mathbf{X}^{t}+\mathbf{V}^{t+1}\Delta tbold_X start_POSTSUPERSCRIPT italic_t + 1 end_POSTSUPERSCRIPT ← bold_X start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT + bold_V start_POSTSUPERSCRIPT italic_t + 1 end_POSTSUPERSCRIPT roman_Δ italic_t ;
9       Visualize(𝐗t)superscript𝐗𝑡(\mathbf{X}^{t})( bold_X start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT ),  tt+1𝑡𝑡1t\leftarrow t+1italic_t ← italic_t + 1 ;
10      
11 end while
Algorithm 1 The Proposed Method

4. Implementation

4.1. Setting

This work primarily focuses on the efficiency of crowd movement. Therefore, the evaluation metrics in this paper include the dissimilarity between preferred velocity and actual velocity M1=12NΔtiN|𝐯it𝐩it|2subscript𝑀112𝑁Δ𝑡superscriptsubscript𝑖𝑁superscriptsubscriptsuperscript𝐯𝑡𝑖subscriptsuperscript𝐩𝑡𝑖2M_{1}=\frac{1}{2N}\Delta t\sum_{i}^{N}|\mathbf{v}^{t}_{i}-\mathbf{p}^{t}_{i}|^% {2}italic_M start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT = divide start_ARG 1 end_ARG start_ARG 2 italic_N end_ARG roman_Δ italic_t ∑ start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_N end_POSTSUPERSCRIPT | bold_v start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT - bold_p start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT | start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT and crowd congestion (liao2023crowd, ) level

(20) M2=1N2ijN1cos(𝐯it,𝐯jt)2e|xitxjt|.subscript𝑀21superscript𝑁2superscriptsubscript𝑖𝑗𝑁1subscriptsuperscript𝐯𝑡𝑖subscriptsuperscript𝐯𝑡𝑗2superscript𝑒subscriptsuperscript𝑥𝑡𝑖subscriptsuperscript𝑥𝑡𝑗M_{2}=\frac{1}{N^{2}}\sum_{i\neq j}^{N}\frac{1-\cos(\angle{\mathbf{v}^{t}_{i},% \mathbf{v}^{t}_{j}})}{2}e^{-|x^{t}_{i}-x^{t}_{j}|}.italic_M start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT = divide start_ARG 1 end_ARG start_ARG italic_N start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT end_ARG ∑ start_POSTSUBSCRIPT italic_i ≠ italic_j end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_N end_POSTSUPERSCRIPT divide start_ARG 1 - roman_cos ( ∠ bold_v start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT , bold_v start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT ) end_ARG start_ARG 2 end_ARG italic_e start_POSTSUPERSCRIPT - | italic_x start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT - italic_x start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT | end_POSTSUPERSCRIPT .

We test our method in several classic scenarios, including: Circle (see Figure 1, a classic scenario involves the even distribution of 100 agents on a circle, with their goal being to navigate to the antipodal position on the same circle), AsyCircle (similar to the configuration of Circle scenario, but with a slight perturbation added to the destination of agents, causing their movement to be not entirely symmetrical), 2-Group (see Figure 2(a), two groups, each comprising 20 agents, are positioned on the east and west sides of the scenario in a grid formation, with each agent’s destination mirroring horizontally w.r.t. the scenario center), and 4-Group (see Figure 2(b), four groups, each comprising 25 agents, are arranged in a grid formation in four directions of the scenario, and each agent’s destination is a position symmetric w.r.t. the scenario center).

Refer to caption
(a) initial state of 2-Group
Refer to caption
(b) initial state of 4-Group
Figure 2. The initial distribution of agents of two scenarios

Our model is compared with following models: SocialForces (helbing1995social, ), RVO (van2008reciprocal, ), PLEdestrians (guy2010pledestrians, ), PowerLaw (karamouzas2014universal, ), Karamouzas (karamouzas2010velocity, ), Moussaid (moussaid2011simple, ), ORCA (van2011reciprocal, ), Dutra (dutra2017gradient, ) and Implicit (karamouzas2017implicit, ). We implemented our method in C++ for the simulation of agents and Python for user interface. The parameters in our work are configured with Δt=0.1,r=0.3,K=0.6,Lm=10formulae-sequenceΔ𝑡0.1formulae-sequence𝑟0.3formulae-sequence𝐾0.6subscript𝐿𝑚10\Delta t=0.1,r=0.3,K=0.6,L_{m}=10roman_Δ italic_t = 0.1 , italic_r = 0.3 , italic_K = 0.6 , italic_L start_POSTSUBSCRIPT italic_m end_POSTSUBSCRIPT = 10.

4.2. Results and Analysis

Refer to caption
Figure 3. Curves of M1subscript𝑀1M_{1}italic_M start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT (the dissimilarity between preferred velocity and actual velocity of agents) over time steps of different crowd simulation models in four scenarios. In each scenario, although our approach exhibits a brief period of significant dissimilarity at the initial stage, it maintains relative stability throughout the subsequent simulation process.
Refer to caption
Figure 4. Curves of M2subscript𝑀2M_{2}italic_M start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT (the crowd congestion level) over time steps of different crowd simulation models in four scenarios. Our method consistently maintains a low level of congestion when agents encounter others (time steps around the middle of the x-axis)

Figure 3 presents the variation of M1subscript𝑀1M_{1}italic_M start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT over time steps in different scenarios. It can be observed that when agents from different directions converge (time steps around the middle of the x-axis), the actual velocities of agents in most methods deviate significantly from their preferred velocities. Our method achieved a relatively stable alignment between preferred velocity and actual velocity during the most of time of each simulation process. This results indicate that applying beneficial rotations to the agents’ original preferred velocities 𝐏tsuperscript𝐏𝑡\mathbf{P}^{t}bold_P start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT can actually reduce the dissimilarity between 𝐏tsuperscript𝐏𝑡\mathbf{P}^{t}bold_P start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT and 𝐕t+1superscript𝐕𝑡1\mathbf{V}^{t+1}bold_V start_POSTSUPERSCRIPT italic_t + 1 end_POSTSUPERSCRIPT. We hope that these results can provide some potential insights for future researchers in related studies.

Figure 4 depicts the variation of congestion levels over time steps for different algorithms in different scenarios. From the figure, it can be observed that our method exhibits relatively low congestion level when agents from different directions start to converge. Surprisingly, in the Circle scenario, due to the highly symmetrical movement of the crowd, all agents self-organize into a single group (refer to Figure 1), resulting in no congestion. Implicit crowd also performed well in most scenarios. However, the Dutra method performed poorly in two circle-based scenarios. Referring to the motion trajectories in Figure 1, it can be observed that this vision-based method exhibits severe oscillations when encountering a large and densely packed number of agents from different directions. SocialForces and PowerLaw are two rule-based methods that, without adding perturbations, exhibit prolonged congestion in symmetric scenarios. The area enclosed by the curve and the x-axis can be approximated as the overall congestion level of the crowd throughout the simulation process. Our method demonstrated the minimum congestion level in each scenario. This indicates that mimicking the following effect of real-life crowd behavior can significantly reduce congestion among individuals.

We also compares three crowd simulation models – ORCA, Implicit, and our method – within the AsyCircle scenario visually (its agents’ initial positions can be referenced from the first subplot in Figure 1). Figure 5 presents the simulation outcomes, highlighting distinctive characteristics of each model. Both ORCA and Implicit exhibit congestion at the convergence area where agents meet in the middle. In contrast, our proposed method showcases a unique behavior, forming loosely structured groups of agents with similar directions prior to their encounters. After agents meet, the original Implicit group disperses, and they reorganize into new formations with similar velocity directions (visible queues of agents in the figure). Notably, in our crowd simulation method, there is a conspicuous absence of significant congestion, emphasizing the efficacy of our approach in mitigating crowd congestion issues. Figure 6 shows illustrates partial trajectories of three agents from different crowd simulation models in a classic three-agent scenario. Agents in our method exhibit stronger proactive avoidance behavior compared to the Implicit and ORCA. This indicates that the pattern in our method, which considers avoiding or taking detours around pedestrians ahead, works.

Refer to caption
Figure 5. Agent states for three crowd simulation models in the AsyCircle scenario. Both ORCA and Implicit exhibit congestion at the area where the agents converges in the middle. Our method results in loosely formed groups of agents with similar directions before they encounter each other. Upon meeting, there is no significant congestion observed.
Refer to caption
Figure 6. Agent states for three crowd simulation models in classic three-agent scenario. Compared to the close encounters in ORCA, Implicit and our method demonstrate more realistic behaviors by incorporating necessary avoidance maneuvers and detours.

Figure 7 illustrates the computation time of the ORCA, Implicit, and our method for different numbers of agents. From the figure, it can be observed that our algorithm is highly efficient, adding almost negligible computational overhead compared to the ORCA. While Implicit is a global optimization algorithm, its runtime efficiency is comparatively lower.

Refer to caption
Figure 7. The computation time of the ORCA, Implicit, and our method for different numbers of agents. Our algorithm is highly efficient, introducing nearly negligible computational overhead to the underlying ORCA.

5. Conclusion

In this paper, we propose an approach that allows crowd grouping to emerge via self-organization, leading to efficient crowd movement. Experimental results demonstrate that our approach significantly reduces crowd congestion and the dissimilarity between agents’ preferred and actual speeds, compared to several other crowd simulation models. This indicates that our original intention to achieve efficient crowd movement via the autonomous emergence of latent behaviors of crowd, such as implicit group formation of agents with similar directions, is feasible.

Our method achieves the emergence of implicit groups, the process of loosely formed groups being disrupted and then reassembled (after unavoidable encounters with groups in severe directional conflict) is highly inefficient. Future research could focus on addressing this issue to achieve more efficient crowd movement. While the components T0subscript𝑇0T_{0}italic_T start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT to T5subscript𝑇5T_{5}italic_T start_POSTSUBSCRIPT 5 end_POSTSUBSCRIPT of our method are built based on the rationale of real-world scenarios, the final combination of these components, however, is still at a very preliminary stage. Moreover, the combination also introduces an additional hyperparameter, which is not an ideal design. In the future, considering the use of symbolic regression methods can potentially address the mentioned issues.

References

  • (1) Teófilo Bezerra Dutra, Ricardo Marques, Joaquim B Cavalcante-Neto, Creto Augusto Vidal, and Julien Pettré. Gradient-based steering for vision-based crowd simulation algorithms. In Computer graphics forum, volume 36, pages 337–348. Wiley Online Library, 2017.
  • (2) Ioannis Karamouzas, Nick Sohre, Rahul Narain, and Stephen J Guy. Implicit crowds: Optimization integrator for robust crowd simulation. ACM Transactions on Graphics (TOG), 36(4):1–13, 2017.
  • (3) Adèle Colas, Wouter van Toll, Katja Zibrek, Ludovic Hoyet, A-H Olivier, and Julien Pettré. Interaction fields: Intuitive sketch-based steering behaviors for crowd simulation. In Computer Graphics Forum, volume 41, pages 521–534. Wiley Online Library, 2022.
  • (4) David Wolinski, S J. Guy, A-H Olivier, Ming Lin, Dinesh Manocha, and Julien Pettré. Parameter estimation and comparative evaluation of crowd simulations. In Computer Graphics Forum, volume 33, pages 303–312. Wiley Online Library, 2014.
  • (5) Stephen Gustafson, Hemagiri Arumugam, Paul Kanyuk, and Michael Lorenzen. Mure: fast agent based crowd simulation for vfx and animation. In ACM SIGGRAPH 2016 Talks, pages 1–2. 2016.
  • (6) Jiawen Zhang, Chen Li, Changbo Wang, and Gaoqi He. Orcanet: Differentiable multi-parameter learning for crowd simulation. Computer Animation and Virtual Worlds, 34(1):e2114, 2023.
  • (7) Paul Kanyuk, Leon JW Park, and Emily Weihrich. Headstrong, hairy, and heavily clothed: Animating crowds of scotsmen. In ACM SIGGRAPH 2012 Talks, pages 1–1. 2015.
  • (8) Wouter Van Toll and Julien Pettré. Algorithms for microscopic crowd simulation: Advancements in the 2010s. In Computer Graphics Forum, volume 40, pages 731–754. Wiley Online Library, 2021.
  • (9) Kaidong Hu, Brandon Haworth, Glen Berseth, Vladimir Pavlovic, Petros Faloutsos, and Mubbasir Kapadia. Heterogeneous crowd simulation using parametric reinforcement learning. IEEE Transactions on Visualization and Computer Graphics, 2021.
  • (10) Wouter van Toll, Fabien Grzeskowiak, Axel López Gandía, Javad Amirian, Florian Berton, Julien Bruneau, Beatriz Cabrero Daniel, Alberto Jovane, and Julien Pettré. Generalized microscropic crowd simulation using costs in velocity space. In Symposium on Interactive 3D Graphics and Games, pages 1–9, 2020.
  • (11) Jur Van Den Berg, Stephen J Guy, Ming Lin, and Dinesh Manocha. Reciprocal n-body collision avoidance. In Robotics Research: The 14th International Symposium ISRR, pages 3–19. Springer, 2011.
  • (12) Jaedong Lee, Jungdam Won, and Jehee Lee. Crowd simulation by deep reinforcement learning. In Proceedings of the 11th ACM SIGGRAPH Conference on Motion, Interaction and Games, pages 1–7, 2018.
  • (13) Paolo Fiorini and Zvi Shiller. Motion planning in dynamic environments using velocity obstacles. The international journal of robotics research, 17(7):760–772, 1998.
  • (14) Jur Van den Berg, Ming Lin, and Dinesh Manocha. Reciprocal velocity obstacles for real-time multi-agent navigation. In 2008 IEEE international conference on robotics and automation, pages 1928–1935. Ieee, 2008.
  • (15) Panayiotis Charalambous, Julien Pettre, Vassilis Vassiliades, Yiorgos Chrysanthou, and Nuria Pelechano. Greil-crowds: Crowd simulation with deep reinforcement learning and examples. ACM Transactions on Graphics (TOG), 42(4):1–15, 2023.
  • (16) Bilas Talukdar, Yunhao Zhang, and Tomer Weiss. Learning to simulate crowds with crowds. In ACM SIGGRAPH 2023 Posters, pages 1–2. 2023.
  • (17) Ariel Kwiatkowski, Vicky Kalogeiton, Julien Pettré, and Marie-Paule Cani. Reward function design for crowd simulation via reinforcement learning. In Proceedings of the 16th ACM SIGGRAPH Conference on Motion, Interaction and Games, pages 1–7, 2023.
  • (18) Mehdi Moussaïd, Dirk Helbing, and Guy Theraulaz. How simple rules determine pedestrian behavior and crowd disasters. Proceedings of the National Academy of Sciences, 108(17):6884–6888, 2011.
  • (19) Dirk Helbing and Peter Molnar. Social force model for pedestrian dynamics. Physical review E, 51(5):4282, 1995.
  • (20) Andrea Gorrini, Stefania Bandini, and Giuseppe Vizzari. Empirical investigation on pedestrian crowd dynamics and grouping. In Traffic and granular flow’13, pages 83–91. Springer, 2014.
  • (21) Yan Li, Hong Liu, Guang-peng Liu, Liang Li, Philip Moore, and Bin Hu. A grouping method based on grid density and relationship for crowd evacuation simulation. Physica A: Statistical Mechanics and its Applications, 473:319–336, 2017.
  • (22) Alexandre Nicolas and Fadratul Hafinaz Hassan. Social groups in pedestrian crowds: review of their influence on the dynamics and their modelling. Transportmetrica A: transport science, 19(1):1970651, 2023.
  • (23) Julien Bruneau, Anne-Helene Olivier, and Julien Pettre. Going through, going around: A study on individual avoidance of groups. IEEE transactions on visualization and computer graphics, 21(4):520–528, 2015.
  • (24) Yuan Tang, Xu Zhang, Rui Wang, Jinfeng Xu, Long Hu, and Yixue Hao. Crowd intelligent grouping collaboration evacuation via multi-agent reinforcement learning. In 2023 26th International Conference on Computer Supported Cooperative Work in Design (CSCWD), pages 796–801. IEEE, 2023.
  • (25) Liang He, Jia Pan, Sahil Narang, Wenping Wang, and Dinesh Manocha. Dynamic group behaviors for interactive crowd simulation. arXiv preprint arXiv:1602.03623, 2016.
  • (26) Ioannis Karamouzas, Peter Heil, Pascal Van Beek, and Mark H Overmars. A predictive collision avoidance model for pedestrian simulation. In Motion in Games: Second International Workshop, MIG 2009, Zeist, The Netherlands, November 21-24, 2009. Proceedings 2, pages 41–52. Springer, 2009.
  • (27) Ioannis Karamouzas, Brian Skinner, and Stephen J Guy. Universal power law governing pedestrian interactions. Physical review letters, 113(23):238701, 2014.
  • (28) Jan Ondřej, Julien Pettré, Anne-Hélène Olivier, and Stéphane Donikian. A synthetic-vision based steering approach for crowd simulation. ACM Transactions on Graphics (TOG), 29(4):1–9, 2010.
  • (29) Rowan Hughes, Jan Ondřej, and John Dingliana. Davis: density-adaptive synthetic-vision based steering for virtual crowds. In Proceedings of the 8th ACM SIGGRAPH Conference on Motion in Games, pages 79–84, 2015.
  • (30) Alexandre Alahi, Kratarth Goel, Vignesh Ramanathan, Alexandre Robicquet, Li Fei-Fei, and Silvio Savarese. Social lstm: Human trajectory prediction in crowded spaces. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 961–971, 2016.
  • (31) Jinghui Zhong, Dongrui Li, Zhixing Huang, Chengyu Lu, and Wentong Cai. Data-driven crowd modeling techniques: A survey. ACM Transactions on Modeling and Computer Simulation (TOMACS), 32(1):1–33, 2022.
  • (32) Gustave Le Bon. The crowd: A study of the popular mind. Courier Corporation, 2002.
  • (33) Roger A Horn and Charles R Johnson. Matrix analysis. Cambridge university press, 2012.
  • (34) Weihong Zhang and Ying Zhou. The feature-driven method for structural optimization. Elsevier, 2020.
  • (35) Harold V Henderson, Friedrich Pukelsheim, and Shayle R Searle. On the history of the kronecker product. Linear and Multilinear Algebra, 14(2):113–120, 1983.
  • (36) Xiao-Cheng Liao, Wei-Neng Chen, Ya-Hui Jia, and Wen-Jin Qiu. Towards scalable dynamic traffic assignment with streaming agents: A decentralized control approach using genetic programming. IEEE Transactions on Emerging Topics in Computational Intelligence, 8(1):942–955, 2024.
  • (37) Boguslaw Cyganek. Object detection and recognition in digital images: theory and practice. John Wiley & Sons, 2013.
  • (38) Xiao-Cheng Liao, Wei-Neng Chen, Xiao-Qi Guo, Jinghui Zhong, and Xiao-Min Hu. Crowd management through optimal layout of fences: An ant colony approach based on crowd simulation. IEEE Transactions on Intelligent Transportation Systems, 24(9):9137–9149, 2023.
  • (39) Stephen J Guy, Jatin Chhugani, Sean Curtis, Pradeep Dubey, Ming C Lin, and Dinesh Manocha. Pledestrians: A least-effort approach to crowd simulation. In Symposium on computer animation, pages 119–128, 2010.
  • (40) Ioannis Karamouzas and Mark Overmars. A velocity-based approach for simulating human collision avoidance. In Intelligent Virtual Agents: 10th International Conference, IVA 2010, Philadelphia, PA, USA, September 20-22, 2010. Proceedings 10, pages 180–186. Springer, 2010.