Introduction

The emergence of coordinated movement and self-organisation in the collective motion of large groups of interacting autonomous individuals is ubiquitous in nature1,2,3,4. Flock and swarm behaviours arise e.g. in bacterial and cell migration5,6 (see also the pioneering works on morphogenesis by Turing7), animal aggregation8,9,10,11, rods and non-living systems12,13,14, microswimmers15,16,17, but also in robotic systems18,19. This includes a large class of non-equilibrium systems of self-driven particles often called active matter in the literature. The microscopic interaction rules initiate motility-induced phase separation from disordered states to non-uniform macroscopic patterns displaying order (at least partially)20,21. Pedestrian and vehicle flows are also systems of interacting self-driven agents that can exhibit phase transitions and self-organisation22,23,24,25,26. Indeed, pedestrians and drivers interact locally with their environment and the neighbourhood and have by the way density-dependent motility parameters. Similar forms of collective dynamics can arise in more abstract conceptions of self-driven particles like social systems, social networks, and opinion formation27,28,29,30. Regardless of the important differences in the specific type and interaction of the individuals, collective motions exhibit similarities suggesting the existence of generic underlying mechanisms and systemic phase transitions20,31,32.

The terminology active, self-driven, or self-propelled particles dates back to the 1970s when it was introduced for the description of swimming micro-organisms33. It became popular during the 1990s with the Vicsek model8 and is nowadays used for animal aggregation10, bacterial migration6, suspensions of microswimmers16, or vehicle and pedestrian dynamics34. Self-driven particle models are mainly designed to describe collective dynamics. In contrast to Brownian colloids dominated by physical (exclusion) rules, the motion of self-driven particles is mainly governed by local interaction rules with the environment. The interactions may result from external chemical potentials, for instance in cell behaviour (chemotaxis), while they come from social and proxemics interaction rules for pedestrians (sociotaxis)35. The social rules of pedestrians can initiate collective phenomena improving the system performance. The collective motions have positive effects on transport properties and may be referred to as intelligent collective dynamics. Examples of intelligent collective dynamics of pedestrians are lane formation32,36,37,38, collective motion and alignment21,39, or intermittent flows at bottlenecks and diagonal, chevron or circular patterns at intersections40,41. Intelligent collective dynamics in transportation are also of practical relevance, e.g. for the control of autonomous driving systems42,43. Yet, self-organisations may also induce negative effects on traffic safety and performance, for instance through stop-and-go waves44,45,46, herding35 or clogging effects47,48 among other segregation phenomena49. Besides scientific interests, extracting the essential features of collective motions from individual behaviors is fundamental to authorities for the control of crowd and traffic dynamics and the development of intelligent transportation strategies.

In self-driven particle systems, collective dynamics can result from heterogeneity effects in the microscopic behaviour of the particles, upon other inertia or delay mechanisms. Pedestrian dynamics describe for instance lane formation for counter-flow or for pedestrians walking in the same direction but with different speeds32,50. Other examples are stripe, diagonal travelling band or chevron patterns for crossing flows40,41. In this article, we show by simulation that heterogeneity effects can generically initiate segregation and spontaneous formation of lane or band patterns in two-species flows of polarised agents. Two heterogeneity mechanisms are identified: static heterogeneity in the agent characteristics and dynamic heterogeneity in the interactions. Static heterogeneity refers to quenched disorder in solid state physics and the terminology of random walks, when dynamic heterogeneity relies on annealed disorder (see51,52 and references therein). Interestingly, lanes spontaneously occur when the heterogeneity relies statically on the agent features (quenched disorder), while bands emerge if the heterogeneity operates dynamically in the interactions (annealed disorder). The lane and band patterns are stable and persist stationary, although no alignment interaction rules are defined (explicitly or implicitly). The features are generically observed with different microscopic motion models, namely the first order collision-free speed model53 and the inertial second order social force model54, and different types of parameters related to agent speed or agent size. Lane and band patterns are observed with different binary mixtures of interacting particles55,56,57, e.g. oppositely charged colloids subject to, respectively, DC and AC external electric fields58,59. In the presented models, the heterogeneity comes from internal interaction mechanisms. Potential applications are mixed urban traffic flow and the modelling of the interactions between different types of road users.

Models

We consider in the following two types of agents evolving on a torus. We denote \(n=1,\ldots ,N\) the agent’s ID while \(k_n={1,2}\) is the agent’s type. The agent’s motion is given by a dynamic model \(F_{{\mathbf {p}}}({\mathbf {X}}_n)\) that defines the agent speed as in the collision-free model53 or the agent acceleration as in the social force model54 according to local spatio-temporal variables \({\mathbf {X}}_n\) (e.g. the position and speed differences with the neighbours) and a set of parameters \({\mathbf {p}}\) (namely, desired speed, desired time gap, repulsion rate, agent size, and so on). We assume two different settings \({\mathbf {p}}_1\) and \({\mathbf {p}}_2\) for the parameters. Two types of heterogeneity are then considered.

  1. 1.

    Heterogeneity in the agent characteristics—We attribute statically the two parameter settings \({\mathbf {p}}_1\) and \({\mathbf {p}}_2\) to the two types of agents:

    $$\begin{aligned} M_1(n,k_n)=F_{{\mathbf {p}}_{k_n}}({\mathbf {X}}_n). \end{aligned}$$
    (1)

    We aim here to model different types of agents (for instance pedestrians and bicycles) with specific characteristics in term of desired speed, agent size, etc. This kind of heterogeneity is usually called quenched disorder in solid state physics. It refers to static heterogeneity features remaining constant (i.e. quenched) over the time.

  2. 2.

    Heterogeneity in the interactions—We attribute dynamically the two parameter settings \({\mathbf {p}}_1\) and \({\mathbf {p}}_2\) according to the type of the closest agent in front. The parameter setting is \({\mathbf {p}}_1\) if the agent in front is of the same type, while it is \({\mathbf {p}}_2\) in case of interaction with an another agent type:

    $$\begin{aligned} M_2(n,k_n)=\left\{ \begin{array}{ll}F_{{\mathbf {p}}_1}({\mathbf {X}}_n), &{}\text {if }{\tilde{k}}({\mathbf {X}}_n)=k_n,\\ F_{{\mathbf {p}}_2}({\mathbf {X}}_n),&{}\text {otherwise,}\end{array}\right. \end{aligned}$$
    (2)

    with \({\tilde{k}}({\mathbf {X}}_n)\) the type of the closest agent in front (see “Methods” for details). Such a mechanism may be realized in mixed urban traffic where cyclists or electric scooter drivers are adapting their behaviour, e.g. increasing the time gap or reducing his/her desired speed, when following a group of pedestrians. The heterogeneity features are here time-dependent. They are usually called annealed disorder in the literature of solid state physics51,52.

In contrast to the model Eq. (1) for which the heterogeneity statically lies in agent characteristics, the model Eq. (2) induces a dynamic heterogeneity mechanism taking place in the interactions. See Fig. 1 for an illustrative example in one dimension.

Figure 1
figure 1

Illustrative scheme in one dimension for the two heterogeneity models. The parameter setting (orange or blue) depends on the type of agents (represented as disc and triangle) for the model Eq. (1) while the setting depends on the type of the agent in front for the model Eq. (2): it is orange when the agent in front is of the same type and blue if it is of another type.

Analysis

We qualitatively observe by simulation that the static heterogeneity model \(M_1\) Eq. (1) initiates the formation of lanes in the system, while the dynamic heterogeneity model \(M_2\) Eq. (2) allows the formation of bands (see Fig. 2 below). To classify the state of the system, we measure the agent’s mean speed and also order parameters for the lane and band formation. The order parameter has been introduced to detect lanes in a colloidal suspension60 and used in pedestrian dynamics61. We denote in the following \((x_n,y_n)\) the positions of the agents \(n=1,\ldots ,N\). The order parameter for lane formation is

$$\begin{aligned} \Phi _L=\frac{1}{N}\sum _n\phi _n^L\quad \text {with}\quad \phi ^L_n=\Big [\frac{L_n-{\bar{L}}_n}{L_n+{\bar{L}}_n}\Big ]^2 \quad \left| \begin{array}{l} L_n=\text {card}\big (m,\,|y_n-y_m|<\Delta ,~k_n=k_m\big )\\ {\bar{L}}_n=\text {card}\big (m,\,|y_n-y_m|<\Delta ,~k_n\ne k_m\big )\end{array}\right. . \end{aligned}$$
(3)

Here \(L_n\) is the number of agents with the same type in front of the agent n on a lane of width \(\Delta >0\), \(\text {card}(A)\) being the operator counting the elements of an ensemble A, while \({\bar{L}}_n\) is the number of agents with different types. The order parameter \(\Phi _L\) tends by construction to be close to one when the system describes lanes. Assuming a disordered state for which the agents are uniformly randomly distributed on a \(w\times h\) rectangle with \(h>\Delta >0\) the system’s height and \(w>0\) the system’s width, the number \(L_n\) of agents with the same type is distributed according to the binomial model \({\mathscr{B}}(m,p)\), with \(m=N_{k_n}\) and \(p=\Delta /h\). Here \(N_{k_n}\) is the total number of agents with type \(k_n\). The distribution of the number \({\bar{L}}_n\) of agents with different types can be deduced similarly.

For band formation, the order parameter is

$$\begin{aligned} \Phi _B=\frac{1}{N}\sum _n\phi _n^B\quad \text {with}\quad \phi ^B_n=\Big [\frac{B_n-{\bar{B}}_n}{B_n+{\bar{B}}_n}\Big ]^2\quad \left| \begin{array}{l}B_n=\text {card}\big (m,\,|x_n-x_m|<\Delta w/h,~k_n=k_m\big )\\ {\bar{B}}_n=\text {card}\big (m,\,|x_n-x_m|<\Delta w/h,~k_n\not =k_m\big )\end{array}\right. . \end{aligned}$$
(4)

The band order parameter includes a term w/h, w and h being the width and height of the system. The distribution of the order parameters for lanes and bands is by construction the same in cases of random positions of the agents. Indeed for disordered states, the number \(B_n\) of agents on the sides with the same type has a binomial distribution \({\mathscr{B}}(m,p)\) with \(m=N_{k_n}\) and \(p=\Delta w/(hw)=\Delta /h\) as well. This makes the lane and band order parameters directly comparable. In particular, \(\mathbb E\Phi _L=\mathbb E\Phi _B\ge (1-p)/(1-p+pm)\) systematically holds for disordered states.

Simulation results

We carry out simulations of two-species flows on a \(9\times 5\) m rectangular with top-down and right-left periodic boundary conditions (torus). We simulate the evolution of \(N=45\) agents (density of 1 agent\(/\) \(\hbox {m}^2\)) from random initial conditions using the first order collision-free (CF) pedestrian model53 and the inertial social force (SF) model54 in the Supplementary Materials. The desired directions of motion of all agents are polarised to the right. The heterogeneity in the two settings \({\mathbf {p}}_1\) and \({\mathbf {p}}_2\) is introduced by varying model parameters related to the speed (i.e. desired speed or time gap parameters) or to the size of the agents. We quantify the heterogeneity level in the two-species system using the index \(\delta _s\) when we vary parameters related to agent speed, and the index \(\delta _l\) when we vary parameters related to agent size. The definitions of the microscopic motion model and details on the setting of the model’s parameters and heterogeneity indexes are provided in “Methods”.

Preliminary experiment

We first present single simulation histories of the two-species system with the two heterogeneity models Eqs. (1) and  (2). We simulate the evolution of the agents using the collision-free model53 for given heterogeneity indexes \(\delta _s\) on the parameters related to the agent speed, namely the desired speed and the time gap parameters (see “Methods” for details on the setting of the model parameters). Successive snapshots of the system are presented in Fig. 2. The evolution of the system with the static heterogeneity model Eq. (1) is shown in the left panels while the evolution with the dynamic heterogeneity model Eq. (2) is displayed in the right panels. The bottom panels provide the evolution of the order parameters for lane and band formation. We observe fast formation of two lanes by agent type within the first heterogeneity model, while two bands emerge with the second model. The parameter settings are statically attributed to the agent type for the model defined by Eq. (1). Thus, the segregation also involves the parameter setting. In contrast, the parameter setting depends on the type of the agent in front for the model defined by Eq. (2). This results in four bands according to the parameter settings. Note that further simulations with larger systems may describe more lanes and bands with different sizes.

Figure 2
figure 2

Typical histories for the model Eq. (1) with heterogeneity in the agent characteristics for which lanes emerge: the lane order parameter tends to one while the band order parameter is close to zero (left panels, \(\delta _s=18\)), and for the model Eq. (2) with heterogeneity in the interactions where bands emerge with opposite characteristics for the order parameters (right panels, \(\delta _s=8\)). Flow direction from left to right, periodic boundary conditions, random initial conditions.

The order parameters converge after a transient phase to stationary performances with lanes or bands where they are polarised to one or zero. The duration of the transient states is approximately 40 seconds of simulation. Note that the duration of the transient states varies from a simulation to another but the system systematically converges to a stationary state with lanes or bands. Furthermore, lane and band formation in larger systems require longer simulation times, especially for the band formation (see the blue dotted curves in Fig. 2, bottom panel, for a \(15\times 9\) m system three times larger with 135 pedestrians). Similar performances are observed when using the social force model instead of the collision-free model (see Fig. S1 in the Supplementary Materials). Here, the heterogeneity of the two parameter settings \({\mathbf {p}}_1\) and \({\mathbf {p}}_2\) and corresponding index \(\delta _s\) are relatively high. Reducing the heterogeneity index can result in a longer transient phase or even no formation of lanes and bands. We may expect that lanes and bands progressively emerge as the heterogeneity index increases. This is however not the case. As described in the next section, we observe in stationary states an abrupt phase transition from disorder states to order states with lanes or bands as the heterogeneity index increases.

Stationary performances

The preliminary experiment shows that lanes tend to emerge in the dynamics when the heterogeneity relies on agent characteristics (quenched disorder model \(M_1\) Eq. (1)) while bands occur when the heterogeneity takes place in the interactions (annealed disorder model \(M_2\) Eq. (2)). The results presented in Fig. 2 are obtained for given values of the heterogeneity index \(\delta _s\) between the two parameter settings \({\mathbf {p}}_1\) and \({\mathbf {p}}_2\). The index is sufficiently high to rapidly observe the formation of lanes or bands. In this section, we analyse the performances by progressively increasing the heterogeneity indexes \(\delta _s\) and \(\delta _l\). We repeated one thousand Monte-Carlo simulations from independent random initial configurations for the two heterogeneity models \(M_1\) Eq. (1) and \(M_2\) Eq. (2) by varying the heterogeneity indexes \(\delta _s\) and \(\delta _l\) over twenty levels. The differences between the two parameter settings \({\mathbf {p}}_1\) and \({\mathbf {p}}_2\) are zero at the lower heterogeneity level, while they are important at the higher level. We measure the system during 60 s after a simulation time \(t_0=600\) s to observe stationary performances. The remaining Figs. 3 and 4 and Figs. S2S5 in the Supplementary Materials show the median estimates of the Monte-Carlo simulations with inter-quartile ranges of the agent mean speed and order parameters for lane and band formation. Details on the setting of the model’s parameters and heterogeneity indexes are provided in “Methods”.

We first present the Monte-Carlo simulation results obtained by varying the heterogeneity index \(\delta _s\) relying on agent speed features (desired speed and time gap parameters). We observe the emergence of lanes when the heterogeneity relies on agent characteristics (quenched disorder model \(M_1\) Eq. (1), see Fig. 3, left panels) while band occurs when the heterogeneity operates in the interactions (annealed disorder model \(M_2\) Eq. (2), see Fig. 3, right panels). An abrupt phase transition occurs as the heterogeneity index \(\delta _s\) increases from a disordered state for which the order parameters are close to 0.2 (dotted line in Fig. 3, top panels) to an ordered dynamics with lanes or bands for which the order parameters are polarised on zero or one. A critical heterogeneity index can be identified. The lane patterns allow the speed of the agents with faster characteristics to be higher than the speed of agents with slower features (Fig. 3, bottom left panel). This makes the agent speed on average close to the mean speed of a homogeneous flow (dotted line). In contrast, the band patterns in the model \(M_2\) Eq. (2) correspond to gridlocks for which the speed of all the agents have slower features (Fig. 3, bottom right panel). Similar performances occur by varying parameters relying on agent size (see Fig. 4 below), or by using the social force inertial model instead of the first order collision-free model (see Figs. S2 and S3 in the Supplementary Materials).

The lane formation for counter-flow is an universal collective mechanism observed in pedestrian dynamics and binary mixtures of interacting particles32,36,37,38,56,57,58. It relies on heterogeneity of agent velocity: some of them have a desired speed v while the others have a desired speed \(-v\). No counter-flow occurs in the presented simulation experiments since all agents are polarised to the right. The agents of type 1 have a speed \(v_1>0\) and agents of type 2 have a speed \(v_2>0\) with \(v_1\not =v_2\). However, using a Galilean transformation with \({\tilde{v}}=(v_1+v_2)/2\) and neglecting anisotropic effects, the situation is the same as in a counter-flow with \(v=|v_2-v_1|/2\). Therefore, it is not surprising to observe longitudinal lane formation in uni-directional flows with the quenched disorder model \(M_1\) Eq. (1) even if no counter-flow arises (see also recent experiments50). The dynamic heterogeneity features of the annealed disorder model \(M_2\) Eq. (2) result in transversal segregation in space and the formation of bands vertical to the direction of motion. Band structures, as clusters or stop-and-go dynamics, are self-organised density waves45,58. The agents have a constant speed and the bands propagate downstream in the presented study. The bands propagate upstream with a characteristic speed and enforce agents to deceleration and acceleration phases in case of stop-and-go dynamics44,45,62, while they are static for oppositely charged particles59.

Figure 3
figure 3

Lane and band order parameters (top panels) and mean speed (bottom panels) according to the heterogeneity index \(\delta _s\) for agent speed features. Longitudinal lanes emerge with the model \(M_1\) Eq. (1) for which the heterogeneity relies on agent characteristics: \(\Phi _L\) tends to 1 while \(\Phi _B\) is low (top left panel). Orthogonal bands appear with the model \(M_2\) Eq. (2) for which the heterogeneity operates in the interaction: \(\Phi _B\) tends to 1 while \(\Phi _L\) is low (top right panel). The lane pattern allows the speed of the agents with faster characteristics to be higher than the speed of agents with slower features (bottom left panel). In contrast, the band pattern acts as a gridlock for which all the agents have slower speed features (bottom right panel).

Figure 4
figure 4

Lane and band order parameters (top panels) and mean speed (bottom panels) according to the heterogeneity index \(\delta _l\) for agent size. Comparable although smoother transitions to patterns with lanes or bands arise when varying parameters rela- ted to agent size (compare to Fig. 3) suggesting universal characteristics of the heterogeneity mechanisms Eqs. (1) and  (2).

Heterogeneity in agent speed featuring results in transitions from disordered states to ordered patterns with lanes or bands according to, respectively, model \(M_1\) Eq. (1) and model \(M_2\) Eq. (2). Similar although smoother transitions occur when varying the agent size characteristic index \(\delta _l\) instead of the speed index \(\delta _s\) (compare Figs. 3 and 4). Lanes emerge for the static heterogeneity model Eq. (1), see Fig. 4, left panels, while bands arise for the dynamic heterogeneity model Eq. (2), see Fig. 4, right panels. In contrast to heterogeneous models relying on agent speed, varying the agent size induces bi-dimensional steric effects making the average speed in the presence of lanes less than the mean speed of a homogeneous flow (see Fig. 4, bottom left panel). On contrast, the mean speed can be higher than the homogeneous one in the presence of bands (see Fig. 4, bottom right panel). Indeed, varying the agent size acts in two dimensions, reducing or increasing the available space in case of presence of lanes or bands. Similar performances occur when using the social force model instead of the collision-free model (compare Fig. 4 and Fig. S3 in the Supplementary Materials).

Transient states and perturbed systems

The simulations above describe stationary situations. Yet, it is interesting to observe the transient states of the system and the time required for the emergence of lanes or bands. In Fig. 5, we run simulations for different simulation times ranging from \(t_0=0\) to \(t_0=3000\,\rm s\) before starting the measurements. The initial conditions are random. The lanes and bands spontaneously emerge during the first minute of simulation when the heterogeneity index \(\delta _s\) is sufficiently high. Similar phase transition to lane and band patterns occur for \(t_0=600\), \(t_0=1200\) and \(t_0=3000\) s suggesting that the dynamics can be considered stationary as soon as \(t\ge 600\) s. The simulation times required to obtain stationary performances fluctuate from one simulation to another. They also depend on the size of the system and the density level. Generally speaking, larger or more dense systems require on average longer simulation times to reach a stationary state than smaller or least dense systems.

Figure 5
figure 5

Lane order parameter for the model \(M_1\) Eq. (1) (left panel) and band order parameter for the model \(M_2\) Eq. (2) (right panel) according to the heterogeneity index \(\delta _s\) of agent speed features. The different curves correspond to different simulation times \(t_0=0\), 60, 600, 1200 and 3000 s before starting the measurements (random initial conditions). The phase transition to lane and band patterns emerges relatively quickly. It can be observed during the first minutes of simulation. More precisely, the order parameters are similar for \(t_0=600\), 1200 and 3000 s suggesting that the system is stationary as soon as \(t\ge 600\) s.

So far, the modelling approach is deterministic. Analysing whether the collective motion is robust against random noising may reveal unexpected behaviours. In Fig. 6, we present the order parameter for stochastic systems for which the agent speeds are subject to independent Brownian noises. Simulations are carried out for a noise amplitude \(\sigma =0.1\), 0.2 and 0.5 m/s. The noise monotonically perturbs the lane formation in the static heterogeneity model \(M_1\) Eq. (1) (Fig. 6, left panel). No phase transition occurs for \(\sigma =0.5\) m/s. This phenomenon is well known in the literature as the freezing-by-heating effect63. The concept is borrowed from the plant growth stimulation process. On the contrary, introducing a low noise in the dynamics allows improving the band formation in the dynamic heterogeneity model \(M_2\) Eq. (2). Indeed, the critical heterogeneity indexes for the phase transition are smaller with \(\sigma =0.1\) or \(\sigma =0.2\) m/s than for the deterministic model with \(\sigma =0\), see Fig. 6, right panel. The band pattern is not only robust to the noise, it exists noise ranges improving the band formation. In contrast to the freezing-by-heating effect, this can be interpreted as an example of noise-induced ordering effect64,65.

Figure 6
figure 6

Lane order parameter for the model \(M_1\) Eq. (1) (left panel) and band order parameter for the model \(M_2\) Eq. (2) (right panel) according to the heterogeneity index \(\delta _s\) of agent speed features. The different curves correspond to different noise amplitudes \(\sigma =0\), 0.1, 0.2 and 0.5 m/s in the dynamics. The noise clearly perturbs the lane formation (left panel). Such a phenomenon is well-known in the literature as freezing-by-heating-effect63. Oppositely, the noise initially improves the band formation for \(\sigma =0.1\) or 0.2 m/s (noise-induced-ordering-effect), before partly altering it for \(\sigma =0.5\) m/s (right panel).

Discussion

Two microscopic heterogeneity mechanisms are identified for the formation of collective segregation in two-species systems of polarised agents. Quenched disorder model \(M_1\) Eq. (1) with static heterogeneity in the agent characteristics initiates the formation of longitudinal lanes. While annealed disorder model \(M_2\) Eq. (2) for which the heterogeneity dynamically lies in the interactions initiates transversal bands perpendicular to the motion direction. These features are observed when varying parameters related to agent speed (e.g. desired speed or time gap parameters, see Figs. 2 and 3) or to agent size (see Fig. 3), and by using the first order collision-free model53 or the second order social force model63 (see Fig. S1S3 in the Supplementary Materials). The lanes and bands already emerge rather early in the simulations (see Figs. 5; Fig. S4 in the Supplementary Materials) and are partly robust against random perturbations (see Figs. 6; Fig. S5 in the Supplementary Materials). The band formation is especially robust and may even be improved by perturbing the agent dynamics (noise-induced ordering effect), when the lane formation does not (freezing-by-heating effect). Further simulation results show similar behaviours when the noise is introduced in the agent polarity (i.e. the desired direction) instead of the speed.

Regardless of the modelling order of the motion models (speed-based or acceleration-based models) and related parameters, relying the heterogeneity on agent characteristics or on the interactions initiates generic segregation and the formation of lanes and bands in the dynamics. Such results corroborate the universality of the lane formation observed in pedestrian counter-flows, oppositely charged colloids, upon other binary mixtures of interacting particles32,56,57,58. They open new explanation perspectives for the formation of bands. Further theoretical investigations remain necessary to rigorously characterise the phase transitions. A possibility is to analyse mean-field instability phenomena of discrete lattice representations of the model41. The presence of walls and obstacles and the role of the geometry of given facilities may also be of interest. Preliminary simulation results show segregation effects of slower or bigger agents in case of bottleneck within the static heterogeneity model. These are expelled at the edges of the system and are obstructed by the presence of walls. These simulation results require more attention, notably for elderly people, people with motor disabilities, or in the current context of social distanciation.

Methods

The two agent motion models used in the simulations are the collision-free (CF) model53 and the social force (SF) model54 (see the Supplementary Materials). The CF model is a speed-based model of first order while the SF model is an inertial acceleration-based model. The agent dynamics are polarised in both models, i.e. all the agents have identical desired direction.

Collision-free model

In the collision-free model, the dynamics of an agent n with position \({\mathbf {x}}_n\) is given by the first order differential equation

$$\begin{aligned} \dot{{\mathbf {x}}}_n= F^\text{CF}_{{\mathbf {p}}_j}({\mathbf {X}}_n)=V({\mathbf {X}}_n,p_j) \;{\mathbf {e}}({\mathbf {X}}_n,p_j)+\sigma \xi _n,\end{aligned}$$
(5)

composed of the scalar speed model

$$\begin{aligned} V({\mathbf {X}}_n,p_j)=\max \big \{0,\min \big \{V_j, \big (s({\mathbf {X}}_n)-\ell _j\big )/T_j\big \}\big \}, \end{aligned}$$
(6)

here \(V_j\ge 0\) is the desired speed, \(T_j>0\) denotes the desired time gap, and \(\ell _j\ge 0\) the agent size, the index \(j=1,2\) representing the two parameter setting \({\mathbf {p}}_1\) and \({\mathbf {p}}_2\), and the direction model

$$\begin{aligned} {\mathbf {e}}({\mathbf {X}}_n,p_j)=\frac{1}{C}\Big ({\mathbf {e}}_0+\sum _{m\not =n}\nabla U(\Vert {\mathbf {x}}_n-{\mathbf {x}}_m\Vert )\Big ), \end{aligned}$$
(7)

with \({\mathbf {e}}_0=0\) the desired direction (polarity), \(U(x)=A\exp \big ((\ell _j-x)/B\big )\) with parameters \(A=5\) and \(B=0.1\) m a repulsive potential with the neighbors, and \(C>0\) a normalisation constant. A bi-dimensional white noise \(\xi _n\) (i.e. the time derivatives of two independent Wiener processes) with amplitude \(\sigma >0\) is used for the stochastic model in “Transient states and perturbed systems”. The function \(s({\mathbf {X}}_n)=\Vert {\mathbf {x}}_n-{\mathbf {x}}_{m_0({\mathbf {X}}_n)}\Vert \) in the scalar speed model determines the minimal distance in front,

$$\begin{aligned} m_0({\mathbf {X}}_n)=\text {arg}\min _{m\in N_n} \Vert {\mathbf {x}}_n-{\mathbf {x}}_m\Vert ,\quad N_n=\big \{m,~{\mathbf {e}}_n({\mathbf {x}}_n -{\mathbf {x}}_m)\ge 0\ \text{ and } \ \Vert{\mathbf {e}}_n^\perp ({\mathbf {x}}_n -{\mathbf {x}}_m)\Vert\le \ell \big \}, \end{aligned}$$
(8)

being the closest agent in front of the agent n. Note that in the definition of the dynamic heterogeneity type Eq. (2), the type of the closest agent in front is \({\tilde{k}}({\mathbf {X}}_n)=k_{m_0({\mathbf {X}}_n)}\). The simulations are carried out using an explicit Euler numerical scheme in deterministic cases, and using an Euler–Maruyama scheme for the simulations including the stochastic noise. The time step is \(\delta t=0.01\) s in both cases.

Setting of the parameters

The default values for the parameters \({\mathbf {p}}=(\ell ,V,T)\) of the CF model are based on the setting proposed in the literature53

$$\begin{aligned} \ell =0.3~\text {m},\quad V=1.5~\text {m/s},\quad T=1~\text {s}. \end{aligned}$$
(9)

Note that \(\Delta =0.6\) m in the order parameters corresponds approximately to two times the size of a pedestrian. Starting from the default values, we vary using heterogeneity indexes the parameter settings \({\mathbf {p}}_1=(\ell _1,V_1,T_1)\) and \({\mathbf {p}}_2=(\ell _2,V_2,T_2)\).

  • In the analysis of the speed heterogeneity (heterogeneity index \(\delta _s\), cf. Figs. 2, 3, 5 and 6) the time gap parameter T ranges into [0.05, 1.95] s by step of 0.05 s,

    $$\begin{aligned} T_1=T+0.05\delta _s,\quad T_2=T-0.05\delta _s,\quad \delta _s=0,\ldots ,19, \end{aligned}$$
    (10)

    while the desired (maximal) speed V ranges into [1, 2] m/s by step of 0.025 m/s,

    $$\begin{aligned} V_1=V-0.025\delta _s,\quad V_2=V+0.025\delta _s,\quad \delta _s=0,\ldots ,19. \end{aligned}$$
    (11)

    The parameters \(\ell _1=\ell _2=\ell =0.3\) m for the agent size remain constant.

  • In the analysis of the size heterogeneity (heterogeneity index \(\delta _l\), cf. Fig. 4) the parameter \(\ell \) ranges into [0, 0.9] m by step of 0.015 m decreasing and 0.03 m increasing,

    $$\begin{aligned} \ell _1=\ell -0.015\delta _l,\quad \ell _2=\ell +0.03\delta _l,\quad \delta _l=0,\ldots ,19. \end{aligned}$$
    (12)

    The remaining parameters for the agent speed \(V_1=V_2=V=1.5\) m/s and \(T_1=T_2=T=1\) s are constant.