ConceptioArchivearXiv CS
arXiv CSopen access

PedNStream: Scalable Network Flow Simulation for Pedestrian Traffic Management

Unknown · 2026 · arxiv_cs
arXiv CS · Papers · License: Open Access · 2026
Open Source ↗Direct PDF ↓
artificialintelligenceknowledgerepresentationreasoning
artificial intelligence, reasoning, knowledge representation

1

PedNStream: Scalable Network Flow Simulation for Pedestrian Traffic Management

arXiv:2607.01021v1 [cs.AI] 1 Jul 2026

Weiming Mai∗ , Dorine Duives and Serge Hoogendoorn

Abstract—Large-scale crowd management requires pedestrian simulations that are both computationally efficient and compatible with feedback-based control. However, most open-source tools are either microscopic or not designed for network-scale closedloop evaluation. This paper presents PedNStream (Pedestrian Network Flow Simulation), an open-source, Python-native simulator for macroscopic pedestrian network loading based on the Link Transmission Model (LTM). The framework extends LTM-based pedestrian models by incorporating stochastic link dynamics that capture diffusion and activity-induced variability, and replaces dynamic user equilibrium route choice with a utility-based formulation suited to uncertain, intervention-driven settings. PedNStream is implemented as a modular framework with built-in controller interfaces for interventions such as gating, flow separation, and route guidance. We evaluate the framework in a staged manner. Synthetic scenarios verify key mechanisms, including queue formation, spillback, congestion dissipation, and adaptive rerouting. Real-network experiments assess large-scale behavior and consistency with observed pedestrian counts. A closed-loop case study demonstrates controller integration, and a runtime analysis quantifies scalability. These results establish PedNStream as an efficient and practical testbed for large-scale pedestrian network simulation and control. Index Terms—Human mobility, link transmission model, pedestrian network simulation, crowd control

I. INTRODUCTION FFECTIVE crowd management during large events ensures pedestrian safety and prevents congestion. Simulation methods have been developed over the years to model crowd dynamics for infrastructure design and tactical management (e.g., fencing and capacity limits). Broadly, these methods fall into three categories: microscopic, agentbased models [1]–[4], and macroscopic formulations that either model pedestrian flow on networks [5]–[7] or describe pedestrian movement as spatial-temporal continuous flow [8], [9]. The third category is mesoscopic model, it provides a compromise between the level of detail of the flow description and computational complexity for the simulation of large scale scenarios [10]. Most existing simulation models for pedestrian dynamics serve a descriptive purpose: they assist practitioners and policymakers in evaluating the effects of infrastructural changes or optimizing routing and scheduling strategies under various scenarios. These tools provide insights into how crowds behave under specific conditions, but are typically not designed to support real-time, operational-level

E

Weiming Mai, Dorine Duives and Serge Hoogendoorn are with the Department of Transportation and Planning, Delft University of Technology, Delft, Netherlands. (e-mail: [email protected]; [email protected];[email protected]). ∗ : Corresponding author. Manuscript received May 15, 2026.

control, which is essential in the context of large-scale crowd management in big events. At the operational level, Molyneaux et al. [11], [12] introduced the concept of a Dynamic Pedestrian Management System (DPMS). Their work focuses on localized interventions such as flow separators and moving walkways to manage pedestrian movement in corridors, intersections, and entrances/exits. This line of research highlights the value of control-oriented pedestrian modeling, but it does not resolve the need for a scalable simulator that can evaluate such interventions over large pedestrian networks. Research on dynamic crowd management in large infrastructures or urban environments during mass gatherings, such as evacuations, festivals, or outdoor concerts, therefore remains limited in part because suitable network-scale simulation tools are still lacking. This gap is rooted in two related modeling challenges. First, agent-based microscopic models and continuum-based macroscopic models, though rich in behavioral detail, are not scalable for simulating large crowds in large public areas. The primary goal of these models is to extract trajectories from the simulator to analyze the behavioral pattern in certain scenarios, and hence their computational efficiency does not play a very vital role in this context. However, these detailed information are usually not necessary for the input of the crowd control algorithms. Second, network-based macroscopic models are fast for computation, but the models for pedestrian dynamics are underdeveloped. Existing frameworks such as the Link Transmission Model (LTM) [13], and other network-based pedestrian models [5], [6] are either adapted from vehicular traffic, ignoring pedestrian-specific bidirectional behaviors, or are not efficient enough for real-time control algorithms. These limitations hinder the development of dynamic, network-wide crowd management. Recently, Lilasathapornkit et al. [14] introduced a dynamic pedestrian traffic assignment (DPTA) model designed specifically for bidirectional sidewalk networks. Built upon the LTM framework, the model simulates pedestrian movement and congestion in large-scale urban environments. However, it adopts dynamic user equilibrium (DUE) for modeling pedestrian route choice, which may be realistic for predictable crowds in planned or recurring events, but less so in highly dynamic and stochastic settings. Moreover, the influence of dynamic control algorithms on pedestrian routing, such as guidance or management interventions cannot be adequately captured under the DUE assumption. Another limitation of the LTM-based model is that it was originally developed for vehicular traffic and thus overlooks key characteristics of pedestrian movement. In particular, it

2

TABLE I P OSITIONING OF PedNStream RELATIVE TO REPRESENTATIVE OPEN - SOURCE SIMULATION TOOLS . T HE COMPARISON HIGHLIGHTS THE TRADE - OFF BETWEEN MODELING RESOLUTION AND APPLICATION SCALE . Limited: C ONTROL IS NOT A PRIMARY USE CASE ; Indirect: C ONTROL IS FEASIBLE VIA EXTERNAL API S / WRAPPERS ; Direct: NATIVE FORMULATION FOR ITERATIVE , LEARNING - BASED , OR REAL - TIME CONTROL OPTIMIZATION . Tool

Level

Typical Scale

Primary Modeling Focus

JuPedSim [15]

Microscopic

Facility / Local

Individual locomotion

Limited

Vadere [16]

Microscopic

Facility / Local

High-fidelity crowd/evacuation dynamics

Limited

SUMO [17]

Micro/Meso

Urban / Network

Multimodal traffic

Indirect

MATSim [18]

Micro/Meso

Urban / Regional

Large-scale travel demand

Indirect

PedNStream

Macroscopic

Urban / Network

Flow-based network dynamics for control optimization

Direct

does not account for the inherent randomness in pedestrian behavior, such as individuals lingering on links to perform activities or the presence of heterogeneous walking speeds across different groups. As a result, the pedestrian flow generated by the simulation could be unrealistic. Beyond these modeling limitations, there remains a lack of open-source tools that explicitly target macroscopic pedestrian-network modeling for control-oriented applications. Instead, the current open-source software landscape is largely dominated by microscopic pedestrian simulators such as JuPedSim [15] and Vadere [16], as well as broader traffic simulators such as SUMO and MATSim, in which pedestrians appear as one component of a multimodal framework [17], [18]. As summarized in Table I, these tools emphasize microscopic detail or multimodal demand, rather than closedloop control for operational crowd management, where control actions are continuously updated based on network states such as road densities, flows, and travel times. To address these limitations and enhance the usability of network-based simulation models, we developed a Python simulation tool PedNStream, which supports large-scale pedestrian simulations and can be readily integrated with real-time crowd management strategies (e.g., crowd redirection, capacity adjustment, and flow separation). As positioned in Table I, PedNStream is a macroscopic pedestrian-network simulator for urban or event-scale applications, enabling rapid evaluation of pedestrian interventions. The contributions of this paper are threefold. First, we extend Lilasathapornkit’s model by incorporating stochasticity and diffusion behavior [19] into link dynamics, enabling more realistic representations of pedestrian flows. The DUE-based route choice model is replaced with a utility-based function, which better represents pedestrian route choice during adverse or uncertain conditions. Second, we develop PedNStream as a modular, open-source, control-oriented simulation framework for macroscopic pedestrian networks. In addition to the core simulation model, the framework includes two controller baselines, namely a rule-based gater and a pressure-based gater, and supports reproducible closed-loop evaluation of crowdmanagement strategies. Third, we evaluate the framework through a staged protocol: synthetic scenarios verify core mechanisms, flow-pattern comparisons isolate the effect of the proposed link dynamics, real-network studies assess largescale behavior, a closed-loop case study tests controller inte-

Closed-loop Control

TABLE II M AIN NOTATION USED IN THE MODEL . Symbol

Definition

t, ∆t i, j

Time index and step size. Link indices (opposite directions when paired). Node index. Cumulative inflow and outflow on link i. Sending and receiving flows on link i. Capacity, length, width and area of link i. Free-flow, shockwave and actual travel time in physical units. Directional densities. Jam and critical density. Number of pedestrians withheld on link i by activity at time t. Utility of downstream link ℓ. Turning fraction from link i to j. Flow from i to j at node n. Diffusion coefficient, diffusion calibration parameter, release probability, and activity probability.

n Ui (t), Vi (t) Si (t), Ri (t) Ci , Li , wi , Ai τf , τ ω , τ ki , kj kjam , kc Xi (t) Uℓ P (ℓj | ℓi ), pij n qij F, γ, prel , pactivity

gration, and runtime analysis quantifies scalability. The source code and installable Python package are publicly available [20], allowing researchers to reuse the tool and tailor scenarios to their own studies. The rest of the paper is organized as follows. Sections II–IV present the pedestrian-flow modeling framework, Sections V and VI describe the controller design and software architecture, and Sections VII–VIII report the experimental results. Section X concludes the paper, and the controller-baseline details are provided in the appendix. II. DYNAMIC N ETWORK L OADING P ROBLEM Dynamic Network Loading (DNL) simulates how traffic propagates through a network over time. It is a core component of Dynamic Traffic Assignment (DTA) frameworks, which model route choice under time-varying congestion. In this section, we introduce the numerical solution of the DNL problem, with particular emphasis on the Link Transmission Model (LTM). Table II summarizes the main notation used throughout the model description.

3

A. The Link Transmission Model Yperman et al. [13] proposed the Link Transmission Model (LTM), a dynamic network-loading model derived from firstorder kinematic-wave theory [21] and the principle of flow conservation. LTM consists of two coupled components: a link model that captures the evolution of traffic states within each link, and a node model that determines the admissible transfer of flow between connected links. At each time step, the link model determines how much flow can leave a link (sending flow, i.e., upstream demand) and how much flow can enter a link (receiving flow, i.e., downstream supply). The actual transfer across a link boundary is therefore limited by both quantities. For a simulation step of length ∆t, the sending flow from an upstream link i over the time interval (t − ∆t, t] is computed as follows: Si,boundary (t) = Ui (t − τf ) − Vi (t − ∆t),

(1a)

Si,link (t) = Ci ∆t,

(1b)

Si (t) = min(Si,boundary (t), Si,link (t)).

(1c)

Here, Ui (t) and Vi (t) denote the cumulative inflow and outflow of link i up to time t, respectively, and Ci is the flow capacity of the link. In the standard LTM, this capacity is treated as a fixed link-level bound. The term Si,boundary (t) represents the amount of flow that reaches the downstream boundary of link i after the free-flow travel time τf , whereas Si,link (t) imposes the link-capacity limit. Hence, the sending flow Si (t) is the minimum of these two quantities. Correspondingly, the receiving flow is written as Ri,boundary (t) = Vi (t − τω ) + kjam Li − Ui (t − ∆t),

(2a)

Ri,link (t) = Ci ∆t,

(2b)

Ri (t) = min(Ri,boundary (t), Ri,link (t)),

(2c)

where Ri,boundary (t) represents the space available for new inflow at the upstream boundary of link i. It is determined by three terms: the cumulative outflow shifted by the shockwave travel time τω , the maximum storage kjam Li , and the cumulative inflow already admitted into the link. The term Ri,link (t) imposes the link-capacity limit. Here, kjam denotes the jam density, i.e., the density at which the link is fully occupied and pedestrian movement becomes negligible. B. Link Transmission Model for Pedestrian Dynamics In this section, we first review Lilasathapornkit’s link model in the dynamic pedestrian traffic assignment framework and then introduce the link model in PedNStream. Lilasathapornkit et al. [14] extend the standard Link Transmission Model (LTM) to incorporate bi-directional interactions. In their formulation, instead of using the constant free flow speed, they introduce the effective free-flow speed v̂f (t) of a link i that is influenced by the density of its counter-directional link j. This change allows the model to adapt to actual traffic conditions, and travel time is no longer a constant. Another adjustment modifies the boundary conditions, particularly the receiving flow, as shown in Equation 3b. The key idea is that the number of pedestrians entering a downstream link is constrained not only by congestion within the link but also

by the opposing flow from the counter-directional link. The modified components are highlighted in blue in the following equations: Si,boundary (t) = Ui (t − τˆf (t)) − Vi (t − ∆t),

(3a)

Ri,boundary (t) = Vi (t − τω ) + kjam Li − Ui (t − ∆t) − Sj (t).

(3b)

In the above equations, Sj (t) denotes the sending flow of the counter-directional stream j at time step t. The effective freeflow travel time is written as T̂f (t) = Li /v̂f (t) in physical time units and τ̂f (t) = round(T̂f (t)/∆t) in simulation steps. To calculate the effective free-flow speed v̂f (t), they first calculate ρi , as the ratio of the density of the reference direction i to the density of the opposite direction j in a ki (t) . This term captures bidirectional stream: ρi (t) = ki (t)+k j (t) the relative dominance of the forward-direction flow. The effective free-flow speed is then calculated as v̂f (t) = ρλi (t)vf , where vf is the nominal free-flow speed of the link i, ki and kj are the densities of both directions, respectively. λ is a calibration parameter. C. The Refinement Model In PedNStream, the sending flow boundary is computed using the actual travel time rather than the free-flow travel time (Equation 4a), allowing it to reflect real-time within-link traffic conditions. The capacity model is also refined to better match pedestrian movement. Specifically, Ci is interpreted as a nominal discharge capacity per unit width, so the effective sending capacity becomes Ci wi ∆t as shown in Equation 4b. This means that the number of pedestrians that can leave a link during one simulation step scales directly with the usable gate width wi : narrowing a gate reduces throughput, while widening it increases the admissible flow. Unlike vehicular traffic, which is lane-based and effectively one-dimensional, pedestrian movement occurs in a two-dimensional space. Therefore, the receiving side is linked to usable area rather than only to link length. Lastly, to simulate a more stochastic and realistic pedestrian flow, we introduce the stochastic sending flow in Equation 4c, which accounts for the random behavior of the pedestrian, such as speed difference, activity performance. The adjusted models is shown as follows, with the modification marked by purple color: S̃i,boundary (t) = Ui (t − τ (t)) − Vi (t − ∆t), Si,link (t) = Ci wi ∆t,  Si (t) = min Si,boundary (t), Si,link (t),  Si,stochastic (t) ,

(4a) (4b)

(4c)

Ri,boundary (t) = Vi (t − τω ) + kjam Ai − Ui (t − ∆t) − Nj (t) − Sj (t).

(4d)

Using the time-varying travel time in Equation 4a and Equation 3a introduces a practical issue: under strong congestion or during the initial stage of the simulation, τ (t) can exceed

4

This blending rule is introduced as a practical modeling correction. Its purpose is to preserve the delayed cumulative-count interpretation under uncongested conditions while avoiding unrealistically low or unstable sending demand when the realized travel time becomes large under congestion. The factor ξi (t) acts as a congestion-dependent transition weight: for k(t) ≤ kc , the model remains governed by the delayed boundary demand, whereas as k(t) approaches kjam , the boundary demand is increasingly governed by the number of pedestrians Ni (t) currently on the link. Hence, when congestion is mild, the model remains close to the original LTM logic, whereas under severe congestion it smoothly shifts toward the occupancy-based bound. In Equation 4d, the receiving capacity depends on the link area Ai , so the term kjam Ai represents the maximum number of pedestrians that the downstream space can accommodate. This area-based formulation is more realistic for pedestrian flow than a one-dimensional receiving-length constraint. The term Nj (t) denotes the occupancy of pedestrians traveling in the opposite direction on the counter-directional link; it reduces the effective receiving space available to direction i. Without this term, the model can produce receiving flows that exceed the usable road space. All sending and receiving flows are additionally clipped to remain non-negative. In the next section, we describe how the stochastic term Si,stochastic (t) is modeled. D. Stochastic Flow Modeling The stochastic term in Equation 4c is designed to capture variability in pedestrian movement that is not represented by the deterministic LTM alone. Under free-flow conditions, we use the crowd-diffusion model of Liu et al. [19] to represent dispersion in walking speeds. Let t denote the current simulation-step index, let q̂↑ (t) denote the upstream inflow available to traverse the link, let q̂↓ (t) denote the resulting downstream outflow, and let τ (t) = round(T (t)/∆t) be the realized link travel time expressed in simulation steps. The diffused downstream flow is then computed as t−τ (t)−1

q̂↓ (t) =

X

F (1 − F )n q̂↑ (t − τ (t) − n).

(6)

n=0 1 where F (t) = 1+γT (t) is the time-dependent diffusion coefficient, γ is a calibration parameter, and T (t) is the realized

link travel time in physical time units. This formulation distributes the release of a cohort over several subsequent time steps, so larger travel times or larger values of γ produce a more dispersed downstream outflow profile. As illustrated in Figure 1, when γ = 0 the downstream outflow is nearly a timeshifted copy of the inflow, whereas larger values of γ flatten the peak and spread the discharge over a longer interval. Inflow

Count (peds / 10 s)

the elapsed horizon, so the delayed argument t−τ (t) becomes non-positive and the raw cumulative-count term Ui (t−τ (t))− Vi (t − ∆t) no longer provides a reliable boundary demand. In the implementation, we therefore apply two adjustments. First, T (t) is computed as a moving average of the instantaneous link travel time rather than using the instantaneous value directly, so that τ (t) evolves more gradually and the boundary computation remains numerically stable. Second, the quantity in Equation 4a is clipped to remain non-negative, and the boundary sending flow is blended   with a density-dependent c , 0, 1 . The resulting congestion factor ξi (t) = clip kk(t)−k jam −kc boundary sending flow is then computed as  Si,boundary (t) = ξi (t)Ni (t) + 1 − ξi (t) S̃i,boundary (t). (5)

Outflow, γ = 0

Outflow, γ = 0.01

10 8 6 4 2 0 0

100

200

300

400

Time (s)

Fig. 1. Illustration of the effect of the diffusion parameter γ on downstream outflow under free-flow conditions. Larger γ values produce a broader and lower-peaked outflow profile.

Under congested conditions, PedNStream shifts from the diffusion model to a stochastic release model. Specifically, the number of pedestrians released during step t is drawn from a binomial distribution whose trial count is given by the boundary sending flow and whose success probability is prel . The release probability prel is introduced to represent the fact that, under congestion, physical eligibility to leave a link does not guarantee immediate discharge. Local crowd interactions, hesitation, speed adjustment, and competition for limited exit space can all prevent some pedestrians from leaving during a given time step. The binomial release model therefore converts the deterministic boundary sending flow into a stochastic realized outflow, allowing the model to capture step-to-step variability and reduced discharge efficiency in congested pedestrian movement. Moreover, if activity behavior is enabled, a second binomial draw with probability pactivity represents pedestrians who remain on the link to perform activities, and this quantity is subtracted from the stochastic sending term. These parameters are not treated as universal constants. Instead, PedNStream provides a flexible modeling framework in which parameters such as γ, prel , and pactivity are specified according to the application context, available data, and modeling objectives. When empirical observations are available, these parameters can be calibrated to match observed flow dynamics, such as discharge rates or dwell behavior. Algorithm 1 summarizes the step-wise procedure used to compute the stochastic sending flow update for a link.

5

Algorithm 1 Stochastic sending flow update on link i Require: t and T (t); link densities ki (t) and kj (t); free-flow travel time in steps τf Require: Parameters ∆t, γ, kc , prel ∈ [0, 1], and pactivity ∈ [0, 1]. 1: procedure C AL S ENDING F LOW (t) ▷ t = current time step 2: k(t) ← ki (t) +kj (t)  T (t) 3: τ (t) ← round ∆t 4: if t < τf then ▷ initial stage 5: return Si (t) ← 0 6: end if 7: Compute Si,boundary (t) according to Equation 5. 8: Compute Si,link (t) according to Equation 4b. 9: if k ≤ kc then ▷ free-flow regime 10: Si,stochastic (t) ← crowd_diffusion(τ (t), γ) 11: else ▷ congested regime 12: Acquire the flow releasing probability prel . 13: Si,stochastic (t) ∼ Bin (⌊Si,boundary (t)⌋, prel ) 14: end if 15: if pactivity > 0 then ▷ activity effect 16: Xi (t) ∼ Bin (⌊Si,boundary (t)⌋, pactivity ) 17: Si,stochastic (t) ← Si,stochastic (t) − Xi (t) 18: end if 19: Update Si (t) with Equation 4c. 20: end procedure Ensure: Si (t)

pairs Pod . Because the unobserved population heterogeneity ϵℓ is Gumbel-distributed, the conditional probability of choosing ℓ↓ given ℓ↑ and π at time t is formulated as a Multinomial Logit (MNL) model:  exp Vℓπ↓ (t) , (8) Pt (ℓ↓ | ℓ↑ , π) = P π ℓ′ ∈D(ℓ↑ ) exp Vℓ′ (t) where D(ℓ↑ ) denotes the set of feasible downstream links from ℓ↑ . The aggregate turning fraction Pt (ℓ↓ | ℓ↑ ) at time t is then obtained by applying the law of total probability: X Pt (ℓ↓ | ℓ↑ ) = Pt (ℓ↓ | ℓ↑ , π) Pt (π | ℓ↑ ) . (9) | {z } | {z } π∈P od

Here, Vℓπ (t) represents the fluctuating deterministic component of the utility at time t. It consists of the observable link attributes xπℓ (t) weighted by the calibrated coefficient vector θ, and a time-varying stochastic shock term ηℓ (t) ∼ N (0, σ 2 ) which captures momentary fluctuations in link conditions or collective perception. The term ϵℓ is an independently and identically distributed (i.i.d.) Gumbel random error term, representing the unobserved cross-sectional dispersion in pedestrian route preferences. Let ℓ↑ denote the upstream link and ℓ↓ denote a candidate downstream link. Let π be an OD pair within the set of all OD

C

C

III. DYNAMIC ROUTE C HOICE WITH U TILITY F UNCTION To simulate the behavior of pedestrian route choice, we apply the route choice model described in [3] to calculate the macroscopic turning fractions at intersections. First, kshortest paths are generated for each OD pair. Next, link attributes, such as distance-to-destination, travel time, and comfort level, are used to evaluate the utility of selecting a candidate downstream link. To capture both the unobserved preference heterogeneity of the pedestrian population and the time-varying stochastic fluctuations in the network state, we formulate a time-dependent utility function. To avoid conflict with the cumulative inflow notation Ui (t) in the LTM section, we denote the perceived destination-specific utility of choosing link ℓ given OD pair π at time step t as Uℓπ (t):   Uℓπ (t) = Vℓπ (t) + ϵℓ = θ T xπℓ (t) + ηℓ (t) + ϵℓ . (7)

OD-conditional link choice

OD ratio

Here, Pt (π | ℓ↑ ) denotes the conditional OD ratio at time t, i.e., the probability that a pedestrian on the link ℓ↑ belongs to the pair of OD π, calculated from the demand for OD over time. The computation of Pt (ℓ↓ | ℓ↑ ) is illustrated in Figure 2. The left panel shows a network with two origins and three destinations, where node B lies on the paths of six OD pairs. The right panel is the route-choice probability graph of node B. To evaluate the turning probability from upstream link A–B to downstream link B–C, we first identify the OD pairs whose paths include this movement, namely O1 D1 , O1 D2 , O2 D1 , and O2 D2 . We then enumerate the feasible paths for these OD pairs and aggregate those that traverse the link pair, as illustrated in the figure.

A

B

D E

C

D

E

...

D

...

B A

Fig. 2. An illustration of the route choice computation module. The green path represents the OD-conditional link choice probability, and the red path represents the OD ratio.

IV. F LOW A SSIGNMENT WITH T WO N ODE M ODELS To determine the movement of the crowds, e.g., from which upstream links to which downstream links. We provide two implementations of the flow assignment method in PedNStream. We consider both normal and evacuation scenarios; in a normal scenario, we adopt the node model described in [13] to n determine the intermediate flow qij on a node n between two links i and j: ! n n p S ij i n n n n qij . (10) = min P n n Rj , pij Si l∈up plj Sl Where pnij denotes the route choice probability from link i to link j, which is the turning fraction described in the previous section (i.e., pnij ≡ P (ℓj | ℓi )). Rjn represents the

6

total receiving flow of downstream link j at node n, and Sin is the total sending flow of upstream link i at node n. Based on this formula, the flow is assigned according to available downstream space and upstream sending demand. In an evacuation scenario, the flow assignment problem is modeled as a flow maximization problem [14], e.g. we want the total sum of the flow on the links can be maximized under the capacity and turning fraction constraints: XX n qij , n∈N (11a) max n {qij }

s.t.

i j n qij ≥ 0,

qin =

X

∀i, j,

(11b)

n qij ≤ Sin ,

∀i,

(11c)

n qij ≤ Rjn − S̃jn ,

∀j,

(11d)

∀i, j.

(11e)

j

qjn =

X

i n qij = pnij qin ,

Constraint 11b enforces non-negativity of link-to-link flows. Constraint 11c bounds the total outflow from each upstream link by its sending capacity. Constraint 11d bounds the total inflow to each downstream link by its effective receiving capacity and the demand from the opposing link S̃jn . Constraint 11e preserves the prescribed turning fractions. Both node models are implemented in PedNStream, and users can select either one through the configuration file. V. C ONTROLLER D ESIGN PedNStream is a simulator designed to integrate and test crowd control algorithms. We provide two abstractions of control devices that can be implemented in the simulator: the Separator and the Gater, the diagrams of each are illustrated in Figure 3. A. Gater

B. Separator

moving walkway or the width of a flow separator [12], rather than by directly setting traffic variables. In PedNStream, a link is a unidirectional corridor with front and back gates that control the outflow and inflow, respectively. A street is therefore represented by two unidirectional links that share the same physical space. A Separator is a controller located on a link. It is modeled as a unidirectional link, ignoring bidirectional flow dynamics, and its width can be adjusted to change the effective link area. The Gater is a controller located at a node, it modifies the width of the front or back gates of the connected links and thereby adjusts their capacities according to Equation 4b. One can easily adapt the flow-separate control algorithm in [12] to adjust the width of each direction using the Separator controller. Accordingly, we design two control algorithms, which are a rule-based control and a pressure-based control. Specifically, rule-based dependents on manually designed thresholds to determine the gate width, another one utilize the concept of pressure, e.g., the difference between the upstream and downstream density. The input of the controller is the observed local traffic state, i.e., the density of the links, and the controller outputs the actual width of the gate in order to limit the inflow, or to influence the route choice of pedestrians by reducing the road capacity. The details of these two algorithms are included in Appendix A. VI. S IMULATION F RAMEWORK AND S OFTWARE A RCHITECTURE The overall simulation framework is illustrated in Figure 4, while Figure 5 summarizes the software architecture. Together, these figures provide two complementary views: (i) the dependency structure of the main modeling components, and (ii) the execution pipeline from scenario specification to simulation outputs. A. Scenario Definition and Network Assembly

Adjustable gate width Adjustable corridor width Pedestrian moving direction

Fig. 3. Two controller designs in PedNStream. (A) The gater limits the in/outflow and redirects the flow of an intersection by adjusting the width of the back/front gate to ensure people can move without gridlock in a high-demand scenario. (B) Pedestrians don’t share the same space, and the bidirectional flow doesn’t interact with each other. The separator reduces bidirectional interference and determines the width of each direction to minimize the traveling time.

In many existing studies, the control device is assumed to output a real-time in/out flow rate or the number of people allowed to enter an area [22], [23]. However, in practice, no physical device can directly enforce an exact flow rate, and precisely controlling the number of people entering is often impractical in open environments. To reflect more realistic conditions, we assume that control is applied by adjusting the physical configuration of the device, such as the speed of a

Each simulation scenario is defined under datasets/ <scenario_name>/. The file sim_params.yaml stores model and controller parameters, while the adjacency matrix, link lengths, and node positions specify the physical network. During initialization, these inputs are parsed and converted into runtime objects representing the network, OD information, demand profiles, and candidate paths. The framework distinguishes between general intersection nodes and oneto-one transfer nodes, and it also supports separator links as specialized link objects. This design separates scenario specification from model logic, improving reproducibility and simplifying reconfiguration across case studies. B. Execution Pipeline Once the network is assembled, the simulator executes a repeated network-loading procedure over t = 1, . . . , Tmax . At each time step, it (1) updates turning fractions from current route utilities, (2) solves node transfer flows, (3) updates link densities and flows, and walking speeds. The dashed dependency links in Figure 5 indicate how the LTM-based routing,

7

Simulation I nput

Dynamic L oading Step

Controller I nter vention

Networ k Tr affic State at Time T

Network Dynamics Setup

Density

- Link-Specific FD

0

1

0

1

1

0

1

0

0

1

0

1

1

0

1

0

L ink: Supply-Demand Calculation Link Capacity

Node: Pedestrian Flow Assignment - Network Adjacency Matrix

Route Choice Update

I nit

Controller : Perceive & Make Decision

Determine Turning Fractions

Nodes Type

Upstream Downstream

- K-shortest Paths between OD pairs

Origins Destinations Regular

T

Simulation outputs: - In/out Flow at Nodes - Link-level: Flow, Density, Speed, # of Peds

Route Choice

Time

- Temporal OD Demand

T+1

Fig. 4. The simulation framework of PedNStream. The controller intervention layer is added after dynamic loading layer to enable control strategy evaluation.

datasets/<scenario>/

sim_params.yaml (config) adj_matrix.npy (topology) edge_distances.pkl (lengths)

node_positions.json (layout)

sim_params.yaml + spatial (adjacency, distances, positions)

env_generator.py NetworkEnvGenerator load_network_data create_network

network.py > Network link.py Link: shared physical space Separator: no bi-directional effect

1. Build nodes & links 2. Init ODManager, DemandGenerator 3. Init PathFinder: k-paths

node.py

Network.network_loading

RegularNode: LP / proportional OneToOneNode: pass-through

For t = 1 . . . Tmax : 1. Turning fracs (PathFinder) 2. Flow assignment (Node) 3. Update density (Link) 4. Update speeds (Link)

path_finder.py PathFinder: find k-shortest paths with utilities U = αd + βk − ωc

A. Scenario and Network Design The synthetic network layouts are shown in Fig. 6, and representative simulation snapshots are shown in Figure 7. In all cases, red nodes denote origins and pink nodes denote destinations. For scenarios with origin–destination pairs, PedNStream precomputes multiple shortest paths to enable dynamic route choice during simulation.

(a) Long Corridor

(b) Branching Queues

(c) Spike

(d) Six Intersections

End & Collect Results

od_manager.py ODManager: OD demand DemandGenerator: arrivals

one pedestrian traffic phenomenon and verify that PedNStream reproduces it under controlled conditions, as summarized in Table III.

Fig. 6. Four synthetic networks. Module Flow ClassName

File Ref. method()

TABLE III S YNTHETIC NETWORK DESIGNS AND SCENARIO FOCUS Fig. 5. PedNStream architecture and simulation workflow. It consists of three main components: the data and configuration layer, core LTM modules for network construction, and the execution pipeline for network loading.

Network Design Long Corridor (Fig. 7(a)) Branching Queues (Fig. 7(b))

demand, node, and link modules support these operations. This pipeline is modular, allowing individual components such as routing models, node solvers, and controllers to be extended without altering the overall execution flow. VII. S YNTHETIC S CENARIO E VALUATION Our evaluation is organized from controlled mechanism checks to larger application studies. We begin with four representative synthetic scenarios, each designed to isolate

Spike (Fig. 7(c)) Six Intersections (Fig. 7(d))

Scenario Focus Pedestrians enter from both ends to evaluate bidirectional flow interactions. A downstream bottleneck is introduced to examine queue formation and spillback. A sudden demand surge causes intersection blockage, testing congestion recovery. Dynamic route choice is evaluated under time-varying traffic conditions.

Long Corridor: We simulate bidirectional pedestrian flow in a long corridor to examine counterflow interference. As shown in Figure 7(a), pedestrians enter from both ends and initially move under near free-flow conditions. As demand increases, the two opposing streams compete for the same corridor space,

8

(a)

(b)

(c)

(d)

Fig. 7. Simulation snapshots for four synthetic networks. (a) Long corridor. (b) Branching queues. (c) Spike. (d) Six intersections.

reducing walking speed and causing congestion to emerge and propagate toward both entrances. This scenario highlights the model’s ability to capture mutual hindrance and queue formation in bidirectional pedestrian flow. Branching Queues: In this network (Figure 7(b)), pedestrians enter from both ends of a fork-shaped corridor. A downstream bottleneck is introduced by narrowing the back gate of link 2– 3 to 0.5 m. As a result, pedestrians begin to accumulate on link 1–2 between 300 s and 3000 s, and the resulting queue propagates upstream into links 0–1 and 4–1. This scenario illustrates how a local capacity restriction can trigger queue growth and spillback through the upstream network. At 3000 s, the back gate is reopened to 1.0 m, after which the queue gradually dissipates and the network returns toward normal flow conditions. Spike: This case evaluates recovery from sudden congestion. Unlike vehicular traffic, pedestrian movement is more adaptive and stochastic: even under severe congestion, individuals can squeeze through local gaps. In Figure 7(c), pedestrians become blocked around intersection 3, and near-gridlock forms at t = 5000 s. As the simulation continues, congestion gradually eases because stochasticity in the sending flow creates additional movement opportunities. Six Intersections: This scenario examines dynamic route choice using the utility function in Section III, which incorporates distance, link density, and capacity. Initially, pedestrians traveling from node 1 to node 5 choose the shortest path via link 1–3. At 500 s, increasing density on link 1–3 prompts a small fraction of pedestrians to divert via link 1–0. At 1100

s, the front gate of link 1–3 is narrowed to 0.1 m, triggering substantial rerouting toward link 3–2. The resulting flow shifts are consistent with the utility design, supporting the validity of the route choice mechanism. Overall, these experiments show that PedNStream can reproduce key pedestrian traffic phenomena, including bidirectional interference, queue spillback, congestion recovery, and adaptive routing, while responding realistically to control interventions. The simulator’s flexibility supports systematic testing of both static network designs and dynamic control strategies under various conditions. B. Pedestrian Flow Pattern Comparison To further illustrate the effect of the proposed link dynamics, we compare the inflow and outflow patterns generated by three models: the original LTM, PedNStream, and the bidirectional LTM. Figure 8 presents a representative link pair in the Long Corridor scenario. The left and right columns correspond to the two opposing travel directions. In the original LTM, the two directions exhibit similar flow profiles because the model does not explicitly account for interactions between opposing streams. In contrast, both PedNStream and the bidirectional LTM show direction-dependent flow patterns, where the outflow in one direction is influenced by the inflow in the opposite direction. Compared with the bidirectional LTM, PedNStream produces smoother and less oscillatory flow patterns because of the added stochastic and diffusion effects. Figure 9 provides a second comparison in the Spike network under near-gridlock conditions. In this case, link 4–3 reaches

9

jam density after approximately 2800 s (see Figure 7(c)), after which the demand on that link drops to zero. Accordingly, the inflow of link 4–3 also drops to zero, as shown in the left column of Figure 9. The standard LTM still shows relatively high inflow and outflow on the opposite-direction link 3–4, implying unrealistically unconstrained movement under severe congestion. By contrast, the bidirectional LTM suppresses the opposite-direction inflow almost completely, indicating that no usable space remains. PedNStream produces an intermediate behavior: the opposite-direction flow is strongly reduced, but a small releasing flow is still maintained, which is more consistent with the intended modeling assumption that pedestrians can occasionally squeeze through local gaps even under highly congested conditions. Together, these examples qualitatively show that PedNStream preserves the bidirectional interaction mechanism while producing smoother and more dispersed flow profiles because of the added stochastic and diffusion effects.

0

0 20

10

10

PedNStream

10

Flow [peds/10 s]

10

20

0

0

20

20

Bi-LTM

LTM

Link 3-2 20

Flow [peds/10 s]

Flow [peds/10 s]

Link 2-3 Inflow Outflow

20

10

10

0

0

500

1000

1500

2000

2500

3000

0

0

500

1000

Time [s]

1500

2000

2500

3000

Time [s]

Fig. 8. Qualitative comparison of inflow and outflow patterns on link pair 2– 3/3–2 in the Long Corridor scenario. From top to bottom: LTM, PedNStream, and bidirectional LTM.

Link 4-3

LTM PedNStream

Flow [peds/10 s] Flow [peds/10 s]

Bi-LTM

Flow [peds/10 s]

40

40 Inflow Outflow Jam period

30 20

30 20

10

10

0 40

0 40

30

30

20

20

10

10

0 40

0 40

30

30

20

20

10

10

0

0

2000

4000

6000 Time [s]

Link 3-4

8000 10000 12000

0

0

2000

4000

6000

8000 10000 12000

Time [s]

Fig. 9. Qualitative comparison of inflow and outflow patterns on link pair 4–3/3–4 in the Spike scenario under near-gridlock conditions. From top to bottom: LTM, PedNStream, and bidirectional LTM.

VIII. R EAL N ETWORK E VALUATION After the mechanism-level and comparative tests above, we examine PedNStream on two real-world sidewalk networks (Delft and Melbourne city centers) to assess whether the same model scales to larger, more heterogeneous settings and remains broadly consistent with observed pedestrian counts. A. Large-Scale Dynamics in Delft The Delft city-centre network consists of 298 nodes and 818 links. For a simulation of 500 steps (84 minutes) with a total demand of 46,501 pedestrians, the runtime is approximately 45 seconds. The resulting network state is shown in Figure 10. For each origin–destination pair, three paths are precomputed to determine the turning fractions at the nodes along each path. The Delft simulation shows that PedNStream can represent network-wide pedestrian propagation and the emergence of localized congestion. After approximately 4,500 s, two main hotspots appear: the central bridge and the main road connecting the major origins and destinations. These locations act as shared critical corridors, where heavy demand concentrates and congestion becomes most visible. To examine the simulated traffic dynamics in more detail, we analyze two representative OD paths, 0–8 (north to south) and 142–80 (east to west), shown in Figure 11a. The spacetime diagram for path 0–8 in Figure 11b shows that severe congestion first emerges around 200–300 m along the path and then gradually propagates upstream, indicating spillback from a downstream bottleneck. The second diagram, Figure 11c, shows two wedge-shaped congestion patterns that correspond to the two main hotspots highlighted in Figure 11a. Together, these path-based views provide a more detailed picture of how congestion forms, propagates, and interacts with route structure in the Delft network. B. Partial Validation with Melbourne Count Data To complement the Delft dynamics analysis, we next test whether PedNStream can recover useful aggregate patterns from partial real-world observations. We use pedestrian count data from the Melbourne pedestrian counting system 1 to examine whether the simulated network dynamics are consistent with the observed flows. Because the dataset contains counts only, without OD demand or turning-fraction information, this case study should be interpreted as a partial-observation validation rather than as a strict predictive test. Figure 12a shows the sensor locations (blue markers) together with the nodes of the simulated network (red points). We first compare the simulated outflow of PedNStream and the bidirectional LTM at a representative location in Figure 12b. Both models follow the overall pattern in the observed count series, but PedNStream yields a lower root mean square error (RMSE = 16.6) than Bi-LTM (RMSE = 18.2), suggesting that the stochastic link dynamics help capture local flow fluctuations more faithfully. We then evaluate the model at the network level using all 92 sensors. In each experiment, we select a subset of 1 Melbourne pedestrian counting system sensor locations dataset.

10

t = 200 s

t = 400 s

t = 1750 s

t = 4500 s

Fig. 10. Simulation visualization of Delft city centre. Red markers denote nodes serving as both origins and destinations, blue markers with flags indicate destinations only, and normal markers represent origins. Remaining circular points depict link connection nodes.

0 142

80

8

Time (steps)

1000 800

400

600 400

200

200 0

0

100

200

300

400

500

0

600

Travel time (time units)

(a) Representative paths 0–8 (light yellow) and 142–80 (light blue) in the Delft network.

Distance along path (m)

Time (steps)

1000 800

400

600 400

200

200 0

0

200

400

600

800

1000

1200

0

Travel time (time units)

(b) Space-time diagram for path 0–8.

Distance along path (m)

(c) Space-time diagram for path 142–80. Fig. 11. Space-time diagrams of two main paths in the Delft center.

sensors as observed inputs and use their count series to drive the simulation, while the remaining sensors are reserved for evaluation. This setup tests whether the simulator can reconstruct aggregate spatiotemporal flow patterns from sparse observations, rather than whether it can exactly reproduce the true propagation of every flow stream. We consider observation sets of 5, 10, and 20 sensors. The evaluation metrics are the percentages of cases with GEH < 5 and GEH < 10, the vol-

ume ratio, the normalized root mean square error (NRMSE), and the normalized dynamic time warping (NDTW) distance. GEH measures agreement between simulated and observed volumes over a time interval, with values below 5 commonly interpreted as indicating good agreement [24]. The volume ratio quantifies bias in total flow magnitude, whereas NRMSE and NDTW assess amplitude error and temporal-shape mismatch, respectively. Our study utilizes a 24-hour window of minute-level data spanning 2025-05-24 15:55 to 2025-05-25 15:55. Due to sensor noise and occasional malfunctions, some count series are discontinuous, so we aggregate the data into 15-minute intervals for the final comparison. As a comparison method, we use a simple spatial KNN baseline, which estimates each unobserved sensor by a distance-weighted average of its k nearest observed sensors. We also test a simple OD-informed variant of PedNStream, in which candidate OD weights are heuristically calibrated by normalizing Pearson correlation coefficients. The results are shown in Table IV. As shown in Table IV, both variants of PedNStream consistently outperform the KNN across all observation settings. Even without OD calibration, PedNStream yields substantially lower NRMSE and NDTW, indicating that it better reconstructs network-wide temporal patterns than a purely spatial interpolation method. The OD-informed variant further improves the GEH-based matching rates in most settings, especially when more sensors are observed, suggesting that even a lightweight calibration of latent route structure can improve aggregate volume consistency. Since this experiment does not use ground-truth OD flows or turning fractions, these results should be interpreted as evidence of network-level inference under sparse sensing rather than as a definitive predictive validation. IX. C LOSED -L OOP C ONTROL AND RUNTIME A NALYSIS A. Crowd Management Case Study To demonstrate the simulator’s compatibility with closedloop crowd management, we apply the Gater controllers introduced in Section V to the Delft pedestrian network. The experiment contains 132 OD pairs and a festival-like demand pattern with two peaks around t = 1300 s and t = 3700 s. We place seven Gaters around the area highlighted by the

11

TABLE IV M ELBOURNE PARTIAL - OBSERVATION VALIDATION . O BS . DENOTES THE NUMBER OF SENSORS TREATED AS OBSERVED INPUTS , AND METRICS ARE COMPUTED ON THE REMAINING SENSORS . E NTRIES REPORT MEAN ( STD ) ACROSS 7 RUNS . B OLD INDICATES THE BEST VALUE PER SETTING . ↑ HIGHER IS BETTER ; ↓ LOWER IS BETTER ; ≈1 CLOSER TO 1 IS BETTER .

GEH < 5 (%) ↑

GEH < 10 (%) ↑

Vol. Ratio ≈1

NRMSE ↓

NDTW ↓

PedNStream (w/o OD) PedNStream (w/ OD) KNN

6.57 (4.58) 4.43 (3.41) 2.71 (2.36)

13.71 (5.44) 10.86 (4.85) 3.71 (2.98)

1.23 (0.57) 1.16 (0.44) 5.06 (1.79)

1.60 (0.45) 1.63 (0.37) 4.57 (1.59)

1.25 (0.37) 1.32 (0.31) 4.47 (1.60)

10

PedNStream (w/o OD) PedNStream (w/ OD) KNN

6.00 (2.96) 6.22 (3.87) 1.67 (2.83)

11.56 (2.92) 13.00 (4.50) 3.22 (4.38)

2.33 (0.82) 2.31 (0.71) 5.92 (2.20)

2.51 (0.77) 2.56 (0.64) 5.35 (2.03)

2.05 (0.69) 2.13 (0.57) 5.23 (2.03)

20

PedNStream (w/o OD) PedNStream (w/ OD) KNN

3.00 (2.16) 4.00 (3.87) 2.00 (2.08)

7.86 (5.08) 9.43 (6.40) 3.29 (3.04)

3.75 (1.33) 3.89 (1.35) 5.24 (0.92)

3.87 (1.33) 4.02 (1.38) 4.67 (0.81)

3.27 (1.18) 3.44 (1.25) 4.57 (0.82)

Obs.

Method

5

The rule-based controller yields the highest average link flow, whereas the pressure-based controller produces smoother behavior and a higher average walking speed. This difference is consistent with the controller design, since the pressurebased method responds not only to local intersection density but also to upstream density conditions.

Origin

B. Runtime and Scalability Analysis Dest inat ion

Flow [peds/min]

(a) Melbourne city-centre sidewalk network. Blue marks denote the location of the sensors.

Real Outflow PedNStream (RMSE=16.6) Bi-LTM (RMSE=18.2)

40

100

20 0

75

20

40

60

50

100

80

50 25 0

0

150

Time [mins]

200

250

(b) Observed and simulated flow comparison at a representative location. In this comparison, kc = 2 peds/m2 and vf = 1.1 m/s. The diffusion coefficient γ is set to 0.1, and the activity probability pactivity is 0.5. Fig. 12. Comparison between real counting data and simulated data.

red square in Figure 13(a), where pedestrian interactions are most frequent. Each gater adjusts local gate widths based on observed link densities, thereby regulating inflow into the congested area and mitigating spillback at nearby intersections. This setup allows us to evaluate whether simple local feedback can improve network performance under strongly time-varying demand. We evaluate the control effect on path 0–8, which traverses the regulated area and therefore reflects the local impact of the gating strategies. As shown in Figure 13(b) and Figure 13(c), both control strategies improve performance on this path.

Theoretically, PedNStream has a time complexity of O(T (N + E)), where N is the number of nodes appearing on the candidate paths between OD pairs, E is the number of links in the network, and T is the number of simulation time steps. Specifically, at each time step the model computes turning fractions for the nodes on the OD paths and updates the state of every link. For networks of the same size, the main computation bottleneck therefore scales with the number of nodes appearing on the OD paths. The space complexity is O(T × E), because each link pre-allocates state arrays (e.g. flow, speed, and density) of length T for the full simulation horizon. Finally, we quantify computational scalability by varying the total demand and the number of OD pairs while keeping the network topology and simulation horizon fixed. The experiment is performed on a MacBook Pro with an Apple M1 Pro CPU, 16 GB RAM, and a 500 GB SSD. Figure 14 shows that runtime changes little with total demand but increases approximately linearly with the number of OD pairs. This pattern is consistent with the cost of route-choice and turning-fraction updates depending more strongly on OD-pair complexity than on the absolute number of pedestrians. Furthermore, we test whether the model’s speed is significantly affected by the number of controllers, and the rightmost panel shows that runtime increases incrementally. Overall, these results suggest that PedNStream remains suitable for evaluating crowd-control strategies in large-scale pedestrian networks, while the number of OD pairs is the main factor affecting scalability in the tested settings. X. C ONCLUSION AND F UTURE W ORK In this paper, we presented PedNStream, a network-based pedestrian flow simulation tool built upon the original Link

12

(a)

0.8

(c)

Average Link Flow [peds/m/s]

(b)

0.6

1.0 0.8

0.4

0.6

w/o Control Pressure-Based Control Rule-Based Control

0.2 0.0

Pressure-Based

Average Walking Speed [m/s]

Rule-Based

w/o Control

0

1000

2000

Time [s]

3000

4000

5000

0.4

w/o Control Pressure-Based Control Rule-Based Control 0

1000

2000

Time [s]

3000

4000

5000

Fig. 13. (a) Simulation snapshots with crowd management strategies at t=5000 s. Seven Gater controllers are placed around the area highlighted by the red square. (b) The averaged link flow on the path 0–8. (c) The averaged walking speed on the path 0–8. The metrics are averaged over 5 random seeds.

Runtime (s)

50 40 30 20 10 0 15

20

25

Total Demand (×10³ peds)

50 40 30 20 10 0

50

100

# of OD Pairs

50 40 30 20 10 150 0 0

20

40

# of Controllers

Fig. 14. Runtime analysis of PedNStream. Left: runtime with an increased demand profile and 20 OD pairs. Middle: runtime with an increased number of OD pairs. Right: runtime with an increased number of controllers, with 132 OD pairs.

Transmission Model (LTM). The staged evaluation shows that the framework can reproduce mechanism-level pedestrian phenomena in controlled synthetic settings, generate plausible large-scale dynamics that remain consistent with observed count data, and support closed-loop crowd-management at manageable runtime. It therefore offers a coherent bridge between descriptive pedestrian-network simulation and controloriented experimentation. PedNStream provides a foundation for developing real-time, large-scale crowd management algorithms and serves as a testbed for adapting traffic control methods originally designed for vehicular networks to pedestrian contexts. Future work will focus on integrating reinforcement learning and optimizationbased controllers for automated crowd management, as well as validating the model using additional real-world datasets across diverse urban environments. A PPENDIX A RULE -BASED AND P RESSURE -BASED G ATE C ONTROLLERS We implement two baseline controllers that operate on the same observation and action interfaces. Both are decentralised: each junction controller acts on its local set of gates G independently, using only features observable at that junction. The two controllers differ in how they map local congestion information to a gate-width adjustment.

a) Rule-Based Controller (Algorithm 2).: The rule-based controller applies a discrete bang-bang update driven by a density threshold k ⋆ . For every gate g, the own-direction density k(g) is compared against k ⋆ ; when exceeded, the gate is closed by a fixed step ∆w. A secondary rule handles the case in which neither direction of a bidirectional link is individually congested but their combined density still exceeds the threshold: the dominant direction is throttled so that the less-loaded direction retains priority. When no congestion signal is detected, the gate is opened by ∆w. This controller is simple and interpretable, but its fixed step size and hard threshold make it oscillation-prone near k ⋆ and insensitive to the magnitude of congestion. Algorithm 2 Rule-Based Gate Control Require: Set of controlled gates G at junction u; density threshold k ⋆ ; fixed step ∆w Require: For each g ∈ G: own-direction density k(g), paired density k ′ (g), and current width w(g) 1: procedure RULE BASED C ONTROL(G, k ⋆ , ∆w) 2: for each gate g ∈ G do 3: if k(g) > k ⋆ then 4: a(g) ← w(g) − ∆w 5: else if k(g) + k ′ (g) > k ⋆ ∧ k(g) ≥ k ′ (g) then 6: a(g) ← w(g) − ∆w 7: else ▷ safe to open the gate 8: a(g) ← w(g) + ∆w 9: end if 10: end for 11: end procedure Ensure: Target gate widths a(g) for all g ∈ G b) Pressure-Based Controller (Algorithm 3).: The pressure-based controller is inspired by max-pressure control from vehicular traffic signal literature [25]. For each gate g, it defines a local pressure P (g) = kup (g) − kdown (g), i.e. the difference between upstream demand and downstream resistance. A proportional law δ(g) = clip(K · P (g), −∆max , +∆max )

13

translates pressure into a continuous, rate-limited width adjustment: the gate opens aggressively under high positive pressure, closes under negative pressure, and remains nearly stationary near equilibrium. Compared to the rule-based variant, this controller is smoother, naturally scales its response to the severity of imbalance, and requires no threshold tuning beyond the gain K and the safety clamp ∆max . Both controllers produce target gate widths that are subsequently clipped to their physical bounds [0, width(ℓ)], ensuring feasibility regardless of the controller’s raw output. They therefore serve as lightweight, interpretable baselines against which the benefits of learned, globally-coordinated policies can be measured. Algorithm 3 Pressure-Based Gate Control Require: Set of controlled gates G at junction u; proportional gain K; per-step bound ∆max Require: For each g ∈ G: upstream density kup (g), downstream density kdown (g), and current width w(g) 1: procedure P RESSURE C ONTROL (G, K, ∆max ) 2: for each gate g ∈ G do 3: P (g) ← kup (g) − kdown (g) 4: δ(g) ← clip(K · P (g), −∆max , +∆max ) 5: a(g) ← w(g) + δ(g) 6: end for 7: end procedure Ensure: Target gate widths a(g) for all g ∈ G R EFERENCES [1] D. Helbing and P. Molnar, “Social force model for pedestrian dynamics,” Physical review E, vol. 51, no. 5, p. 4282, 1995. [2] V. J. Blue and J. L. Adler, “Emergent fundamental pedestrian flows from cellular automata microsimulation,” Transportation Research Record, vol. 1644, no. 1, pp. 29–36, 1998. [3] W. Daamen, “Modelling passenger flows in public transport facilities,” Ph.D. dissertation, Delft University of Technology, 2004. [4] X. Chen and F. B. Zhan, “Agent-based modelling and simulation of urban evacuation: relative effectiveness of simultaneous and staged evacuation strategies,” Journal of the Operational Research Society, vol. 59, no. 1, pp. 25–33, 2008. [5] G. G. Løvås, “Modeling and simulation of pedestrian traffic flow,” Transportation Research Part B: Methodological, vol. 28, no. 6, pp. 429–443, 1994. [6] L. G. Chalmet, R. L. Francis, and P. B. Saunders, “Network models for building evacuation,” Management science, vol. 28, no. 1, pp. 86–105, 1982. [7] T. P. van Oijen, W. Daamen, and S. P. Hoogendoorn, “Estimation of a recursive link-based logit model and link flows in a sensor equipped network,” Transportation Research Part B: Methodological, vol. 140, pp. 262–281, 2020. [8] S. P. Hoogendoorn, F. van Wageningen-Kessels, W. Daamen, D. C. Duives, and M. Sarvi, “Continuum theory for pedestrian traffic flow: Local route choice modelling and its implications,” Transportation Research Procedia, vol. 7, pp. 381–397, 2015. [9] D. C. Duives, W. Daamen, and S. P. Hoogendoorn, “Continuum modelling of pedestrian flows—part 2: Sensitivity analysis featuring crowd movement phenomena,” Physica A: Statistical Mechanics and its Applications, vol. 447, pp. 36–48, 2016. [10] A. Tordeux, G. Lämmel, F. S. Hänseler, and B. Steffen, “A mesoscopic model for large-scale simulation of pedestrian dynamics,” Transportation research part C: emerging technologies, vol. 93, pp. 128–147, 2018. [11] N. Molyneaux and M. Bierlaire, “Controlling pedestrian flows with moving walkways,” Transportation research part C: emerging technologies, vol. 141, p. 103672, 2022. [12] N. Molyneaux, R. Scarinci, and M. Bierlaire, “Design and analysis of control strategies for pedestrian flows,” Transportation, vol. 48, no. 4, pp. 1767–1807, 2021.

[13] I. Yperman, S. Logghe, and B. Immers, “The link transmission model: An efficient implementation of the kinematic wave theory in traffic networks,” in Proceedings of the 10th EWGT Meeting, vol. 24. Citeseer, 2005, pp. 122–127. [14] T. Lilasathapornkit and M. Saberi, “Dynamic pedestrian traffic assignment with link transmission model for bidirectional sidewalk networks,” Transportation research part C: emerging technologies, vol. 145, p. 103930, 2022. [15] A. K. Wagoum, M. Chraibi, J. Zhang, and G. Lämmel, “Jupedsim: an open framework for simulating and analyzing the dynamics of pedestrians,” in 3rd Conference of Transportation Research Group of India, vol. 12, 2015. [16] B. Kleinmeier, B. Zönnchen, M. Gödel, and G. Köster, “Vadere: An open-source simulation framework to promote interdisciplinary understanding,” arXiv preprint arXiv:1907.09520, 2019. [17] P. A. Lopez, M. Behrisch, L. Bieker-Walz, J. Erdmann, Y.-P. Flötteröd, R. Hilbrich, L. Lücken, J. Rummel, P. Wagner, and E. Wießner, “Microscopic traffic simulation using sumo,” in 2018 21st international conference on intelligent transportation systems (ITSC). Ieee, 2018, pp. 2575–2582. [18] K. W Axhausen, A. Horni, and K. Nagel, The multi-agent transport simulation MATSim. Ubiquity Press, 2016. [19] Y. Liu, C. Sun, and Y. Bie, “Modeling unidirectional pedestrian movement: An investigation of diffusion behavior in the built environment,” Mathematical Problems in Engineering, vol. 2015, no. 1, p. 308261, 2015. [20] Weiming Mai, “PedNStream,” Feb. 2026. [Online]. Available: https: //github.com/WaimenMak/PedNStream [21] M. J. Lighthill and G. B. Whitham, “On kinematic waves i. flood movement in long rivers,” Proceedings of the Royal Society of London. Series A. Mathematical and Physical Sciences, vol. 229, no. 1178, pp. 281–316, 1955. [22] S.-R. Liang, F.-F. Wei, X.-M. Hu, and W.-N. Chen, “Reinforcement learning for crowd control optimization with an a* based social force interaction model,” in 2023 13th International Conference on Information Science and Technology (ICIST). IEEE, 2023, pp. 668–677. [23] X.-C. Liao, W.-N. Chen, X.-Q. Guo, J. Zhong, and D.-J. Wang, “Drift: A dynamic crowd inflow control system using lstm-based deep reinforcement learning,” IEEE Transactions on Systems, Man, and Cybernetics: Systems, vol. 55, no. 6, pp. 4202–4215, 2025. [24] R. Dowling, A. Skabardonis, and V. Alexiadis, Traffic analysis toolbox, volume III: Guidelines for applying traffic microsimulation modeling software. Federal Highway Administration, 2004. [25] P. Varaiya, “Max pressure control of a network of signalized intersections,” Transportation Research Part C: Emerging Technologies, vol. 36, pp. 177–195, 2013.

Record · ID 329130 · SHA-256 bd09ee9479551309
Retrieved via Conceptio — every document is proof-bundled with source, license, and retrieval metadata.