Iñaki Echeverría-Huarte

Alexandre Nicolas
email: alexandre.nicolas@cnrs.fr

Body and mind: Decoding the dynamics of pedestrians and the effect of smartphone distraction by coupling mechanical and decisional processes

Keywords: Pedestrian dynamics, Agent-based models, Active matter, Digital distraction

Pedestrians are able to anticipate, which gives them an edge in avoiding collisions and navigating in cluttered spaces. However, these capabilities are impaired by digital distraction through smartphones, a growing safety concern. To capture these features, we put forward a continuous agent-based model (dubbed ANDA) hinging on a transparent delineation of a decision-making process, wherein a desired velocity is selected as the optimum of a perceived cost, and a mechanical layer that handles contacts and collisions. Altogether, the model includes less than a dozen parameters, many of which are fit using independent experimental data. The versatility of ANDA is demonstrated by numerical simulations that successfully replicate empirical observations in a very wide range of scenarios. These scenarios vary from collision avoidance involving one, two, or more agents, to collective flow properties in unidirectional and bidirectional settings, and to the dynamics of evacuation through a bottleneck, where contact forces are directly accessible. Remarkably, the model was able to replicate the enhanced chaoticity of the flow observed experimentally in 'smartphone-walking' pedestrians, by reducing the frequency of decisional updates, replicating the digital distraction effect. The conceptual transparency of the model makes it easy to pinpoint the origin of its current limitations and to clarify the singular position of pedestrian crowds amid active-matter systems.

Introduction

Pedestrians routinely display remarkable navigation and coordination abilities, which enable them to adapt to new environments, make their way through dense crowds [START_REF] Bruneau | Energy-efficient mid-term strategies for collision avoidance in crowd simulation[END_REF][START_REF] Nicolas | Mechanical response of dense pedestrian crowds to the crossing of intruders[END_REF] and navigate in very constrained surroundings. But, just like Marcus Aurelius's infallible man [START_REF] Aurelius | Meditations[END_REF], the infallible pedestrian simply does not exist: Suboptimal routing choices [START_REF] Gabbana | Fluctuations in pedestrian dynamics routing choices[END_REF], collisions, or even in the most tragic cases stampedes [START_REF] Helbing | Crowd disasters as systemic failures: analysis of the love parade disaster[END_REF] are indeed also prominent features of crowd dynamics. Uncoordinated behavior gets even more visible in our overly connected societies, where the pedestrians' attention to their surroundings is often diverted by their smartphones [START_REF] Murakami | Mutual anticipation can contribute to self-organization in human crowds[END_REF][START_REF] Jiang | Effects of mobile phone distraction on pedestrians' crossing behavior and visual attention allocation at a signalized intersection: An outdoor experimental study[END_REF]. Crowds thus display both high abilities for self-organization and individualistic choices conducive to undesirable collective effects. Models capable of capturing this somewhat contradictory alliance would be highly beneficial for practical purposes, of course, when it comes to designing new pedestrian facilities [START_REF] Alaska | The impact of crowd control measures on the occurrence of stampedes during mass gatherings: The hajj experience[END_REF], but also more fundamentally, to disentangle the specifics of pedestrian dynamics from the roots they share with other physical assemblies, notably active matter. At present, these antagonistic features are, to say the least, only dimly reflected in the vast array of microscopic models for crowd dynamics. Schematically, one branch of models prohibits the selection of all velocities potentially leading to a collision, whereas a second branch handles collision avoidance mechanistically, as a repulsive force.

The first branch (typically comprised of velocity-based models) was largely inspired by the field of robotics [START_REF] Van Den | Interactive navigation of multiple agents in crowded environments[END_REF][START_REF] Curtis | Pedestrian velocity obstacles: Pedestrian simulation through reasoning in velocity space[END_REF][START_REF] Bareiss | Generalized reciprocal collision avoidance[END_REF] in an endeavor to guarantee collision-free motion of multiple agents [START_REF] Godoy | Implicit coordination in crowded multi-agent navigation[END_REF]. If it is implemented in a fully decentralized way, this approach tends to be overly conservative ('prudent') and too often the dynamics get frozen (deadlocks) or look unnatural in the presence of conflicting maneuvers [START_REF] Shiomi | Towards a socially acceptable collision avoidance for a mobile robot navigating among pedestrians using a pedestrian model[END_REF]. To circumvent this issue, global coordination of individual moves may be enforced via a more or less centralized process [START_REF] Godoy | Implicit coordination in crowded multi-agent navigation[END_REF][START_REF] Karamouzas | Implicit crowds: Optimization integrator for robust crowd simulation[END_REF]. This leads to reasonable output for a variety of situations, but may arguably not be scalable to large crowds (involving thousands of pedestrians). Furthermore, the predicted trajectories may look odd for pedestrians (with sharp turns, grazing trajectories, etc.) [START_REF] Curtis | Pedestrian velocity obstacles: Pedestrian simulation through reasoning in velocity space[END_REF][START_REF] Shiomi | Towards a socially acceptable collision avoidance for a mobile robot navigating among pedestrians using a pedestrian model[END_REF][START_REF] Karamouzas | Implicit crowds: Optimization integrator for robust crowd simulation[END_REF]. The prediction of the other agents' trajectories, mediated by perception, can also be enforced in a contextdependent way [START_REF] Wolinski | Warpdriver: context-aware probabilistic motion prediction for crowd simulation[END_REF] and bring the agents' behavior closer to human response, but at the risk of requiring a different treatment for every situation and making them less amenable to theoretical understanding.

At the other extreme, in the wake of the celebrated Social Force Model [START_REF] Helbing | Social force model for pedestrian dynamics[END_REF], force-based models hypothesize that the local rules of navigation can be represented by specifically tailored pseudo-forces encoding 'intuitive' social interactions (such as keeping some distance from one another via a repulsive or walking in a group via an attractive interaction [START_REF] Zanlungo | Potential for the dynamics of pedestrians in a socially interacting group[END_REF]) and inserted into an e.g. Newton-like equation of motion, along with mechanical forces. This particle-based approach has succeeded in replicating various collective and/or self-organized phenomena in crowds [START_REF] Helbing | Self-organized pedestrian crowd dynamics: Experiments, simulations, and design solutions[END_REF], but is also known to lead to spurious oscillations [START_REF] Maury | Crowds in Equations: An Introduction to the Microscopic Modeling of Crowds[END_REF] and to deadlocks or conflicts caused by an unrealistic lack of anticipation by the agents. These issues are partly remedied by supplementing the models with specific forces or mechanisms enforcing a following or an anticipatory behavior [START_REF] Shiomi | Towards a socially acceptable collision avoidance for a mobile robot navigating among pedestrians using a pedestrian model[END_REF][START_REF] Lü | Pedestrian dynamics with mechanisms of anticipation and attraction[END_REF]. In a study of note, Karamouzas et al. contended that collision avoidance is controlled by the anticipated time to collision (TTC) with somebody else, rather than the absolute distance r to this person, and they showed that the distribution of spacings between moving pedestrians in empirical datasets is better described using an interaction depending on the TTC, in lieu of r [START_REF] Karamouzas | Universal power law governing pedestrian interactions[END_REF]. Other anticipatory behaviors and follow-the-leader rules have also recently been put forward [START_REF] Shiomi | Towards a socially acceptable collision avoidance for a mobile robot navigating among pedestrians using a pedestrian model[END_REF][START_REF] Lü | Pedestrian dynamics with mechanisms of anticipation and attraction[END_REF], but this remedial process has fallen short of fundamentally questioning the overall structure of the model.

In short, agents of the first branch of models are too infallible in their will to avoid contacts, whereas the second branch underestimates the anticipation capabilities of pedestrians, notably in crowded conditions. This may explain why no model has succeeded yet in quantitatively replicating very diverse empirical scenarios without adjustments of its rules and/or specific calibration of its parameters for each class of scenarios. In this paper, we propound a modeling framework that restores the 'fallibility' of pedestrians, who may accidentally bump into each other, but generally find ways to navigate smoothly even in cluttered environments. It aims to mirror the main processes involved in pedestrian motion, whereby each agent updates their desired velocity via a decision-making process that optimizes a pseudo-energy (or perceived cost) [START_REF] Moussaïd | How simple rules determine pedestrian behavior and crowd disasters[END_REF], notably comprising a floor field that guides agents along the most suitable routes towards their target and a mathematically smooth TTC penalty to avoid collisions all the more urgently as they are imminent [START_REF] Karamouzas | Universal power law governing pedestrian interactions[END_REF], whereas the contacts and pushes that may ensue are handled by a mechanical layer (Sec. 2). Thanks to the transparent coincidence between the building blocks and the processes they describe, most model parameters can be calibrated independently. Inherently decentralized, our ANticipatory Dynamics Algorithm (ANDA) reproduces realistic collision avoidance in crowds and coordinated motion in crowded scenarios as well as other collective effects, in quantitative agreement with experimental data, using a single set of parameters for the different regimes under study (Sec. 3). The model can further straightforwardly be extended to account for 'smartphone-walking', which has become a serious practical issue. The relative simplicity of the proposed framework makes it suitable for physical insight into the similarities and discrepancies with other types of active matter.

Modeling framework

Decision-making layer and mechanical layer

A pedestrian is both an autonomous agent that controls his or her motion and a physical body that evolves in a mechanical environment. In the parlance of control theory, a pedestrian is thus both the 'controller' and the 'system' responding to the control signal [START_REF] Hoogendoorn | Simulation of pedestrian flows by optimal control and differential games[END_REF]. These two roles are amalgamated in force-based models for pedestrian (and animal) motion [START_REF] Maury | Crowds in Equations: An Introduction to the Microscopic Modeling of Crowds[END_REF], whose velocity is governed by a single equation. Here, to mimic the sequential process at play in human locomotion, we choose to clearly disentangle the decision-making process [START_REF] Hoogendoorn | Simulation of pedestrian flows by optimal control and differential games[END_REF][START_REF] Curtis | Pedestrian velocity obstacles: Pedestrian simulation through reasoning in velocity space[END_REF][START_REF] Moussaïd | How simple rules determine pedestrian behavior and crowd disasters[END_REF][START_REF] Nicolas | Dense pedestrian crowds versus granular packings: An analogy of sorts[END_REF], whereby the agent selects a desired velocity depending on various (biomechanical and psychological) factors, from the mechanical block governing the response of the pedestrian's body in interaction with the environment. These two blocks are handled sequentially for each agent, following the general scheme outlined in Fig. 1, and will be exposed in detail below. Every time step δt, the agent collects information about the environment and the other agents in his or her field of view (left), considers various test velocities, and selects the optimal one from the perspective of his/her perceived cost. The self-propulsion force corresponding to this desired velocity is implemented in the mechanical layer, which handles possible contacts or collisions and returns the agent's updated position.

DECISION-MAKING LAYER

Decision-making layer

The move (consciously or unconsciously) chosen by a pedestrian at each time step can be regarded as an optimum over a set of options from the viewpoint of this agent, i.e., the option that maximizes a utility or, equivalently, minimizes a perceived cost function E (regardless of whether this cost function is objective or subjective and assessed with exhaustive or limited information). Such an approach has previously been applied for the selection of an optimal step [START_REF] Antonini | Discrete choice models of pedestrian walking behavior[END_REF] or of an inter-pedestrian distance [START_REF] Zanlungo | Potential for the dynamics of pedestrians in a socially interacting group[END_REF], but here we apply it for the choice of a desired velocity u for the next time step, viz.

u = argmin u∈R 2 E(u). (1)
From a broader perspective, this criterion can be interpreted as an optimal control problem [START_REF] Hoogendoorn | Simulation of pedestrian flows by optimal control and differential games[END_REF] over a very small time horizon δt (where δt is the interval between decisions, due to the reaction time), in which one would like to extremize

E[u] = t+δt t e (t , r(t ), u(t )) dt running cost + E T (r(t + δt)) terminal cost E(u) δt→0 ≈ δt e (t, r(t), u) + E T (r(t) + δt u) (2)
Equation 1 is reminiscent of the least action principle for a physical system, whereby the trajectory selected by nature minimizes a quantity called the action (also see [START_REF] Corbetta | Path-integral representation of diluted pedestrian dynamics[END_REF] for an application to dilute pedestrian flows). But, crucially, the cost is here minimized by each agent separately, knowing some information about the others, and not globally by the whole assembly, as in previous endeavors [START_REF] Karamouzas | Implicit crowds: Optimization integrator for robust crowd simulation[END_REF]. This reflects the autonomous nature of the agents and drives a wedge between social assemblies and physical systems. Specifying the decisional layer thus boils down to defining the perceived cost E(u). Given the complexity inherent in pedestrians' choices, E(u) will naturally comprise various terms, combined linearly here. Let us now detail these terms, each of which may become essential in some situations and reflects a specific motivation, either independently of the rest of the crowd (the eagerness to reach one's goal, the inconvenience of walking too fast or turning too sharply) or owing to social interactions (the reluctance for encroachments into personal spaces or collision paths).

Static floor field

In Eq. 2, the driving term, which accounts for the (motivation-related) desire to move towards a target destination, is the terminal cost E T , which is a function of the expected position r at time t + δt: The closer one gets to the target, the better. For simplicity, we will assume that E T (r ) is proportional to the shortest-path distance D(r ) to the agent's target, defined by the Eikonal equation |∇ r D| = n(r) (see Methods). Here, the 'refractive index' n(r) measures how uncomfortable the environment at r is. In particular, while n = 1 in free space, proximity to a wall is penalized by the function n(r) = 1/tanh(d w (r)/d c ), where d w (r) denotes the distance to the closest wall and the repulsive length d c is a parameter of the model. Overall, the floor field thus reads

E T (r ) = K T n D(r ), (3)
where K T > 0 is a coefficient which we have chosen to divide by n = n(r), for reasons that will soon transpire (Sec. 2.2.2). Importantly, using a floor field in ANDA circumvents the practical issues arising from the prescription of standard road maps (i.e., 'central' paths) or way-points in a complex geometry [START_REF] Curtis | Pedestrian velocity obstacles: Pedestrian simulation through reasoning in velocity space[END_REF], which can here be handled in a straightforward and efficient way (see Sec. 3.3 and Appendix C).

Bio-mechanical cost associated with walking speed and 'inertia'

The target cannot be reached instantly: The locomotive abilities of pedestrians constrain the choice of a desired velocity u . The faster one moves, the more energy is consumed by the body. The bio-mechanical dependence of this energy e speed on speed u = ||u||, which is internalized in the decision-making process, has been quantitatively assessed via measurements of oxygen consumption (e.g., of participants walking on a treadmill) [START_REF] Ludlow | Energy expenditure during level human walking: seeking a simple and accurate predictive solution[END_REF]; the excess energy expenditure compared to rest comprises a constant (penalty for walking) plus a term which grows as the square of u multiplied by a height-dependent prefactor. We show in Appendix A that these experimental data are nicely fit by

which smoothly connects e speed (u) to 0 when u → 0, i.e., when an agent halts.

Besides, abrupt changes in velocity should also be barred because they are uncomfortable and bio-mechanically costly, which suggests an 'inertial' contribution

e inertia (u) = µ u -v(t) 2 , (5)
where v(t) is the actual velocity at time t and u, the test velocity for the next time step, t + δt, and µ > 0.

The terms E T (r ), e speed (u), and e inertia presented so far are the only ones affecting an isolated pedestrian. In this situation, the extremum of E(u) = δt e speed (u) + e inertia (u) +

E T (r + δt u) is reached when 0 = 1 δt ∇ u E = 2 µ u -v(t) + de speed du u u -K T t, (6)
where t = -∇ r D/n(r) is a unit vector pointing towards the target, in free space. Provided that the free walking speed u ∞ in steady state is empirically known, the parameter K T = 1.2 u ∞ , for u 0.1 m/s, can be set straightforwardly; details can be found in Appendix B. In passing, the foregoing equality, balancing motivation and biomechanical cost, also shows how being more eager to egress e.g. in the context of an evacuation (see Sec. 3.6), as materialized by a steeper slope K T of the floor field, translates into a higher free walking speed. Strikingly, since u is the desired velocity at t + δt, Eq. 6 is formally identical to the numerical resolution of Newton's second law with a forward Euler scheme [START_REF] Karamouzas | Implicit crowds: Optimization integrator for robust crowd simulation[END_REF]. At this stage, we should underscore the two key conceptual shifts that have been made so far with respect to most existing models. First, Newton's equation is not obtained by dint of some fundamental physical law, but because of the simple form chosen for e inertia in the decisional layer. Second, the free walking speed u ∞ explicitly results from the balance between a bio-mechanical cost e speed , that may vary with the pedestrian but not with the context, and a will to move described by the terminal cost (or floor field) E T ; all psychological and motivational effects (heightened in the event of an emergency, for instance) are deferred to E T . This makes sense because E T also governs route choice and it will prove instrumental in dealing with complex obstacles (Appendix C) and geometries (Sec. 3.3), which stand out as pitfalls for other models.

Personal space

Another intuitive contribution comes from the reluctance to stand excessively close to other pedestrians or obstacles, i.e., to preserve one's personal space, the size of which varies between cultures [START_REF] Sorokowska | Preferred interpersonal distances: A global comparison[END_REF] and, more anecdotally, if social-distancing measures are in place [START_REF] Pouw | Monitoring physical distancing for crowd management: Real-time trajectory and group analysis[END_REF][START_REF] Echeverría-Huarte | Effect of physical distancing on the speed-density relation in pedestrian dynamics[END_REF]. This contribution is particularly important for dense static crowds [START_REF] Nicolas | Mechanical response of dense pedestrian crowds to the crossing of intruders[END_REF][START_REF] Cordes | Dimensionless numbers reveal distinct regimes in the structure and dynamics of pedestrian crowds[END_REF]. Here, it is modeled as a distance-dependent repulsive term entering the terminal cost in Eq. 2,

E personal (r ) = j∈f.o.v.(i) η σ i + σ j V rep ||r -r j (t + δt)|| σ i + σ j , (7)
where r j (t + δt) = r j (t) + δt v j (t) is the expected position of agent j at the next time step, σ j is the radius of agent j, and V rep is a short-ranged function. We cut it off at 1 + , where 0, and set

V rep (r) = 1 r -1 1+ if r < 1 + 0 otherwise. ( 8
)
To account for perception, in Eq. 7, the sum does not run over all neighboring agents j, but is limited to those in the field of view (f.o.v.) of the agent (i), i.e., within a cone which extends from -θ to +θ around the direction of the agent's last desired velocity u(t).

Time-to-collision (TTC) energy

All contributions so far are based on positions and distances, possibly anticipated at the next time step t + δt. This was argued to give an inadequate reflection of the cognitive heuristics employed by humans for collision avoidance [START_REF] Moussaïd | How simple rules determine pedestrian behavior and crowd disasters[END_REF]. Karamouzas et al. [START_REF] Karamouzas | Universal power law governing pedestrian interactions[END_REF] demonstrated that positional variables had better be substituted by an anticipated time to collision (TTC), which is the earliest time τ ij ∈ (0, ∞) at which agents i and j are expected to collide; in the light of empirical data on inter-pedestrian spacings, they established an interaction potential

V T T C (τ ) = K T T C exp(-τ /τ c ) τ p , (9)
where p = 2 and τ c was set to 3.0 s. In our case, unlike Karamouzas et al. [START_REF] Karamouzas | Universal power law governing pedestrian interactions[END_REF][START_REF] Karamouzas | Implicit crowds: Optimization integrator for robust crowd simulation[END_REF], each agent i will only consider the neighbor (say, j) in their f.o.v. with the shortest TTC and will also eschew encroachments into their personal space (of relative width i ). Under some approximations (see Methods), this leads to

e T T C i = 1 i i 0 V T T C [τ ij ( )] d (10)
The focus on only the shortest TTC is consistent with findings from virtual reality experiments, where it was observed that (eye-tracked) participants tend to fixate one of the agents in the virtual crowd with the highest risks of collision before initiating an avoidance maneuver around this person [START_REF] Meerhoff | Guided by gaze: Prioritization strategy when navigating through a virtual crowd can be assessed through gaze activity[END_REF]; this suggests that the collision-avoidance interaction was dominated by this very person. More anecdotally, this focus on the most imminent collision also echoes Primo Levi's impression (in a wholly unrelated context [START_REF] Levi | If this is a man/the truce[END_REF]) that one experiences fears and pains one at a time, the most acute coming first, as though the smaller ones remained hidden behind it while it persists. TTC-based anticipation is also operational with respect to walls, but their linear shape modifies the technical calculation of the TTC. More specifically, the TTC τ iw is defined as the shortest time after which the disk representing the agent would collide with a linear segment of a wall if it moves at the test velocity u; no personal space is considered in this case because the proximity to walls is already penalized in the floor field (Sec. 2.2.1).

This concludes the summary of the pseudo-energies entering the perceived cost function

E(u) = E T r(t) + δt u + E personal r(t) + δt u + δt e speed (u) + e inertia (u) + e TTC (u) ,
whose minimization, performed using a Nelder-Mead algorithm [START_REF] Olsson | The nelder-mead simplex procedure for function minimization[END_REF], yields the desired velocity u , for each agent (see Fig. 1).

Mechanical contacts

Collisions between pedestrians are rare but may occur in very dense crowds. Within ANDA, this will happen if the desired velocity u i leads to a collision within the decisional update time δt; the ensuing collisions are handled by a mechanical 'layer' (Fig. 1

Mechanical layer τ mech

Relaxation time 0.2 s κ /m

Renormalized body stiffness

10 6
Table 1: Definitions and values of the model parameters. Note that δt is chosen somewhat shorter than the reaction time to complex stimuli [START_REF] Gerson | Cortical origins of response time variability during rapid discrimination of visual objects[END_REF], because the human decision-making process is more sophisticated than that modeled here.

ri =

u i -ṙi τ mech + 1 m j F Hertz j→i + 1 m w∈walls F Hertz w→i , (11)
wherein agents self-propel in the direction of their desired velocity u i , which they reach in a characteristic time τ mech ≈ 0.2 s in free space. (Note the clear connection with active matter: if u i were governed by an Orstein-Uhlenbeck process and fluctuated, Eq. 11 would describe interacting active Orstein-Uhlenbeck particles in the underdamped regime [START_REF] Caprini | Marini Bettolo Marconi, Inertial self-propelled particles[END_REF]). Besides, they are assumed to interact with each other via frictionless Hertzian contact forces F Hertz j→i = κ P σ i +σ j r ij -1 (r i -r j ), where P (x) = max(0, x), as though they were homogeneous elastic cylinders of radii σ i and σ j with parallel axes. Similarly, contacts with a wall w result in a force

F Hertz w→i = κ P σ i r iw -1 (r i -r w )
, where r w is the wall point closest to i and r iw is the distance to the wall. Numerically, Eq. 11 is solved with a velocity Verlet algorithm, using a typical time

step dt = 2 • 10 -4 .
Of course, the present mechanical description could be refined in the future, turning to more realistic shapes and interactions for the agents. These improvements can easily be integrated within the sturdy theoretical ground outlined here, which already convincingly describes many features of pedestrian dynamics, as exposed in the next section. Interestingly, the structure of the differential equations thus obtained, namely, the combination of Eq. 11 with the minimization performed in the decisional layer, differs, in more or less subtle ways, from those in common use [START_REF] Helbing | Social force model for pedestrian dynamics[END_REF][START_REF] Moussaïd | How simple rules determine pedestrian behavior and crowd disasters[END_REF][START_REF] Van Toll | Generalized microscropic crowd simulation using costs in velocity space[END_REF]; in particular, it delineates two distinct relaxation processes. These differences are not always anecdotal (Appendix D).

Results and Discussion

This section evinces that, despite its simplicity, the ANDA model succeeds in quantitatively reproducing empirically observed features. Most importantly, although these situations cover a wide range of contexts and densities, no adjustment of the main parameter set (apart from very marginal ones required by the context) is needed. We will initially validate the algorithm at the individual level and then move to collective properties.

In the following simulations, we used the main model parameters detailed in Table . 1. Regarding the pedestrian shapes, whenever crowds are simulated, their body radii will be chosen in a normal distribution of mean 22.5 cm and standard deviation 2 cm. The preferential speeds will typically be normally distributed around u ∞ = 1.4 ± 0.2 m/s, but bounded below by 1.0 m/s.

Collision avoidance by a single pedestrian

To begin with, we probe binary avoidance maneuvers involving two pedestrians (body radius: r p = 25 cm, preferential speed: 1.4 m/s) in a 10 m length and 3 m width corridor, in two simple setups mimicking the experiments of Moussaid et al. [START_REF] Moussaïd | Experimental study of the behavioural mechanisms underlying self-organization in human crowds[END_REF]. In the first setup (Fig. 2a), one pedestrian stands still in the center of the corridor, at (X, Y )(0, 0). Meanwhile, the other one is asked to cross the corridor from an initial position at X = -5 m, Y ∈ [-r p , r p ] to a distant target zone centered at (X = 5 m, Y = 0 m), avoiding this 'obstacle' (Movie S1). Mostly by adjusting µ, we manage to obtain a close-to-perfect agreement between the model output and the average experimental behavior, apart from the avoidance-side preference (which is overlooked in ANDA and washed out of the experiments by plotting the absolute transverse displacements |Y | instead of Y ). The quality of the fit may even surpass that obtained with a social force model specifically calibrated for these experiments in the seminal original paper [START_REF] Moussaïd | Experimental study of the behavioural mechanisms underlying self-organization in human crowds[END_REF].

In the second setup (Fig. 2b), the pedestrians are initially at opposite ends of the corridor (X = ±5 m, Y ∈ [-r p , r p ]) and walk in opposite directions. They start deviating from the central line already 3 meters ahead of the point of encounter (so typically 6 meters away from their counterpart, Movie S1). The maximal transverse displacement, at the point of encounter, appears to be smaller than in the first setup with the static obstacle (Y ≈ 50 cm), but recall that, in this second setting, the workload associated with the avoidance maneuver is shared by two pedestrians; in fact, the deviation is undertaken earlier in the second setting, in line with the expectations based on the TTC. The (statically averaged) experimental trajectories are very well reproduced, without further adjustment compared to the first case. Furthermore, we checked that the longitudinal and transverse speeds during the simulated avoidance maneuver are also consistent with the experimental ones, whereas a model featuring strong and longranged repulsions based on distance would predict sizable longitudinal braking.

Going beyond controlled experimental settings, we now turn to the extensive empirical observations of binary collision avoidance passively garnered by Corbetta et al. [START_REF] Corbetta | Physics-based modeling and data representation of pairwise interactions among pedestrians[END_REF] in a train station. The researchers delved into the relationship between the lateral distance before the onset of an avoidance maneuver and the lateral distance when pedestrians pass each other side by side. We implemented a similar scenario in ANDA with agents entering a rectangular space from opposite sides and aiming for a target on the opposite side, with some random lateral offset with respect to their entrance. The numerical results are visually quite close to the empirical ones, as depicted in Fig. S6.

Many-body collision avoidances: Antipodal experiment on a circle

Having validated the model for two-body interactions, we move on to the interactions among a larger number of people. Circle antipodal experiments are an archetypal way to probe manybody collision avoidances. In this configuration, pedestrians are initially positioned on a circle (of 5 or 10 m of radius for example [START_REF] Xiao | Investigation of pedestrian dynamics in circle antipode experiments: Analysis and model evaluation with macroscopic indexes[END_REF]) with uniform spacing between them and instructed to quickly reach the antipodal positions as soon as a signal is heard. Were they to walk straight to their targets at equal speeds, they would meet at the centre of the circle. Instead, experiments have shown that they deviate from the plain straight path soon after setting in motion. By adopting various collision avoidance and detour strategies, they manage to reach their target without substantial near collisions [START_REF] Xiao | Investigation of pedestrian dynamics in circle antipode experiments: Analysis and model evaluation with macroscopic indexes[END_REF]. We replicated the experimental setup numerically for a set of 10 agents with equal preferential speeds. Without mutual interactions, these agents would walk straight ahead at very similar speeds, despite their different directions, thanks to our use of a hexagonal lattice for the floor field (as we explained in Sec. 2.2.1). Instead, we observe that they deviate from the straight path and easily manage to reach the antipodal position (Movie S2). The simulated trajectories are smooth and, as in the experiments, they do not excessively concentrate at the conflict-rife center of the circle; this is at odds with the output of the social force model, either in its traditional version or in a specifically designed variant, which were both deemed to significantly differ from the experimental results in [START_REF] Xiao | Investigation of pedestrian dynamics in circle antipode experiments: Analysis and model evaluation with macroscopic indexes[END_REF].

Navigation in a complex geometry

Navigation in a complex environment adds another layer of complexity to the foregoing multi-agent scenarios, in that each agent must also interact with the built environment. To characterize pedestrian flows in these (practically relevant) situations, we designed a geometry inspired by the ground floor of Montparnasse train station in Paris, France, in which about 100 pedestrians (walking at u ∞ 1.2 m/s), classified in 7 groups with distinct targets, were simulated. The simulation runs in a matter of minutes on a single CPU core. Thanks to the use of a floor field to attract each group to their specific target, the agents make sensible route choices to their destination (Fig. 3), without any need for an additional tactical layer. In particular, they go around walls and obstacles whenever needed and are not constrained to strictly adhere to a predefined path. Furthermore, the simulated dynamics (shown in Movie S3) are qualitatively convincing at the local level, as far as one can judge with the naked eye: the agents succeed in navigating toward their targets in a realistic way, generally avoiding collisions with their counterparts and the walls. Still, even closer inspection of the video reveals some hesitancy in the central region when an agent endeavors to cross a group of static pedestrians who have reached their target. This particular situation is further discussed in Appendix E.

Unidirectional flow

Turning to higher densities, we investigate the effect of density on unidirectional flow by means of the speed-density relation, a broadly used quantitative benchmark for models of pedestrian dynamics. A corridor of length L X = 16 m and width L Y = 3 m is considered (similar to the experimental scenario in [START_REF] Zhang | Transitions in pedestrian fundamental diagrams of straight corridors and t-junctions[END_REF]), with periodic boundary conditions (PBC) in the horizontal direction. The number of pedestrians inside the corridor is varied from 12 to 144, thus achieving densities ranging from 0.25 to 3 ped/m 2 . Each simulation runs for 100 seconds, the last 75 s of which are used to compute the speed-density relation by averaging the speeds of all agents.

The numerical outcome in Fig. 4 follows the same trends as the empirical data, with a monotonic decay of speed with density that gets sharper around 1.5-2 ped/m 2 . The situation at high density ρ > 2.5 ped/m 2 deserves additional comments. First, the speed is still nonvanishing in this regime, consistently with controlled laboratory experiments [START_REF] Jin | Observational characteristics of pedestrian flows under high-density conditions based on controlled experiments[END_REF] as well as empirical observations even at (much) higher densities, (far) above 6 ped/m 2 in the pilgrim processions during the Hajj [START_REF] Helbing | Dynamics of crowd disasters: An empirical study[END_REF]. Secondly, in the model, the speed seems to level off, possibly excessively. In this regime, pedestrian shapes start to become overly important and, not so surprisingly, the current approximation of pedestrians as disks (to dispose of rotational degrees of freedom) then reaches its limits.

The spatio-temporal diagrams of speed shown in the lateral panels of Fig. 4 for different densities shed light on finer details about the flow dynamics, notably the occurrence of stop-andgo waves in the higher-density regime. This type of instability, wherein a slow or 'jammed', dense phase emerges locally in the unidirectional crowd and propagates upstream, is routinely observed in various forms of traffic and in pedestrian motion [START_REF] Portz | Analyzing stop-and-go waves by experiment and modeling[END_REF] when the average spacing between agents is reduced. In our simulations, no stop-and-go wave was observed at the lowest considered density (label (1), ρ = 1 ped/m 2 ), in line with the experiments; instead, clusters of fast-walking agents create dark blue streaks, that move downstream at their (high) walking speed (Movie S4). When the density in the corridor increases (label (2), ρ = 2 ped/m 2 ), the spatio-temporal diagrams are qualitatively altered, with regions of halted pedestrians propagating upstream, corresponding to stop-and-go motion (Movie S4).

Interestingly, these backward-travelling waves are conspicuous in our coarse-grained diagrams of speed, but are not apparent when we plot the coarse-grained diagrams of density (Fig. S3). Thus, the density indicator used to experimentally detect stop-and-go motion in [START_REF] Jin | Pedestrian dynamics with different corridor widths: Investigation on a series of uni-directional and bi-directional experiments[END_REF] appears to be less telling than the (longitudinal) speed, as we elaborate in Appendix F. Finally, at even higher densities (label (3), ρ = 3 ped/m 2 ), promiscuity slows the flow even more and the dynamics become globally more hampered, but also less bursty.

Bidirectional flow

Bidirectional flows are also ubiquitous in daily-life and exhibit particular features. Regardless of the type of facility, the system will most probably evolve into a segregated state where people end up forming lanes [START_REF] Navin | Pedestrian flow characteristics[END_REF][START_REF] Yamori | Going with the flow: Micro-macro dynamics in the macrobehavioral patterns of pedestrian crowds[END_REF]. Such organization reduces collision risks with counterwalking agents and allows people to walk faster. While lane formation has historically been a major benchmark test for any new model, it is noteworthy that this phenomenon is not specific to pedestrian crowds, but is widely found in other active assemblies, and even in simply driven particle systems, such as colloids [START_REF] Dzubiella | Lane formation in colloidal mixtures driven by an external field[END_REF]. Indeed, it is underlain by a generic mechanism: in the non-organized flow, agents undergo small transverse moves after each collision; upon aligning behind someone walking in the same direction, these collisions become much less frequent and the aligned state is thus stabilized. Still, the lane-forming state cannot be reached within some pedestrian models in crowded corridors. This deficiency, leading to deadlocks, was underlined in [START_REF] Xu | Anticipation in a velocity-based model for pedestrian dynamics[END_REF] and remedied by an ad hoc anticipation mechanism. Here, we show that such additions are not required by ANDA and that it can natively describe bidirectional flows.

Filling the previously defined corridor with an equal number of left and right-moving agents, we find a speed-density relation comparable with that obtained for unidirectional flow and consistent with experimental measurements, as shown in the main panel of Fig. 5. The process of lane formation is unveiled by plotting the evolution of a lane-order parameter φ ∈ [0, 1] (see Methods) with time in the inset of Fig. 5, for ρ = 1 ped/m 2 . We observe that it gradually increases from φ 0 in the early stages [label (a)], denoting a disordered state, to φ 1 [label (b)], indicating a laned structure where pedestrians are segregated, and the transition takes about 10 to 15 seconds. This simulated lane-formation time for ρ = 1 ped/m 2 lies just in-between the values measured experimentally for ρ = 1 ped/m 2 and ρ = 2 ped/m 2 [42].

Bottleneck flow and evacuations

Introducing a narrowing (a bottleneck) across the corridor results in converging streamlines, hence possible clogs if the flow is dense and the bottleneck is not much wider than a few 'particles'. Clogging may occur when the particles are grains or animals [START_REF] Zuriguel | Clogging transition of many-particle systems flowing through bottlenecks[END_REF], but is vested with special interest for pedestrians, for it may be critical during egresses or evacuations under emergency conditions. The topic has thus received much attention and some paradoxical effects have been brought to light: While more haste often makes the evacuation quicker, in very competitive settings, higher individual preferential speeds may be counterproductive, leading to long-lived clogs, observed empirically as well as experimentally. This is the well-known 'fasteris-slower' effect (FIS), first predicted numerically [START_REF] Helbing | Simulating dynamical features of escape panic[END_REF] and then demonstrated experimentally in a variety of assemblies [START_REF] Pastor | Experimental proof of faster-is-slower in systems of frictional particles flowing through constrictions[END_REF][START_REF] Zuriguel | Clogging transition of many-particle systems flowing through bottlenecks[END_REF]. Here, we simulate an evacuation from a rectangular room initially filled with 150 randomly positioned agents who strive to egress through a doorway of width w in the middle of one wall. The agents' eagerness to evacuate affects the terminal cost E T and, as a consequence, their preferential speed u ∞ ; the latter will be varied and used as a proxy for eagerness. To avoid deadlocks at the bottleneck, every second the preferential speed of each agent undergoes a small random fluctuation (drawn from a normal distribution of standard deviation 0.2) around its initial, agent-dependent value. Each simulation is replicated around 100 times to collect sufficient statistics to overcome the expected strong fluctuations; for scientific rigor, but with virtually no impact on our results, the first and last egresses in each realization were discarded, to focus on the quasi-stationary state.

Gauging the evacuation efficiency by the exit capacity J s , i.e., the pedestrian throughput, we show in Fig. 6a that the FIS is retrieved when the door is very narrow, w = 60 cm: the capacity plummets as soon as u ∞ exceeds 1.7 m/s. In this competitive regime, the total evacuation time T evac exhibits strong fluctuations, rationalized by the (infrequent, but not sporadic) occurrence of very long clogs. These clogs generate large time gaps τ i between successive egresses, which impact T evac = i τ i . The survival functions P (τ > T ) of the τ i , represented in a logarithmic plot in Fig. 6b, are suggestive of a power-law-like behavior with heavy tails, whose slopes get flatter and flatter (Inset) as agents get more and more hurried (u ∞ > 2 -3 m/s), in contrast with the fast decays observed for more placid agents and/or wider doors (Fig. S4f). These features are in perfect agreement with previous experimental findings [START_REF] Pastor | Experimental proof of faster-is-slower in systems of frictional particles flowing through constrictions[END_REF]. Beyond u ∞ 3 m/s, the flattening trend gets less visible, as the stronger pushing forces counter the clogging phenomenon [START_REF] Sticco | Beyond the faster-is-slower effect[END_REF]. In parallel, the typical time gaps is reduced as the agents move faster; therefore, the capacity starts increasing again with u ∞ (Fig. 6a).

For a slightly larger door, of width w = 70 cm, the FIS is still noticeable, but not as conspicuous: the nonmonotonicity of J s is only tentatively seen around u ∞ = 4 m/s (Fig. S4a). This is broadly in line with the findings of [START_REF] Pastor | Experimental proof of faster-is-slower in systems of frictional particles flowing through constrictions[END_REF], where the FIS was clearly present, but fairly small for a 69 cm-wide door. For wider doors, w > 70 cm, the FIS fades away from our simulations (Fig. S4b,c): Higher preferential speeds u ∞ lead to higher throughputs.

More quantitatively, the variations of the specific capacity J s with the door width closely matches experimental reports, down to narrow doors (Appendix G). For very narrow doors, the model reaches its limits. This is primarily due to the description of agents as frictionless disks, which overlooks important factors such as shearing stress, cross section or body orientation. These features actually play a fundamental role when it comes to correctly characterizing how a person moves through a narrow space. Therefore, the prospective refinement of the mechanical layer will probably further enhance the realism of the description of flows through narrow bottlenecks.

Finally, thanks to the neatly delineated mechanical layer, contact forces can be defined rigorously, by contrast with models mingling pseudo-forces and real forces whenever the latter are not calibrated independently. More precisely, the contact force F j←i exerted by i on j reads F j←i = -dU 2 r ij , where U 2 is the Hertzian potential defined previously. If one overlooks variations in the agent's surface area A, the pressure can then be defined, from a continuum mechanics standpoint, as the sum of contact forces exerted on j divided by A, viz., i F ij /A. With this definition, Fig. 6c shows the average pressure field during the evacuation, i.e., the mean pressure felt by agents at each position in space. It is noteworthy that these pressure fields look similar to the density fields measured experimentally in evacuations under similar competitiveness [START_REF] Zuriguel | Contact forces and dynamics of pedestrians evacuating a room: The column effect[END_REF].

Effect of distracted pedestrians

So far we have shown that key pedestrian dynamics features could be replicated in various settings with a single set of model parameters. Now, we purport to show that the sound physical basis of ANDA enables us to extend it to an even wider range of situations by straightforwardly adapting its parameters.

To illustrate this, we consider the effect of digital distraction [START_REF] Nasar | Pedestrian injuries due to mobile phone use in public places[END_REF][START_REF] Ropaka | Investigation of traffic and safety behavior of pedestrians while texting or web-surfing[END_REF][START_REF] Larue | Prevalence and dynamics of distracted pedestrian behaviour at railway level crossings: emerging issues[END_REF]. In our increasingly connected societies, with the advent of the Internet of things, more and more pedestrians are indeed looking at their smartphones (or other connected devices) while walking; even near road crossings, more than one pedestrian out of six may be involved in a such an activity (17% in a 2020 study in Athens, Greece [START_REF] Ropaka | Investigation of traffic and safety behavior of pedestrians while texting or web-surfing[END_REF]). The ensuing distraction impacts their navigation in that it impairs their situational awareness [START_REF] Nasar | Mobile telephones, distracted attention, and pedestrian safety[END_REF][START_REF] Nasar | Pedestrian injuries due to mobile phone use in public places[END_REF], especially when texting or web-browsing [START_REF] Ropaka | Investigation of traffic and safety behavior of pedestrians while texting or web-surfing[END_REF][START_REF] Jiang | Effects of mobile phone distraction on pedestrians' crossing behavior and visual attention allocation at a signalized intersection: An outdoor experimental study[END_REF]. Their walking speed is then reduced [START_REF] Ropaka | Investigation of traffic and safety behavior of pedestrians while texting or web-surfing[END_REF][START_REF] Jiang | Effects of mobile phone distraction on pedestrians' crossing behavior and visual attention allocation at a signalized intersection: An outdoor experimental study[END_REF], as is their eye scanning frequency (by upwards of 25% in controlled outdoor experiments with college students [START_REF] Jiang | Effects of mobile phone distraction on pedestrians' crossing behavior and visual attention allocation at a signalized intersection: An outdoor experimental study[END_REF]). The whole topic has gained serious practical relevance as 'smartphone-walking' has entailed a sharp rise in pedestrian injuries. Already in 2010, of the thousands of pedestrians killed in traffic accidents in the US, 3.7% were engaged in a mobile phone activity, as compared to 0.6% in 2004 [START_REF] Nasar | Pedestrian injuries due to mobile phone use in public places[END_REF]; the numbers have most probably considerably risen since then, further heightening societal concerns, notably in Japan [START_REF] Takuma | Japan wrestles with dangers of 'smartphone-walking[END_REF].

To explore the effect of digital distraction in a broad range of situations, in particular on streets, numerical models are of great avail. In order to account for it, we notice that distraction through screens, albeit a complex psychological process, mainly entails that agents less frequently refresh (update) their perception of their surroundings and adapt their motion to it [START_REF] Nasar | Pedestrian injuries due to mobile phone use in public places[END_REF]. Indeed, in a collision avoidance scenario, they tend to turn at the last moment, with a delay of around 0.5 or 1 second in their response (i.e., very roughly, twice or thrice the normal reaction time to a complex visual stimulus [START_REF] Gerson | Cortical origins of response time variability during rapid discrimination of visual objects[END_REF]), compared to the reference case [START_REF] Murakami | Spontaneous behavioral coordination between pedestrians emerges through mutual anticipation rather than mutual gaze[END_REF]. This latency effect can readily be transcribed into ANDA by the decisional update time interval δt of distracted agents thrice as large as that of standard agents (δt = 0.3 s instead of 0.1 s; recall that the value of δt chosen in the model is lower than the real one because the simulated decisionmaking is much coarser); the walking speed of distracted agents (empirically slower than their counterparts [START_REF] Jiang | Effects of mobile phone distraction on pedestrians' crossing behavior and visual attention allocation at a signalized intersection: An outdoor experimental study[END_REF]) is set to u ∞ = 1.2 m/s. Of course, distraction may have secondary effects that would impact the perceived cost, but these are not addressed in this analysis.

We now test to what extent this numerical account of distraction is faithful to the experimental observations. To that end, we make use of Murakami et al.'s recent experiments on bidirectional flows in the presence of three digitally distracted agents, i.e., three participants who were instructed to use their smartphones while walking [START_REF] Murakami | Mutual anticipation can contribute to self-organization in human crowds[END_REF]. The researchers observed that their presence hampered lane formation and made the flow more chaotic, especially when the three participants were positioned at the front of the group of participants moving in one direction. This is well captured by an observable κ (detailed in the Methods) that measures how suddenly pedestrians had to turn using the curvature of their trajectories multiplied by their instantaneous speed: larger κ values, hence a more chaotic flow, are observed experimentally in Fig. 7a for distracted pedestrians, but also for the participants walking behind them in the same direction (referred to as 'Same Directed') and, to a lesser extent, those walking opposite to them ('Opposite Directed'), compared to the reference situation with no distracted agents ('Baseline').

Simulating an identical setup, as soon as the effect of head sways on κ is accounted for by superimposing oscillations onto the simulated trajectories (see Methods), we recover the average flow chaoticity κ measured experimentally in the reference situation (Fig. 7b). By introducing smartphone-walking pedestrians in the front row of the crowd, the substantially enhanced chaoticity κ observed experimentally not only for the (few) distracted people but also for the others (particularly those walking in the same direction) is surprisingly well captured by our model, wherein digital distraction mostly boils down to having a longer time δt between updates of the desired velocity (i.e., perception of, and reaction to, the environment): Fig. 7b testifies that the trends and the variations between the pedestrians depending on their status match the experimental findings. To get a sharper focus, we analyze the distributions of κ and show the survival functions P (K > κ) in Fig. 7c. The exacerbated chaoticity is mostly due to the more frequent occurrence of very sudden turns (associated with large κ). Besides, while we chose to keep the very same set of model parameters throughout the main text, we noticed that using a narrower visual field for the agents, i.e., reducing the half-angle θ from 70 • to 45 • , yielded a better match between experiments and simulations (compare the purple line with the dashed grey line in Fig. 7c); this is also true for the mean values of κ in the reference situation as well as in presence of distracted agents (Fig. S5).

Conclusions

To summarize, we have put forward a model for pedestrian dynamics that better distinguishes the psychological processes at play from the mechanical ones. In particular, the selection of a desired velocity by each (autonomous) agent is entrusted to a decision-making layer, which optimizes a perceived cost, whereas physical contacts are handled with Newton's equation of motion. Many model parameters can be adjusted based on existing empirical data. Despite the limited number of parameters left for adjustment, the model succeeds in reproducing a variety of experimental features over an impressively broad range of situations and densities (without resorting to more specific adjustments, compared to other approaches), overcoming the need for a specific calibration in each regime. These situations, listed in Table S1, include collision avoidance between several agents, the speed-density relations for unidirectional and bidirectional flows, bottleneck flows, and navigation in a complex geometry. The model can even replicate more exotic phenomena, which data-driven approaches would have struggled to capture, due to the lack of data. Digital distraction through smartphones, which has grown into a major issue for pedestrian safety, is one of them.

The transparent construction of the model also highlights the approximations that were made and that would need to be improved for a more faithful description of some scenarios, such as the pedestrian shape, at high densities, and the short-time approximation of the utility function, in situations where the operational dynamics include relatively far-sighted anticipation usually assigned to the tactical level.

More broadly speaking, a model that decouples the decision-making and physical processes has quite promising implications when it comes to representing different pedestrian attributes, such as impaired motor control due to injuries or carrying baggage, or reduced decision-making ability due to various forms of distraction or conversations with others. Exploring these aspects further and testing the model's applicability in real-world scenarios looks like a promising avenue for future research.

Methods

Static floor field

The shortest-path distances D to the destination, entering the static floor field via Eq. 3, are obtained by solving the Eikonal equation (generally used for ray tracing, but also in [START_REF] Cristiani | An all-densities pedestrian simulator based on a dynamic evaluation of the interpersonal distances[END_REF]) on a hexagonal lattice (the dual of a honeycomb lattice) before runtime and stored in memory. This is achieved by means of Dijkstra's algorithm, considering the nearest two neighbors of each node and evaluating the cost n(r) of traveling along an edge at the next (rather than current) node. The use of a highly symmetric hexagonal lattice strongly curbs the spurious anisotropy that is known to be generated by the Dijkstra algorithm (e.g., on square lattices); in practice, the variations of the free walking speed with the direction of motion are reduced to less than 10%.

TTC energy accounting for encroachments into personal spaces

Interactions based on TTC, instead of distances, are central in the model. Let us first handle agents j as hard disks of radii σ j and agent i; assuming that all neighbors j maintain their current velocities, the TTC τ ij can readily be calculated as [START_REF] Karamouzas | Implicit crowds: Optimization integrator for robust crowd simulation[END_REF]

τ ij (u i ) = -x ij • v ij - √ ∆ v 2 ij (12) if ∆ = (x ij • v ij ) 2 -v 2 ij [x 2 ij -(σ i + σ j ) 2 ] 0, or ∞ otherwise.
Here, x ij and v ij are the relative positions and desired velocities of i with respect to j.

This equation only penalizes desired velocities that lead to physical contact. However, pedestrians are also eager to avoid encroachments on their personal spaces. Suppose that the personal space is a disk of radius (1 + )σ i , where 0 and σ i is the body radius of the agent (i, here). Equation 12can then be applied to retrieve the TTC of personal spaces, τ ij ( ), provided that the sum of body radii σ i + σ j is multiplied ('inflated') by 1 + . We recall that agent i will only consider the neighbor j in the f.o.v. with the most imminent TTC. Since the transition into the personal space is actually smooth, the TTC energy should read

e T T C j = ∞ 0 V rep (1 + ) V T T C [τ ij ( )] d ∞ 0 V rep (1 + ) d . (13)
In practice, we approximated the foregoing formula by

e T T C i = 1 i i 0 V T T C [τ ij ( )] d (14)
Here, i = min , i may be lower than the maximal extent of the personal space, , if this value leads to an overlap of the personal sphere at the present time; in that case, i is capped to i , the largest inflation factor guaranteeing that agent i's personal space does not currently overlap any other agent's. A similar averaging procedure was put forward in [START_REF] Forootaninia | Uncertainty models for ttc-based collisionavoidance[END_REF] to smooth the TTC energy (with respect to positions), but it was then interpreted as the result of uncertainty on the evaluation of body sizes.

If no collision with agent j is ever expected, even with maximally inflated radii, i.e., τ ij ( i ) = ∞, then e T T C i = 0. Otherwise, the minimal inflation leading to collision, c ij ≥ 0, can easily be derived from Eq. 12. On this basis, Eq. 14 was further approximated by

e T T C i ≈ i -c ij i V T T C τ ij i + c i 2 . (15)
Lane formation order parameter To quantify the ordering in lanes in bidirectional flows, we took up the order parameter φ introduced in [START_REF] Chakrabarti | Reentrance effect in the lane formation of driven colloids[END_REF][START_REF] Dzubiella | Lane formation in colloidal mixtures driven by an external field[END_REF],

φ = 1 N N i=1 φ i ∈ [0, 1] with φ i = N Same i -N Dif f i N Same i + N Dif f i 2 , (16)
where N Same i and N Dif f i are the number of pedestrians walking on the same line as pedestrian i, respectively in the same direction and in the opposite one, viz.,

N Same i = {j, |y j -y i | < 3σ i /2 and vi • vj > 0} N Dif f i = {j, |y j -y i | < 3σ i /2 and vi • vj < 0} (17)
where we used 3σ i /2 as our characteristic length scale (remember that σ i is the particle radius), as supported by previous works [START_REF] Xu | Anticipation in a velocity-based model for pedestrian dynamics[END_REF]. Thus, φ ranges from 0 in the fully disordered (mixed) state) to 1 if the crowd is fully stratified in lanes.

Suddenness-of-turn parameter

To gauge how chaotic a bidirectional flow can become with digitally distracted agents, Murakami and co-workers defined a suddenness-of-turn κ [START_REF] Murakami | Mutual anticipation can contribute to self-organization in human crowds[END_REF], which we somewhat amended here to ensure its invariance under global rotations of the frame, viz.,

κ(t) = e(t + ∆t) -e(t) ∆t , (18)
where e(t) is the direction of motion at time t; κ tends to the geometric curvature, multiplied by the current speed v(t), in the limit of small ∆t. For this particular work, the value of ∆t has been set to 1, although lower values were also tested to check for convergence. κ measures how abruptly people have to turn, and thus deviate from their preferred straight trajectory, but it is also quite sensitive to the lateral swaying motion exhibited by pedestrians' heads. This characteristic feature pertains to the mechanism of biped locomotion and it is usually neglected in simulations. However, since these gait-induced oscillations impact κ, we characterized them in Murakami's experiments [START_REF] Murakami | Mutual anticipation can contribute to self-organization in human crowds[END_REF] by measuring their period ω = 1.6 s -1 and amplitude A = 0.04 m. Then, sine oscillations with these characteristics were simply superimposed onto the simulated trajectories z(t) = x(t) + jy(t), viz.

z (t) = z(t) + A e jωt e ⊥ (t). (19)
A. Derivation of the bio-mechanical term energy

The literature in physiology relates the energy expenditure of walking to the rate of oxygen consumption (V O 2 ), which has a "rest" component and a speed-dependent component:

V O 2 = V (rest) O 2 + V (walking) O 2 (S1)
We are interested in the second contribution which, in the experimental work of Ludlow et al. [START_REF] Ludlow | Energy expenditure during level human walking: seeking a simple and accurate predictive solution[END_REF] is reasonably well fitted by an equation of the form:

e speed [u] = K s1 + K s2 u 2 , for u ≥ u c (S2)
This quadratic relation is consistent with other empirical studies where the energy expenditure of humans in walking motion has been also studied [START_REF] Pandolf | Predicting energy expenditure with loads while standing or walking very slowly[END_REF]. For the particular case of this work, we discard the base energy consumption (i.e., e speed [0 m/s]) and subtract this contribution from the experimental data. After this process, we find that the coefficients of the previous equation must be such that:

e speed [1.5 m/s] ≈ 3 • e speed [0.5 m/s] (S3)
Finally, we choose to smoothly connect the above e speed expression to 0 so as to avoid discontinuities. This is done with a second-order polynomial:

e speed [u] = K s3 u + K s4 u 2 , for u < u c (S4)
with coefficients such that they match the higher-speed curve at u = u c , for the single-point value and the derivative. Taking the value of u c 0.1 m/s and e speed [1 m/s] = 1, we are able to calculate the value of the 4 parameters associated with both equations, arriving at:

         K s1 = 0.4 K s2 = 0.6 K s3 = 7.6 K s4 = -35.4 (

B. Derivation of the free walking speed

To express the free-walking speed of agents as a function of the ANDA model parameters, let us consider isolated agents. By definition, they have no interactions with other agents or the built environment; the perceived cost for motion is thus E(u) = δt e speed (u) + e inertia (u) + E T (r+δt u). Interestingly, this function (with its explicit dependences given by Eq. 3, Eq. 4 and Eq. 5) has the same qualitative dependence on the (longitudinal) speed u as the potential empirically estimated by Corbetta and co-workers from their tracking of dilute (i.e., non-interacting) pedestrians walking on a staircase landing (Fig. 5 of [START_REF] Corbetta | Fluctuations around mean walking behaviors in diluted pedestrian flows[END_REF]), with a local minimum at u = 0 and a global minimum at the free walking speed u ∞ ≈ 1 m/s. Note however that, contrary to [START_REF] Corbetta | Fluctuations around mean walking behaviors in diluted pedestrian flows[END_REF], no exogeneous noise is inserted into our decisional layer. Therefore, in the stationary state, the actual walking speed of a given agent does not fluctuate; instead, it matches the desired one u ∞ , which is obtained by extremizing E(u), viz.,

0 = 1 δt ∇ u E u=u ∞ (S7) = 2 µ u ∞ -v(t) + de speed du u ∞ u ∞ + ∇ r E T (S8) = 2 µ u ∞ -v(t) + 1.2 u ∞ -K T t (S9)
where we have used the expression of e speed for u 0.1 m/s from Eq. 4 and defined the unit vector t = -∇ r D/n(r) pointing towards the target. Now, an isolated agent quickly reaches his/her desired velocity u ∞ , so that the first term vanishes in the steady state. Therefore, we arrive at u ∞ = K T 1.2 t, which can be used to set the coefficient K T from the free-walking speed u ∞ .

C. Avoidance of obstacle of non-convex shape

The pedestrian's will to move is accounted by a floor field in ANDA. This provides a convenient handle on the agents' motivation or haste to walk on uncomfortable ground or to stand too close to a wall (via the 'refractive index' introduced in our Eikonal equation, in Sec. 2.2.1), and more generally on their route choice. While one might argue that these elements belong to the tactical level, and not to the operational one, we contend that the recourse to a floor field considerably simplifies the way in which the local navigation of the agents is handled, notably around obstacles of arbitrary shape. To this end, we consider a non-convex obstacle lying on an agent's path and compare in Fig. S2 the output of ANDA and several very popular agent-based models, simulated with the UMANS software developed at INRIA [START_REF] Van Toll | Generalized microscropic crowd simulation using costs in velocity space[END_REF]. Manifestly, for this test, only ANDA yields a reasonable result, whereas the other models are in critical need of a pathfinding algorithm specifying how to circumnavigate the obstacle. x (m) [START_REF] Moussaïd | How simple rules determine pedestrian behavior and crowd disasters[END_REF]. These other models were simulated using their implementation in the UMANS software with their native parameters in this software.

D. Consistency of the theoretical framework and differences with previous structures

In the main text, we emphasized the importance of the sound delineation between the decision-making layer and the mechanical layer in ANDA. This delineation entails differences in the structure of the equations as compared to that of the Social Force Model [START_REF] Helbing | Social force model for pedestrian dynamics[END_REF] or Moussaid et al.'s heuristic model [START_REF] Moussaïd | How simple rules determine pedestrian behavior and crowd disasters[END_REF]; their implications are underscored here.

Schematically, instead of our Eq. 11, the former posits that

mr j = m u ∞ j -u j τ + F mech →j + F soc →j , (S10)
where F mech →j and F soc →j refer to the mechanical and social forces exerted on j, respectively. It is true that, from Eq. S10, the ANDA framework can be recovered if one sets F soc →j to m τ (u j -u ∞ j ), but we will see below that in doing so the origin of the relaxational processes is misassigned.

Moussaid et al.'s model [START_REF] Moussaïd | How simple rules determine pedestrian behavior and crowd disasters[END_REF] differs from our ANDA framework in a more subtle way, insofar as in both models the social environment (F soc →j in Eq. S10) affects the choice of the desired velocity u ∞ j , instead of entering Eq. S10. But, in [START_REF] Moussaïd | How simple rules determine pedestrian behavior and crowd disasters[END_REF], temporal variations in the heuristically determined desired velocity are not penalized, so that it can change very abruptly. These abrupt variations of the desired velocity are not immediately mirrored by the actual velocity, because they are damped by the timescale τ in Eq. S10. The latter timescale is thus ambiguous, because it mingles a mechanical relaxation process with a decisional one. By ANDA penalizes sudden changes in the desired velocity (via the term controlled by µ in the perceived cost and via the sequential update of u ∞ j every δt) and then includes a mechanical relaxation time governed by τ mech .

To underline these differences using clear-cut examples, suppose that someone is walking on a moving walkway or a treadmill; any variation of the speed of the apparatus will be transmitted to the pedestrian within a typical time τ mech , irrespective of the decisional layer (i.e., irrespective of δt or µ). Along the same vein, should one wish to describe a swimmer, the lower friction of the swimmer's body with the water (compared to the ground) will translate into a longer mechanical relaxation time τ mech . Conversely, the slower responses of distracted pedestrians (Sec. 3.7) or older people can readily be transcribed into the decisional layer of ANDA but have no impact on τ mech . Our framework, therefore, clarifies the distinct relaxational processes that were amalgamated in other models and misled some practitioners into ill-founded calibrations of some model parameters (whether it be relaxation times or the mass m in Eq. S10).

Note that ANDA remains compatible with the framework developed by van Toll et al. [START_REF] Van Toll | Generalized microscropic crowd simulation using costs in velocity space[END_REF], who recast a variety of microscopic models by defining a generalized velocity cost, provided that the generalized cost function can include an 'inertial' term penalizing sudden changes in velocity (which was not the case for the models implemented so far in this framework).

E. The intruder problem

While competitive evacuations display many similarities with granular flows through a bottleneck [START_REF] Zuriguel | Clogging transition of many-particle systems flowing through bottlenecks[END_REF], probably owing to the prominence of mechanical contacts, recent experiments have shown that, surprisingly, the granular analogy fares much worse when a group of static people is crossed by an 'intruder' [START_REF] Nicolas | Mechanical response of dense pedestrian crowds to the crossing of intruders[END_REF]: Anticipation and self-propulsion by the pedestrians then play a major role in opening a pedestrian-free tunnel ahead of the intruder via transverse displacements, in stark contrast with the stationary response of a granular mono-layer (where nontransverse recirculation eddies are observed); see the displacement fields in [START_REF] Nicolas | Mechanical response of dense pedestrian crowds to the crossing of intruders[END_REF]. This holds even in the dense regime, where mechanical forces were believed to prevail.

The Social Force Model goes completely amiss in the description of these features [START_REF] Raj | Moving efficiently through a crowd: A nature-inspired traffic rule[END_REF], whereas in principle they could be captured by our model: agents in the static crowd can anticipate a risk of collision with the intruder and move 'out of harm's way' in advance, by walking away from the intruder's path. Indeed, we managed to reproduce the density field, with a 'tunnel-like' opening ahead the intruder due to anticipation. but notOn the other hand, we failed to replicate the purely transverse displacements observed experimentally, even with slight variations of the model or its parameters. In a parallel paper dedicated to this scenario [START_REF] Bonnemain | Pedestrians in static crowds are not grains, but game players[END_REF], we ascribed the deficiency of most existing agent-based models (including a variant of ANDA, see SI of [START_REF] Bonnemain | Pedestrians in static crowds are not grains, but game players[END_REF]) regarding this effect to the fact that, in this situation, tactical planning interferes with the local navigation and that the modeled agents are too short-sighted to achieve this anticipation. For ANDA, the alleged origin of this deficiency can be pinpointed more precisely thanks to its transparent derivation: Taking the limit δt → 0 in the anticipated cost of motion in Equation ( 2) sweeps away the possibility to plan a move that involves a non-constant velocity u(t ).

A natural way to recover it would be to perform the optimization of the full time-integral in Equation (2), i.e. with respect to the planned velocity function u(t ), t t, as in game theory, at the expense of an unbearable computational cost. Mean-field game theory can overcome this intractability, at the expense of losing sight of the discrete nature of pedestrians; see [START_REF] Bonnemain | Pedestrians in static crowds are not grains, but game players[END_REF].

Interestingly, this also explains the aforementioned hesitancy of some pedestrians when crossing a group, in the complex scenario studied in Sec. 3.3: ANDA agents are somewhat too short-sighted in their planning to cross static groups efficiently.

F. Density Field -A Misleading Indicator of Stop-and-Go Movement

Stop-and-go waves traditionally mark the onset of instability in unidirectional traffic at high density. For the dynamics of crowds in a corridor, we argue that the evolution of the (linear) density is a poor indicator for the detection of such waves, for at least two reasons.

• First, density is averaged across the corridor width, whereas the jammed phases do not necessarily span the whole corridor width, as we confirmed by direct visualization of the simulated flows (see Movie S4); this issue becomes all the more problematic as the corridor is wide. It also comforts the idea [START_REF] Jin | Pedestrian dynamics with different corridor widths: Investigation on a series of uni-directional and bi-directional experiments[END_REF] that pedestrians in a wide corridor can sometimes evade jammed regions through transverse motion.

• Secondly, the difference between the density ρ j in jammed phases and the density ρ f in flowing ones is fairly small, since the TTC term gets people to brake ahead of a halted person. Because in a strictly one-dimensional setting the conservation of the number of agents imposes that ρ f (v f + |w|) ρ j |w| in the steady state, where v f is the pedestrian speed in the flowing phase and w is the stop-and-go wave speed, the small difference between ρ f and ρ j entails a fairly large wave speed |w| ρ f v f ρ j -ρ f . And, indeed, in Figure 4(2), we measure a wave speed |w| ≈ 2 m/s larger than the free walking speed. We should note that this value exceeds what is typically found for stop-and-go waves in single pedestrian files, where |w| generally lies below 1 m/s [START_REF] Portz | Analyzing stop-and-go waves by experiment and modeling[END_REF].

G. Exit Capacities

In this section, we detail the quantitative results obtained in simulations of evacuation from a crowded rectangular room, expanding on the discussion initiated in the main text.

The bottleneck flow at the door is probed by computing the specific capacity

J s = 1 w • N T N
(where T N is the duration it took to evacuate N agents in the pseudo-stationary stage of the evacuation), i.e., mean flow rates per unit width of the door, for different door widths and agents' eagerness to escape, using u ∞ as a proxy for the latter.

For a 1 m-wide door, our simulations yield J s = 1.80 ped/m/s in normal conditions (u ∞ = 1.5 m/s), right between the estimate J s = 1.60 ped/m/s reported in [START_REF] Predtechenskii | Planning for foot traffic flow in buildings[END_REF] and the experimental measurements J s = 1.85 ped/m/s and J s = 1.90 ped/m/s in [START_REF] Kretz | Experimental study of pedestrian flow through a bottleneck[END_REF] and in [START_REF] Seyfried | New insights into pedestrian flow through bottlenecks[END_REF], respectively. In these last two publications, the specific capacity decreases slightly to around J s = 1.8 ped/m/s and J s = 1.6 -1.7 ped/m/s, respectively, when the door is narrowed to w = 80 cm; it drops somewhat more significantly in ANDA, to J s = 1.54 ped/m/s, still for u ∞ = 1.5 m/s, but the agreement remains acceptable.

For even narrower doors (w = 70 cm) under competitive settings (u ∞ 3.0 m/s) it must plainly be conceded that a marked discrepancy arises in the absolute values of the specific capacity, which is around J s ≈ 1.4 ped/m/s in the simulations and around J s ≈ 3.6 ped/m/s in the experiments. This can easily be explained: Our approximation of pedestrians as frictionless disks is stretched beyond any reasonable limit in a regime dominated by mechanical obstructions and contacts, and in which the shape of agents matters considerably [START_REF] Echeverría-Huarte | Pedestrian evacuation simulation in the presence of an obstacle using self-propelled spherocylinders[END_REF]. A better physical description would be attained by refining the mechanical layer using more realistic agent shapes.

H. Additional figures

Figure 1 :

 1 Figure1: Schematic representation of the algorithm. Every time step δt, the agent collects information about the environment and the other agents in his or her field of view (left), considers various test velocities, and selects the optimal one from the perspective of his/her perceived cost. The self-propulsion force corresponding to this desired velocity is implemented in the mechanical layer, which handles possible contacts or collisions and returns the agent's updated position.

e

  speed (u) = 7.6 u -35.4 u 2 for u < 0.1 m/s 0.4 + 0.6 u 2 for u 0.1 m/s.

Figure 2 :

 2 Figure 2: Avoidance maneuvers in a corridor: (a) Avoidance of a still-standing pedestrian 'obstacle' at the center; (b) trajectories of two counter-walking pedestrians. The computer simulations (coloured lines) are compared to the experiments (grey lines); the dashed lines materialize an envelope of width the standard deviation on each side of the moving average (solid line). The experimental trajectories were shifted along Y to start at Y = 0.

Figure 3 :

 3 Figure 3: Navigation of ∼ 100 agents, split into 7 groups with distinct target zones, in a complex geometric layout inspired by the ground floor of the Montparnasse train station in Paris, France. The initial positions are marked with colored disks and the solid lines that represent the trajectories evolve from blue to yellow with time.

Figure 4 :

 4 Figure 4: Unidirectional flow along a corridor of (periodic) length L X = 16 m and width L Y = 3 m. (Left) Variation of the simulated mean pedestrian speed with the density, shown along with various experimental data sets(Older [44], Mori and Tsukaguchi[START_REF] Mōri | A new method for evaluation of level of service in pedestrian facilities[END_REF], Weidmann[START_REF] Weidmann | Transporttechnik der fussgänger. transporttechnische eigenschaften des fussgängerverkehrs, literaturauswertung[END_REF] and Zhang et al.[START_REF] Zhang | Transitions in pedestrian fundamental diagrams of straight corridors and t-junctions[END_REF]). (Right) Spatio-temporal diagrams of the coarse-grained local speed, represented at different densities, as labeled in the left panel.

Figure 5 :

 5 Figure 5: Variation of the average pedestrian speed with the mean density in a bidirectional flow corridor. (Inset) Time evolution of the order parameter φ (defined in Eq. 16) for the characterization of Lane-formation phenomena. The letters (a) and (b) indicate the times corresponding to the images below. (Bottom) Snapshots of the crowd at different times, rendered with the CHAOS software developed by INRIA: (a) well-mixed crowd at the beginning of the simulation, (b) crowd structured in counter-walking lanes. Refer to the main text for the dimensions of the corridor.

Figure 6 :

 6 Figure 6: Evacuation dynamics through a narrow doorway of width w = 60 cm, centered at (0, 0). (a) Dependence of the exit capacity on the preferential speed u ∞ . (b) Survival function P (τ > ∆t) of time gaps between successive egresses. (Inset) Detailed view of the main panel to identify the relative significance of the distributions' tails. (c) Average pressure field due to physical contacts between agents in the vicinity of the exit, for u ∞ = 3 m/s.

Figure 7 :

 7 Figure 7: Impact of distracted pedestrians on the chaoticity of the flow: (a) Suddenness of turn κ in the experiments of [6], distinguished between a reference case without distracted agents ('baseline'), the distracted agents, the nondistracted people walking in the same direction and those walking in the opposite direction; (b) Suddenness of turn κ computed in our model. (c) Survival functions P (K > κ) in the reference experimental case and for different groups of agents in the simulations. The dashed grey line refers to a simulation in which the half-angle of the visual field was reduced to θ = 45 • .

Figure S1 :

 S1 FigureS1: Bio-mechanical cost e speed associated with the walking speed v in the ANDA model, given by Eq. 4, and comparison to the aggregated data of[START_REF] Ludlow | Energy expenditure during level human walking: seeking a simple and accurate predictive solution[END_REF] (adult group).

Figure S3 :

 S3 Figure S3: Spatio-temporal diagrams of the coarse-grained local density, represented at different global densities as indicated in the titles of each panel. The data employed in their construction is identical to the data displayed in the velocity fields of Figure 4.

Figure S4 :Figure S5 :

 S4S5 Figure S4: Evacuation dynamics through bottleneck of different widths, (a,d) w = 70 cm, (b,e) w = 80 cm, (c,f) w = 100 cm. The top row shows the exit capacity as a function of the preferential speed u ∞ ; the bottom row exposes the survival functions P (τ > ∆t) of time gaps τ between successive egresses.

Figure S6 :

 S6 Figure S6: Dependence of the absolute lateral distance at the beginning of the avoidance maneuver [|∆y i |, x-axis; see left panel (c)] on the absolute lateral distances when passing side-by-side [|∆y s |, y-axis; see right panel (c)]. Each data point in the scatter plot corresponds to a pair of counter-walking pedestrians: (a) Empirical data from [39] (reproduced with permission); (b) Simulations of the ANDA model. Solid lines in both cases represent the ensemble-averaged value of |∆y s | conditioned on |∆y i |. The dotted diagonal line |∆y s | = |∆y i | (no transverse deviation), in which both pedestrians keep moving straight ahead, is shown for reference. The bottom and left panels in (a) and (b) display the probability density functions (pdfs) of |∆y i | and |∆y s |.

  ), which solves Newton's equations

	Symbol	Definition	Value
		Decision-making layer
	δt	Decision-making time	0.1 s
	u ∞	Preferential speed, or	N (1.4 m/s, 0.2)
		free-walking speed
	µ	'Inertial' coefficient	0.01
	η	Repulsive coefficient	0.8
		associated with
		personal space
		Spatial extent of the	0.2
		personal space (relative
		to body width)
	d c	Characteristic	20 cm
		repulsion length of
		walls
	θ	Visual cone	70 •
		(half-angle)

Table 2 :

 2 Summary of empirical and experimental evidence in support of ANDA.

Acknowledgments

The authors are grateful to Chuan-Zhi (aka Thomas) XIE, Hakim BENKIRANE, and Iker ZURIGUEL for their input, to Hisashi MURAKAMI, Claudio FELICIANI, Mohcine CHRAIBI, Daniel PARISI, and Mehdi MOUSSAID for so readily accepting to share their experimental data. This work was partly conducted in the frame of the French-German research project MADRAS funded in France by the Agence Nationale de la Recherche (grant number ANR-20-CE92-0033), and in Germany by the Deutsche Forschungsgemeinschaft (grant number 446168800). I.E. acknowledges Ministerio de Economía y Competitividad (Spanish Government) through Project No. PID2020-114839GB-I00 MINECO/AEI/FEDER, UE and Asociación de Amigos de la Universidad de Navarra for their economical support.

Supplementary Movies

(Movie 1). Simulated collision avoidance dynamics. The movie is made of two parts: (1) the avoidance maneuver of a moving pedestrian coming across a static pedestrian and (2) the avoidance maneuver of two counter-walking pedestrians in a head-on collision. Besides, the video includes in the upper part the energy maps originated by each pedestrian based on their perceived cost, which they will have to minimize for the election of a new velocity vector (white arrow). https://drive.google.com/file/d/1L2fGup_izpplfIDFQh0NeULRVmUrm2uK/ view?usp=sharing (Movie 2). Antipodal simulation with 10 regularly spaced pedestrians with identical preferential speeds. https://drive.google.com/file/d/1XZL9ozB49iPGLCvTdyQIYNUbDNEucS3w/ view?usp=sharing (Movie 3). Navigation in a complex geometries. Simulation of 100 pedestrians within a geometry inspired by the ground floor of Montparnasse train station in Paris, France. Agents are colored according to their specific target zone. Thus, at the end of the movie, we can observe that pedestrians are grouped by color, showing that they have reached their destination. https:// drive.google.com/file/d/1fy2morxISAN6OxCAYTgxBmD8eIgvy0dg/view?usp= sharing (Movie 4). Simulated unidirectional flow in a 3m-wide corridor. The movie shows the performance of our numerical model for three different global densities (ρ = {1, 2, 3} ped/m 2 ). Agents are colored depending on their current walking speed, according to the colobar on the right. https://drive.google.com/file/d/1QiTdEIZapVgtxrpLH9ULeKshqqyc6_ CA/view?usp=sharing