PedNStream: Scalable Network Flow Simulation for Pedestrian Traffic Management

arXiv cs.AI Papers

Summary

PedNStream is an open-source Python simulator for macroscopic pedestrian network flow using the Link Transmission Model, designed for large-scale crowd management with built-in controller interfaces for interventions such as gating and route guidance.

arXiv:2607.01021v1 Announce Type: new 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 closed-loop 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.
Original Article
View Cached Full Text

Cached at: 07/02/26, 05:41 AM

# PedNStream: Scalable Network Flow Simulation for Pedestrian Traffic Management
Source: [https://arxiv.org/html/2607.01021](https://arxiv.org/html/2607.01021)
Weiming Mai1, Dorine Duives and Serge HoogendoornWeiming Mai, Dorine Duives and Serge Hoogendoorn are with the Department of Transportation and Planning, Delft University of Technology, Delft, Netherlands\. \(e\-mail: w\.m\.mai@tudelft\.nl; d\.c\.duives@tudelft\.nl;s\.p\.hoogendoorn@tudelft\.nl\)\. 1: Corresponding author\.Manuscript received May 15, 2026\.

###### 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 closed\-loop evaluation\. This paper presents*PedNStream*\(PedestrianNetwork FlowSimulation\), 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\.

## IINTRODUCTION

Effective 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, agent\-based models\[[7](https://arxiv.org/html/2607.01021#bib.bib9),[1](https://arxiv.org/html/2607.01021#bib.bib10),[4](https://arxiv.org/html/2607.01021#bib.bib7),[3](https://arxiv.org/html/2607.01021#bib.bib11)\], and macroscopic formulations that either model pedestrian flow on networks\[[16](https://arxiv.org/html/2607.01021#bib.bib13),[2](https://arxiv.org/html/2607.01021#bib.bib4),[20](https://arxiv.org/html/2607.01021#bib.bib14)\]or describe pedestrian movement as spatial\-temporal continuous flow\[[8](https://arxiv.org/html/2607.01021#bib.bib15),[6](https://arxiv.org/html/2607.01021#bib.bib12)\]\. 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\[[19](https://arxiv.org/html/2607.01021#bib.bib29)\]\. 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 control, which is essential in the context of large\-scale crowd management in big events\.

At the operational level, Molyneaux et al\.\[[17](https://arxiv.org/html/2607.01021#bib.bib1),[18](https://arxiv.org/html/2607.01021#bib.bib2)\]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\)\[[25](https://arxiv.org/html/2607.01021#bib.bib3)\], and other network\-based pedestrian models\[[2](https://arxiv.org/html/2607.01021#bib.bib4),[16](https://arxiv.org/html/2607.01021#bib.bib13)\]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\.\[[13](https://arxiv.org/html/2607.01021#bib.bib5)\]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\.

TABLE I:Positioning ofPedNStreamrelative to representative open\-source simulation tools\. The comparison highlights the trade\-off between modeling resolution and application scale\.Limited: Control is not a primary use case;Indirect: Control is feasible via external APIs/wrappers;Direct: Native formulation for iterative, learning\-based, or real\-time control optimization\.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 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\[[23](https://arxiv.org/html/2607.01021#bib.bib27)\]and Vadere\[[9](https://arxiv.org/html/2607.01021#bib.bib28)\], as well as broader traffic simulators such as SUMO and MATSim, in which pedestrians appear as one component of a multimodal framework\[[15](https://arxiv.org/html/2607.01021#bib.bib22),[22](https://arxiv.org/html/2607.01021#bib.bib23)\]\. As summarized in Table[I](https://arxiv.org/html/2607.01021#S1.T1), these tools emphasize microscopic detail or multimodal demand, rather than*closed\-loop 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](https://arxiv.org/html/2607.01021#S1.T1),*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\[[14](https://arxiv.org/html/2607.01021#bib.bib18)\]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 crowd\-management 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 large\-scale behavior, a closed\-loop case study tests controller integration, and runtime analysis quantifies scalability\. The source code and installable Python package are publicly available\[[24](https://arxiv.org/html/2607.01021#bib.bib26)\], allowing researchers to reuse the tool and tailor scenarios to their own studies\.

The rest of the paper is organized as follows\. Sections[II](https://arxiv.org/html/2607.01021#S2)–[IV](https://arxiv.org/html/2607.01021#S4)present the pedestrian\-flow modeling framework, Sections[V](https://arxiv.org/html/2607.01021#S5)and[VI](https://arxiv.org/html/2607.01021#S6)describe the controller design and software architecture, and Sections[VII](https://arxiv.org/html/2607.01021#S7)–[VIII](https://arxiv.org/html/2607.01021#S8)report the experimental results\. Section[X](https://arxiv.org/html/2607.01021#S10)concludes the paper, and the controller\-baseline details are provided in the appendix\.

## IIDynamic Network Loading Problem

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](https://arxiv.org/html/2607.01021#S2.T2)summarizes the main notation used throughout the model description\.

TABLE II:Main notation used in the model\.### II\-AThe Link Transmission Model

Yperman et al\.\[[25](https://arxiv.org/html/2607.01021#bib.bib3)\]proposed the Link Transmission Model \(LTM\), a dynamic network\-loading model derived from first\-order kinematic\-wave theory\[[12](https://arxiv.org/html/2607.01021#bib.bib19)\]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\\Delta t, the sending flow from an upstream linkiiover the time interval\(t−Δ​t,t\]\(t\-\\Delta t,t\]is computed as follows:

Si,boundary​\(t\)=Ui​\(t−τf\)−Vi​\(t−Δ​t\),\\displaystyle S\_\{i,\\text\{boundary\}\}\(t\)=U\_\{i\}\(t\-\\tau\_\{f\}\)\-V\_\{i\}\(t\-\\Delta t\),\(1a\)Si,link​\(t\)=Ci​Δ​t,\\displaystyle S\_\{i,\\text\{link\}\}\(t\)=C\_\{i\}\\Delta t,\(1b\)Si​\(t\)=min⁡\(Si,boundary​\(t\),Si,link​\(t\)\)\.\\displaystyle S\_\{i\}\(t\)=\\min\(S\_\{i,\\text\{boundary\}\}\(t\),S\_\{i,\\text\{link\}\}\(t\)\)\.\(1c\)Here,Ui​\(t\)U\_\{i\}\(t\)andVi​\(t\)V\_\{i\}\(t\)denote the cumulative inflow and outflow of linkiiup to timett, respectively, andCiC\_\{i\}is the flow capacity of the link\. In the standard LTM, this capacity is treated as a fixed link\-level bound\. The termSi,boundary​\(t\)S\_\{i,\\text\{boundary\}\}\(t\)represents the amount of flow that reaches the downstream boundary of linkiiafter the free\-flow travel timeτf\\tau\_\{f\}, whereasSi,link​\(t\)S\_\{i,\\text\{link\}\}\(t\)imposes the link\-capacity limit\. Hence, the sending flowSi​\(t\)S\_\{i\}\(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\),\\displaystyle R\_\{i,\\text\{boundary\}\}\(t\)=V\_\{i\}\(t\-\\tau\_\{\\omega\}\)\+k\_\{\\mathrm\{jam\}\}L\_\{i\}\-U\_\{i\}\(t\-\\Delta t\),\(2a\)Ri,link​\(t\)=Ci​Δ​t,\\displaystyle R\_\{i,\\text\{link\}\}\(t\)=C\_\{i\}\\Delta t,\(2b\)Ri​\(t\)=min⁡\(Ri,boundary​\(t\),Ri,link​\(t\)\),\\displaystyle R\_\{i\}\(t\)=\\min\(R\_\{i,\\text\{boundary\}\}\(t\),R\_\{i,\\text\{link\}\}\(t\)\),\(2c\)whereRi,boundary​\(t\)R\_\{i,\\text\{boundary\}\}\(t\)represents the space available for new inflow at the upstream boundary of linkii\. It is determined by three terms: the cumulative outflow shifted by the shockwave travel timeτω\\tau\_\{\\omega\}, the maximum storagekjam​Lik\_\{\\mathrm\{jam\}\}L\_\{i\}, and the cumulative inflow already admitted into the link\. The termRi,link​\(t\)R\_\{i,\\text\{link\}\}\(t\)imposes the link\-capacity limit\. Here,kjamk\_\{\\mathrm\{jam\}\}denotes the jam density, i\.e\., the density at which the link is fully occupied and pedestrian movement becomes negligible\.

### II\-BLink 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\.\[[13](https://arxiv.org/html/2607.01021#bib.bib5)\]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 speedv^f​\(t\)\\hat\{v\}\_\{f\}\(t\)of a linkiithat is influenced by the density of its counter\-directional linkjj\. 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](https://arxiv.org/html/2607.01021#S2.E3.2)\. 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\)\\displaystyle S\_\{i,\\text\{boundary\}\}\(t\)=Ui​\(t−τf^​\(t\)\)−Vi​\(t−Δ​t\),\\displaystyle=U\_\{i\}\(t\-\{\\color\[rgb\]\{0,0,1\}\\definecolor\[named\]\{pgfstrokecolor\}\{rgb\}\{0,0,1\}\\hat\{\\tau\_\{f\}\}\(t\)\}\)\-V\_\{i\}\(t\-\\Delta t\),\(3a\)Ri,boundary​\(t\)\\displaystyle R\_\{i,\\text\{boundary\}\}\(t\)=Vi​\(t−τω\)\+kjam​Li\\displaystyle=V\_\{i\}\(t\-\\tau\_\{\\omega\}\)\+k\_\{\\mathrm\{jam\}\}L\_\{i\}−Ui​\(t−Δ​t\)−Sj​\(t\)\.\\displaystyle\\quad\-U\_\{i\}\(t\-\\Delta t\)\-\{\\color\[rgb\]\{0,0,1\}\\definecolor\[named\]\{pgfstrokecolor\}\{rgb\}\{0,0,1\}S\_\{j\}\(t\)\}\.\(3b\)In the above equations,Sj​\(t\)S\_\{j\}\(t\)denotes the sending flow of the counter\-directional streamjjat time steptt\. The effective free\-flow travel time is written asT^f​\(t\)=Li/v^f​\(t\)\\hat\{T\}\_\{f\}\(t\)=L\_\{i\}/\\hat\{v\}\_\{f\}\(t\)in physical time units andτ^f​\(t\)=round​\(T^f​\(t\)/Δ​t\)\\hat\{\\tau\}\_\{f\}\(t\)=\\mathrm\{round\}\(\\hat\{T\}\_\{f\}\(t\)/\\Delta t\)in simulation steps\. To calculate the effective free\-flow speedv^f​\(t\)\\hat\{v\}\_\{f\}\(t\), they first calculateρi\\rho\_\{i\}, as the ratio of the density of the reference directioniito the density of the opposite directionjjin a bidirectional stream:ρi​\(t\)=ki​\(t\)ki​\(t\)\+kj​\(t\)\\rho\_\{i\}\(t\)=\\frac\{k\_\{i\}\(t\)\}\{k\_\{i\}\(t\)\+k\_\{j\}\(t\)\}\. This term captures the relative dominance of the forward\-direction flow\. The effective free\-flow speed is then calculated asv^f​\(t\)=ρiλ​\(t\)​vf\\hat\{v\}\_\{f\}\(t\)=\\rho\_\{i\}^\{\\lambda\}\(t\)v\_\{f\}, wherevfv\_\{f\}is the nominal free\-flow speed of the linkii,kik\_\{i\}andkjk\_\{j\}are the densities of both directions, respectively\.λ\\lambdais a calibration parameter\.

### II\-CThe Refinement Model

In*PedNStream*, the sending flow boundary is computed using the actual travel time rather than the free\-flow travel time \(Equation[4a](https://arxiv.org/html/2607.01021#S2.E4.1)\), allowing it to reflect real\-time within\-link traffic conditions\. The capacity model is also refined to better match pedestrian movement\. Specifically,CiC\_\{i\}is interpreted as a nominal discharge capacity per unit width, so the effective sending capacity becomesCi​wi​Δ​tC\_\{i\}w\_\{i\}\\Delta tas shown in Equation[4b](https://arxiv.org/html/2607.01021#S2.E4.2)\. This means that the number of pedestrians that can leave a link during one simulation step scales directly with the usable gate widthwiw\_\{i\}: 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](https://arxiv.org/html/2607.01021#S2.E4.3), 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\)\\displaystyle\\tilde\{S\}\_\{i,\\mathrm\{boundary\}\}\(t\)=Ui​\(t−τ​\(t\)\)−Vi​\(t−Δ​t\),\\displaystyle=U\_\{i\}\(t\-\{\\color\[rgb\]\{\.75,0,\.25\}\\definecolor\[named\]\{pgfstrokecolor\}\{rgb\}\{\.75,0,\.25\}\\tau\(t\)\}\)\-V\_\{i\}\(t\-\\Delta t\),\(4a\)Si,link​\(t\)\\displaystyle S\_\{i,\\mathrm\{link\}\}\(t\)=Ci​wi​Δ​t,\\displaystyle=C\_\{i\}\\,\{\\color\[rgb\]\{\.75,0,\.25\}\\definecolor\[named\]\{pgfstrokecolor\}\{rgb\}\{\.75,0,\.25\}w\_\{i\}\}\\,\\Delta t,\(4b\)Si​\(t\)\\displaystyle S\_\{i\}\(t\)=min\(Si,boundary\(t\),Si,link\(t\),\\displaystyle=\\min\\Big\(S\_\{i,\\mathrm\{boundary\}\}\(t\),\\,S\_\{i,\\mathrm\{link\}\}\(t\),Si,stochastic\(t\)\),\\displaystyle\\qquad\{\\color\[rgb\]\{\.75,0,\.25\}\\definecolor\[named\]\{pgfstrokecolor\}\{rgb\}\{\.75,0,\.25\}S\_\{i,\\mathrm\{stochastic\}\}\(t\)\}\\Big\),\(4c\)Ri,boundary​\(t\)\\displaystyle R\_\{i,\\mathrm\{boundary\}\}\(t\)=Vi​\(t−τω\)\+kjam​Ai\\displaystyle=V\_\{i\}\(t\-\\tau\_\{\\omega\}\)\+k\_\{\\mathrm\{jam\}\}\\,\{\\color\[rgb\]\{\.75,0,\.25\}\\definecolor\[named\]\{pgfstrokecolor\}\{rgb\}\{\.75,0,\.25\}A\_\{i\}\}−Ui​\(t−Δ​t\)−Nj​\(t\)−Sj​\(t\)\.\\displaystyle\\quad\-U\_\{i\}\(t\-\\Delta t\)\-\{\\color\[rgb\]\{\.75,0,\.25\}\\definecolor\[named\]\{pgfstrokecolor\}\{rgb\}\{\.75,0,\.25\}N\_\{j\}\(t\)\}\-\{\\color\[rgb\]\{0,0,1\}\\definecolor\[named\]\{pgfstrokecolor\}\{rgb\}\{0,0,1\}S\_\{j\}\(t\)\}\.\(4d\)
Using the time\-varying travel time in Equation[4a](https://arxiv.org/html/2607.01021#S2.E4.1)and Equation[3a](https://arxiv.org/html/2607.01021#S2.E3.1)introduces a practical issue: under strong congestion or during the initial stage of the simulation,τ​\(t\)\\tau\(t\)can exceed the elapsed horizon, so the delayed argumentt−τ​\(t\)t\-\\tau\(t\)becomes non\-positive and the raw cumulative\-count termUi​\(t−τ​\(t\)\)−Vi​\(t−Δ​t\)U\_\{i\}\(t\-\\tau\(t\)\)\-V\_\{i\}\(t\-\\Delta t\)no longer provides a reliable boundary demand\. In the implementation, we therefore apply two adjustments\. First,T​\(t\)T\(t\)is computed as a moving average of the instantaneous link travel time rather than using the instantaneous value directly, so thatτ​\(t\)\\tau\(t\)evolves more gradually and the boundary computation remains numerically stable\. Second, the quantity in Equation[4a](https://arxiv.org/html/2607.01021#S2.E4.1)is clipped to remain non\-negative, and the boundary sending flow is blended with a density\-dependent congestion factorξi​\(t\)=clip​\(k​\(t\)−kckjam−kc,0,1\)\\xi\_\{i\}\(t\)=\\mathrm\{clip\}\\\!\\left\(\\frac\{k\(t\)\-k\_\{c\}\}\{k\_\{\\mathrm\{jam\}\}\-k\_\{c\}\},0,1\\right\)\. The resulting boundary sending flow is then computed as

Si,boundary​\(t\)=ξi​\(t\)​Ni​\(t\)\+\(1−ξi​\(t\)\)​S~i,boundary​\(t\)\.S\_\{i,\\mathrm\{boundary\}\}\(t\)=\\xi\_\{i\}\(t\)N\_\{i\}\(t\)\+\\bigl\(1\-\\xi\_\{i\}\(t\)\\bigr\)\\tilde\{S\}\_\{i,\\mathrm\{boundary\}\}\(t\)\.\(5\)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\)\\xi\_\{i\}\(t\)acts as a congestion\-dependent transition weight: fork​\(t\)≤kck\(t\)\\leq k\_\{c\}, the model remains governed by the delayed boundary demand, whereas ask​\(t\)k\(t\)approacheskjamk\_\{\\mathrm\{jam\}\}, the boundary demand is increasingly governed by the number of pedestriansNi​\(t\)N\_\{i\}\(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](https://arxiv.org/html/2607.01021#S2.E4.4), the receiving capacity depends on the link areaAiA\_\{i\}, so the termkjam​Aik\_\{\\mathrm\{jam\}\}A\_\{i\}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 termNj​\(t\)N\_\{j\}\(t\)denotes the occupancy of pedestrians traveling in the opposite direction on the counter\-directional link; it reduces the effective receiving space available to directionii\. 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 termSi,stochastic​\(t\)S\_\{i,\\text\{stochastic\}\}\(t\)is modeled\.

### II\-DStochastic Flow Modeling

The stochastic term in Equation[4c](https://arxiv.org/html/2607.01021#S2.E4.3)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\.\[[14](https://arxiv.org/html/2607.01021#bib.bib18)\]to represent dispersion in walking speeds\. Letttdenote the current simulation\-step index, letq^↑​\(t\)\\hat\{q\}\_\{\\uparrow\}\(t\)denote the upstream inflow available to traverse the link, letq^↓​\(t\)\\hat\{q\}\_\{\\downarrow\}\(t\)denote the resulting downstream outflow, and letτ​\(t\)=round​\(T​\(t\)/Δ​t\)\\tau\(t\)=\\mathrm\{round\}\(T\(t\)/\\Delta t\)be the realized link travel time expressed in simulation steps\. The diffused downstream flow is then computed as

q^↓​\(t\)=∑n=0t−τ​\(t\)−1F​\(1−F\)n​q^↑​\(t−τ​\(t\)−n\)\.\\hat\{q\}\_\{\\downarrow\}\(t\)=\\sum\_\{n=0\}^\{t\-\\tau\(t\)\-1\}F\(1\-F\)^\{n\}\\,\\hat\{q\}\_\{\\uparrow\}\(t\-\\tau\(t\)\-n\)\.\(6\)whereF​\(t\)=11\+γ​T​\(t\)F\(t\)=\\frac\{1\}\{1\+\\gamma T\(t\)\}is the time\-dependent diffusion coefficient,γ\\gammais a calibration parameter, andT​\(t\)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γ\\gammaproduce a more dispersed downstream outflow profile\. As illustrated in Figure[1](https://arxiv.org/html/2607.01021#S2.F1), whenγ=0\\gamma=0the downstream outflow is nearly a time\-shifted copy of the inflow, whereas larger values ofγ\\gammaflatten the peak and spread the discharge over a longer interval\.

![Refer to caption](https://arxiv.org/html/2607.01021v1/x1.png)Figure 1:Illustration of the effect of the diffusion parameterγ\\gammaon downstream outflow under free\-flow conditions\. Largerγ\\gammavalues 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 stepttis drawn from a binomial distribution whose trial count is given by the boundary sending flow and whose success probability isprelp\_\{\\mathrm\{rel\}\}\. The release probabilityprelp\_\{\\mathrm\{rel\}\}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 probabilitypactivityp\_\{\\mathrm\{activity\}\}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γ\\gamma,prelp\_\{\\mathrm\{rel\}\}, andpactivityp\_\{\\mathrm\{activity\}\}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](https://arxiv.org/html/2607.01021#alg1)summarizes the step\-wise procedure used to compute the stochastic sending flow update for a link\.

Algorithm 1Stochastic sending flow update on linkii1:

ttand

T​\(t\)T\(t\); link densities

ki​\(t\)k\_\{i\}\(t\)and

kj​\(t\)k\_\{j\}\(t\); free\-flow travel time in steps

τf\\tau\_\{f\}
2:Parameters

Δ​t\\Delta t,

γ\\gamma,

kck\_\{c\},

prel∈\[0,1\]p\_\{\\mathrm\{rel\}\}\\in\[0,1\], and

pactivity∈\[0,1\]p\_\{\\mathrm\{activity\}\}\\in\[0,1\]\.

3:procedureCalSendingFlow\(

tt\)⊳\\trianglerighttt= current time step

4:

k​\(t\)←ki​\(t\)\+kj​\(t\)k\(t\)\\leftarrow k\_\{i\}\(t\)\+k\_\{j\}\(t\)
5:

τ​\(t\)←round​\(T​\(t\)Δ​t\)\{\\color\[rgb\]\{\.75,0,\.25\}\\definecolor\[named\]\{pgfstrokecolor\}\{rgb\}\{\.75,0,\.25\}\\tau\(t\)\}\\leftarrow\\mathrm\{round\}\\\!\\left\(\\dfrac\{T\(t\)\}\{\\Delta t\}\\right\)
6:if

t<τft<\\tau\_\{f\}then⊳\\trianglerightinitial stage

7:return

Si​\(t\)←0S\_\{i\}\(t\)\\leftarrow 0
8:endif

9:Compute

Si,boundary​\(t\)S\_\{i,\\text\{boundary\}\}\(t\)according to Equation[5](https://arxiv.org/html/2607.01021#S2.E5)\.

10:Compute

Si,link​\(t\)S\_\{i,\\text\{link\}\}\(t\)according to Equation[4b](https://arxiv.org/html/2607.01021#S2.E4.2)\.

11:if

k≤kck\\leq k\_\{c\}then⊳\\trianglerightfree\-flow regime

12:

Si,stochastic​\(t\)←crowd\_diffusion​\(τ​\(t\),γ\)\{\\color\[rgb\]\{\.75,0,\.25\}\\definecolor\[named\]\{pgfstrokecolor\}\{rgb\}\{\.75,0,\.25\}S\_\{i,\\text\{stochastic\}\}\(t\)\}\\leftarrow\\texttt\{crowd\\\_diffusion\}\(\\tau\(t\),\\gamma\)
13:else⊳\\trianglerightcongested regime

14:Acquire the flow releasing probability

prelp\_\{\\text\{rel\}\}\.

15:

Si,stochastic​\(t\)∼Bin​\(⌊Si,boundary​\(t\)⌋,prel\)\{\\color\[rgb\]\{\.75,0,\.25\}\\definecolor\[named\]\{pgfstrokecolor\}\{rgb\}\{\.75,0,\.25\}S\_\{i,\\text\{stochastic\}\}\(t\)\}\\sim\\mathrm\{Bin\}\\left\(\\lfloor S\_\{i,\\text\{boundary\}\}\(t\)\\rfloor,p\_\{\\text\{rel\}\}\\right\)
16:endif

17:if

pactivity\>0p\_\{\\text\{activity\}\}\>0then⊳\\trianglerightactivity effect

18:

Xi​\(t\)∼Bin​\(⌊Si,boundary​\(t\)⌋,pactivity\)X\_\{i\}\(t\)\\sim\\mathrm\{Bin\}\\left\(\\lfloor S\_\{i,\\text\{boundary\}\}\(t\)\\rfloor,p\_\{\\text\{activity\}\}\\right\)
19:

Si,stochastic​\(t\)←Si,stochastic​\(t\)−Xi​\(t\)\{\\color\[rgb\]\{\.75,0,\.25\}\\definecolor\[named\]\{pgfstrokecolor\}\{rgb\}\{\.75,0,\.25\}S\_\{i,\\text\{stochastic\}\}\(t\)\}\\leftarrow S\_\{i,\\text\{stochastic\}\}\(t\)\-X\_\{i\}\(t\)
20:endif

21:Update

Si​\(t\)S\_\{i\}\(t\)with Equation[4c](https://arxiv.org/html/2607.01021#S2.E4.3)\.

22:endprocedure

23:

Si​\(t\)S\_\{i\}\(t\)

## IIIDynamic Route Choice with Utility Function

To simulate the behavior of pedestrian route choice, we apply the route choice model described in\[[4](https://arxiv.org/html/2607.01021#bib.bib7)\]to calculate the macroscopic turning fractions at intersections\. First,kk\-shortest 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 notationUi​\(t\)U\_\{i\}\(t\)in the LTM section, we denote the perceived destination\-specific utility of choosing linkℓ\\ellgiven OD pairπ\\piat time stepttas𝒰ℓπ​\(t\)\\mathcal\{U\}\_\{\\ell\}^\{\\pi\}\(t\):

𝒰ℓπ​\(t\)=𝒱ℓπ​\(t\)\+ϵℓ=\(𝜽𝖳​𝐱ℓπ​\(t\)\+ηℓ​\(t\)\)\+ϵℓ\.\\mathcal\{U\}\_\{\\ell\}^\{\\pi\}\(t\)=\\mathcal\{V\}\_\{\\ell\}^\{\\pi\}\(t\)\+\\epsilon\_\{\\ell\}=\\left\(\\boldsymbol\{\\theta\}^\{\\mathsf\{T\}\}\\mathbf\{x\}\_\{\\ell\}^\{\\pi\}\(t\)\+\\eta\_\{\\ell\}\(t\)\\right\)\+\\epsilon\_\{\\ell\}\.\(7\)Here,𝒱ℓπ​\(t\)\\mathcal\{V\}\_\{\\ell\}^\{\\pi\}\(t\)represents the fluctuating deterministic component of the utility at timett\. It consists of the observable link attributes𝐱ℓπ​\(t\)\\mathbf\{x\}\_\{\\ell\}^\{\\pi\}\(t\)weighted by the calibrated coefficient vector𝜽\\boldsymbol\{\\theta\}, and a time\-varying stochastic shock termηℓ​\(t\)∼𝒩​\(0,σ2\)\\eta\_\{\\ell\}\(t\)\\sim\\mathcal\{N\}\(0,\\sigma^\{2\}\)which captures momentary fluctuations in link conditions or collective perception\. The termϵℓ\\epsilon\_\{\\ell\}is an independently and identically distributed \(i\.i\.d\.\) Gumbel random error term, representing the unobserved cross\-sectional dispersion in pedestrian route preferences\.

Letℓ↑\\ell\_\{\\uparrow\}denote the upstream link andℓ↓\\ell\_\{\\downarrow\}denote a candidate downstream link\. Letπ\\pibe an OD pair within the set of all OD pairs𝒫o​d\\mathcal\{P\}\_\{od\}\. Because the unobserved population heterogeneityϵℓ\\epsilon\_\{\\ell\}is Gumbel\-distributed, the conditional probability of choosingℓ↓\\ell\_\{\\downarrow\}givenℓ↑\\ell\_\{\\uparrow\}andπ\\piat timettis formulated as a Multinomial Logit \(MNL\) model:

Pt​\(ℓ↓∣ℓ↑,π\)=exp⁡\(𝒱ℓ↓π​\(t\)\)∑ℓ′∈𝒟​\(ℓ↑\)exp⁡\(𝒱ℓ′π​\(t\)\),P\_\{t\}\(\\ell\_\{\\downarrow\}\\mid\\ell\_\{\\uparrow\},\\pi\)=\\frac\{\\exp\\big\(\\mathcal\{V\}\_\{\\ell\_\{\\downarrow\}\}^\{\\pi\}\(t\)\\big\)\}\{\\sum\_\{\\ell^\{\\prime\}\\in\\mathcal\{D\}\(\\ell\_\{\\uparrow\}\)\}\\exp\\big\(\\mathcal\{V\}\_\{\\ell^\{\\prime\}\}^\{\\pi\}\(t\)\\big\)\},\(8\)where𝒟​\(ℓ↑\)\\mathcal\{D\}\(\\ell\_\{\\uparrow\}\)denotes the set of feasible downstream links fromℓ↑\\ell\_\{\\uparrow\}\. The aggregate turning fractionPt​\(ℓ↓∣ℓ↑\)P\_\{t\}\(\\ell\_\{\\downarrow\}\\mid\\ell\_\{\\uparrow\}\)at timettis then obtained by applying the law of total probability:

Pt​\(ℓ↓∣ℓ↑\)=∑π∈𝒫o​dPt​\(ℓ↓∣ℓ↑,π\)⏟OD\-conditional link choice​Pt​\(π∣ℓ↑\)⏟OD ratio\.P\_\{t\}\(\\ell\_\{\\downarrow\}\\mid\\ell\_\{\\uparrow\}\)=\\sum\_\{\\pi\\in\\mathcal\{P\}\_\{od\}\}\\underbrace\{P\_\{t\}\(\\ell\_\{\\downarrow\}\\mid\\ell\_\{\\uparrow\},\\pi\)\}\_\{\\text\{OD\-conditional link choice\}\}\\underbrace\{P\_\{t\}\(\\pi\\mid\\ell\_\{\\uparrow\}\)\}\_\{\\text\{OD ratio\}\}\.\(9\)Here,Pt​\(π∣ℓ↑\)P\_\{t\}\(\\pi\\mid\\ell\_\{\\uparrow\}\)denotes the conditional OD ratio at timett, i\.e\., the probability that a pedestrian on the linkℓ↑\\ell\_\{\\uparrow\}belongs to the pair of ODπ\\pi, calculated from the demand for OD over time\.

The computation ofPt​\(ℓ↓∣ℓ↑\)P\_\{t\}\(\\ell\_\{\\downarrow\}\\mid\\ell\_\{\\uparrow\}\)is illustrated in Figure[2](https://arxiv.org/html/2607.01021#S3.F2)\. 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 linkA–Bto downstream linkB–C, we first identify the OD pairs whose paths include this movement, namelyO1​D1O\_\{1\}D\_\{1\},O1​D2O\_\{1\}D\_\{2\},O2​D1O\_\{2\}D\_\{1\}, andO2​D2O\_\{2\}D\_\{2\}\. We then enumerate the feasible paths for these OD pairs and aggregate those that traverse the link pair, as illustrated in the figure\.

![Refer to caption](https://arxiv.org/html/2607.01021v1/x2.png)Figure 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\.
## IVFlow Assignment with Two Node Models

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\[[25](https://arxiv.org/html/2607.01021#bib.bib3)\]to determine the intermediate flowqi​jnq^\{n\}\_\{ij\}on a nodennbetween two linksiiandjj:

qi​jn=min⁡\(pi​jn​Sin∑l∈u​ppl​jn​Sln​Rjn,pi​jn​Sin\)\.q^\{n\}\_\{ij\}=\\min\\left\(\\frac\{p^\{n\}\_\{ij\}S^\{n\}\_\{i\}\}\{\\sum\_\{l\\in up\}p^\{n\}\_\{lj\}S^\{n\}\_\{l\}\}R^\{n\}\_\{j\},\\,p^\{n\}\_\{ij\}S^\{n\}\_\{i\}\\right\)\.\(10\)Wherepi​jnp^\{n\}\_\{ij\}denotes the route choice probability from linkiito linkjj, which is the turning fraction described in the previous section \(i\.e\.,pi​jn≡P​\(ℓj∣ℓi\)p\_\{ij\}^\{n\}\\equiv P\(\\ell\_\{j\}\\mid\\ell\_\{i\}\)\)\.RjnR\_\{j\}^\{n\}represents the total receiving flow of downstream linkjjat nodenn, andSinS\_\{i\}^\{n\}is the total sending flow of upstream linkiiat nodenn\. 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\[[13](https://arxiv.org/html/2607.01021#bib.bib5)\], e\.g\. we want the total sum of the flow on the links can be maximized under the capacity and turning fraction constraints:

max\{qi​jn\}\\displaystyle\\max\_\{\\\{q\_\{ij\}^\{n\}\\\}\}\\quad∑i∑jqi​jn,n∈N\\displaystyle\\sum\_\{i\}\\sum\_\{j\}q\_\{ij\}^\{n\},\\quad n\\in N\(11a\)s\.t\.qi​jn≥0,\\displaystyle q\_\{ij\}^\{n\}\\geq 0,∀i,j,\\displaystyle\\forall i,j,\(11b\)qin=∑jqi​jn≤Sin,\\displaystyle q\_\{i\}^\{n\}=\\sum\_\{j\}q\_\{ij\}^\{n\}\\leq S\_\{i\}^\{n\},∀i,\\displaystyle\\forall i,\(11c\)qjn=∑iqi​jn≤Rjn−S~jn,\\displaystyle q\_\{j\}^\{n\}=\\sum\_\{i\}q\_\{ij\}^\{n\}\\leq R\_\{j\}^\{n\}\-\\tilde\{S\}\_\{j\}^\{n\},∀j,\\displaystyle\\forall j,\(11d\)qi​jn=pi​jn​qin,\\displaystyle q\_\{ij\}^\{n\}=p\_\{ij\}^\{n\}q\_\{i\}^\{n\},∀i,j\.\\displaystyle\\forall i,j\.\(11e\)Constraint[11b](https://arxiv.org/html/2607.01021#S4.E11.2)enforces non\-negativity of link\-to\-link flows\. Constraint[11c](https://arxiv.org/html/2607.01021#S4.E11.3)bounds the total outflow from each upstream link by its sending capacity\. Constraint[11d](https://arxiv.org/html/2607.01021#S4.E11.4)bounds the total inflow to each downstream link by its effective receiving capacity and the demand from the opposing linkS~jn\\tilde\{S\}\_\{j\}^\{n\}\. Constraint[11e](https://arxiv.org/html/2607.01021#S4.E11.5)preserves the prescribed turning fractions\. Both node models are implemented in*PedNStream*, and users can select either one through the configuration file\.

## VController Design

*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: theSeparatorand theGater, the diagrams of each are illustrated in Figure[3](https://arxiv.org/html/2607.01021#S5.F3)\.

![Refer to caption](https://arxiv.org/html/2607.01021v1/x3.png)Figure 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\[[10](https://arxiv.org/html/2607.01021#bib.bib16),[11](https://arxiv.org/html/2607.01021#bib.bib17)\]\. 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 moving walkway or the width of a flow separator\[[18](https://arxiv.org/html/2607.01021#bib.bib2)\], 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\. ASeparatoris 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\. TheGateris 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](https://arxiv.org/html/2607.01021#S2.E4.2)\.

One can easily adapt the flow\-separate control algorithm in\[[18](https://arxiv.org/html/2607.01021#bib.bib2)\]to adjust the width of each direction using theS​e​p​a​r​a​t​o​rSeparatorcontroller\. 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](https://arxiv.org/html/2607.01021#A1)\.

![Refer to caption](https://arxiv.org/html/2607.01021v1/x4.png)Figure 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\+ spatial \(adjacency, distances, positions\)env\_generator\.py NetworkEnvGenerator load\_network\_data create\_networknetwork\.py\>\\\!\>\\\!Network 1\. Build nodes & links 2\. InitODManager,DemandGenerator 3\. InitPathFinder:kk\-pathsNetwork\.network\_loading Fort=1​…​Tmaxt=1\\ldots T\_\{\\text\{max\}\}: 1\. Turning fracs \(PathFinder\) 2\. Flow assignment \(Node\) 3\. Update density \(Link\) 4\. Update speeds \(Link\)End & Collect Resultssim\_params\.yaml\(config\)adj\_matrix\.npy\(topology\)edge\_distances\.pkl\(lengths\)node\_positions\.json\(layout\)link\.py Link: shared physical space Separator: no bi\-directional effectnode\.py RegularNode: LP / proportional OneToOneNode: pass\-throughpath\_finder\.py PathFinder: findkk\-shortest paths with utilities 𝒰=α​d\+β​k−ω​c\\mathcal\{U\}\\\!=\\\!\\alpha d\+\\beta k\-\\omega cod\_manager\.py ODManager: OD demand DemandGenerator: arrivalsModuleFileFlowRef\.ClassNamemethod\(\)

Figure 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\.
## VISimulation Framework and Software Architecture

The overall simulation framework is illustrated in Figure[4](https://arxiv.org/html/2607.01021#S5.F4), while Figure[5](https://arxiv.org/html/2607.01021#S5.F5)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\.

### VI\-AScenario Definition and Network Assembly

Each simulation scenario is defined underdatasets/<scenario\_name\>/\. The filesim\_params\.yamlstores 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 one\-to\-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\.

### VI\-BExecution Pipeline

Once the network is assembled, the simulator executes a repeated network\-loading procedure overt=1,…,Tmaxt=1,\\ldots,T\_\{\\max\}\. 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](https://arxiv.org/html/2607.01021#S5.F5)indicate how the LTM\-based routing, 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\.

## VIISynthetic Scenario Evaluation

Our evaluation is organized from controlled mechanism checks to larger application studies\. We begin with four representative synthetic scenarios, each designed to isolate one pedestrian traffic phenomenon and verify that*PedNStream*reproduces it under controlled conditions, as summarized in Table[III](https://arxiv.org/html/2607.01021#S7.T3)\.

### VII\-AScenario and Network Design

The synthetic network layouts are shown in Fig\.[6](https://arxiv.org/html/2607.01021#S7.F6), and representative simulation snapshots are shown in Figure[7](https://arxiv.org/html/2607.01021#S7.F7)\. 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\.

![Refer to caption](https://arxiv.org/html/2607.01021v1/x5.png)Figure 6:Four synthetic networks\.TABLE III:Synthetic network designs and scenario focus![Refer to caption](https://arxiv.org/html/2607.01021v1/x6.png)Figure 7:Simulation snapshots for four synthetic networks\. \(a\) Long corridor\. \(b\) Branching queues\. \(c\) Spike\. \(d\) Six intersections\.Long Corridor:We simulate bidirectional pedestrian flow in a long corridor to examine counterflow interference\. As shown in Figure[7](https://arxiv.org/html/2607.01021#S7.F7)\(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, 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](https://arxiv.org/html/2607.01021#S7.F7)\(b\)\), pedestrians enter from both ends of a fork\-shaped corridor\. A downstream bottleneck is introduced by narrowing the back gate of link2–3to 0\.5 m\. As a result, pedestrians begin to accumulate on link1–2between 300 s and 3000 s, and the resulting queue propagates upstream into links0–1and4–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](https://arxiv.org/html/2607.01021#S7.F7)\(c\), pedestrians become blocked around intersection3, and near\-gridlock forms att=5000t=5000s\. 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](https://arxiv.org/html/2607.01021#S3), which incorporates distance, link density, and capacity\. Initially, pedestrians traveling from node1to node5choose the shortest path via link1–3\. At 500 s, increasing density on link1–3prompts a small fraction of pedestrians to divert via link1–0\. At 1100 s, the front gate of link1–3is narrowed to 0\.1 m, triggering substantial rerouting toward link3–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\.

### VII\-BPedestrian 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](https://arxiv.org/html/2607.01021#S7.F8)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](https://arxiv.org/html/2607.01021#S7.F9)provides a second comparison in the Spike network under near\-gridlock conditions\. In this case, link4–3reaches jam density after approximately 2800 s \(see Figure[7](https://arxiv.org/html/2607.01021#S7.F7)\(c\)\), after which the demand on that link drops to zero\. Accordingly, the inflow of link4–3also drops to zero, as shown in the left column of Figure[9](https://arxiv.org/html/2607.01021#S7.F9)\. The standard LTM still shows relatively high inflow and outflow on the opposite\-direction link3–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\.

![Refer to caption](https://arxiv.org/html/2607.01021v1/x7.png)Figure 8:Qualitative comparison of inflow and outflow patterns on link pair2–3/3–2in the Long Corridor scenario\. From top to bottom: LTM,*PedNStream*, and bidirectional LTM\.![Refer to caption](https://arxiv.org/html/2607.01021v1/x8.png)Figure 9:Qualitative comparison of inflow and outflow patterns on link pair4–3/3–4in the Spike scenario under near\-gridlock conditions\. From top to bottom: LTM,*PedNStream*, and bidirectional LTM\.

## VIIIReal Network Evaluation

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\.

### VIII\-ALarge\-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](https://arxiv.org/html/2607.01021#S8.F10)\.

![Refer to caption](https://arxiv.org/html/2607.01021v1/x9.png)Figure 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\.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\) and142–80\(east to west\), shown in Figure[11a](https://arxiv.org/html/2607.01021#S8.F11.sf1)\. The space\-time diagram for path0–8in Figure[11b](https://arxiv.org/html/2607.01021#S8.F11.sf2)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](https://arxiv.org/html/2607.01021#S8.F11.sf3), shows two wedge\-shaped congestion patterns that correspond to the two main hotspots highlighted in Figure[11a](https://arxiv.org/html/2607.01021#S8.F11.sf1)\. Together, these path\-based views provide a more detailed picture of how congestion forms, propagates, and interacts with route structure in the Delft network\.

![Refer to caption](https://arxiv.org/html/2607.01021v1/x10.png)\(a\)Representative paths0–8\(light yellow\) and142–80\(light blue\) in the Delft network\.
![Refer to caption](https://arxiv.org/html/2607.01021v1/x11.png)\(b\)Space\-time diagram for path0–8\.
![Refer to caption](https://arxiv.org/html/2607.01021v1/x12.png)\(c\)Space\-time diagram for path142–80\.

Figure 11:Space\-time diagrams of two main paths in the Delft center\.
### VIII\-BPartial 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 system111[Melbourne pedestrian counting system sensor locations dataset](https://data.melbourne.vic.gov.au/explore/dataset/pedestrian-counting-system-sensor-locations)\.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](https://arxiv.org/html/2607.01021#S8.F12.sf1)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](https://arxiv.org/html/2607.01021#S8.F12.sf2)\. 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 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<5and GEH<10<10, the volume 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\[[5](https://arxiv.org/html/2607.01021#bib.bib31)\]\. 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 itskknearest 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](https://arxiv.org/html/2607.01021#S8.T4)\.

TABLE IV:Melbourne partial\-observation validation\.Obs\.denotes the number of sensors treated as observed inputs, and metrics are computed on the remaining sensors\. Entries report mean \(std\) across 7 runs\.Boldindicates the best value per setting\.↑\\uparrowhigher is better;↓\\downarrowlower is better;≈\\approx1 closer to 1 is better\.As shown in Table[IV](https://arxiv.org/html/2607.01021#S8.T4), 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\.

![Refer to caption](https://arxiv.org/html/2607.01021v1/x13.png)\(a\)Melbourne city\-centre sidewalk network\. Blue marks denote the location of the sensors\.
![Refer to caption](https://arxiv.org/html/2607.01021v1/x14.png)\(b\)Observed and simulated flow comparison at a representative location\. In this comparison,kc=2​peds/m2k\_\{c\}=2\\,\\mathrm\{peds/m^\{2\}\}andvf=1\.1​m/sv\_\{f\}=1\.1\\,\\mathrm\{m/s\}\. The diffusion coefficientγ\\gammais set to 0\.1, and the activity probabilitypactivityp\_\{\\text\{activity\}\}is 0\.5\.

Figure 12:Comparison between real counting data and simulated data\.

## IXClosed\-Loop Control and Runtime Analysis

### IX\-ACrowd Management Case Study

To demonstrate the simulator’s compatibility with closed\-loop crowd management, we apply theGatercontrollers introduced in Section[V](https://arxiv.org/html/2607.01021#S5)to the Delft pedestrian network\. The experiment contains 132 OD pairs and a festival\-like demand pattern with two peaks aroundt=1300t=1300s andt=3700t=3700s\. We place sevenG​a​t​e​r​sGatersaround the area highlighted by the red square in Figure[13](https://arxiv.org/html/2607.01021#S9.F13)\(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 path0–8, which traverses the regulated area and therefore reflects the local impact of the gating strategies\. As shown in Figure[13](https://arxiv.org/html/2607.01021#S9.F13)\(b\) and Figure[13](https://arxiv.org/html/2607.01021#S9.F13)\(c\), both control strategies improve performance on this path\. 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 pressure\-based method responds not only to local intersection density but also to upstream density conditions\.

![Refer to caption](https://arxiv.org/html/2607.01021v1/x15.png)Figure 13:\(a\) Simulation snapshots with crowd management strategies attt=5000 s\. SevenG​a​t​e​rGatercontrollers are placed around the area highlighted by the red square\. \(b\) The averaged link flow on the path0–8\. \(c\) The averaged walking speed on the path0–8\. The metrics are averaged over 5 random seeds\.
### IX\-BRuntime and Scalability Analysis

Theoretically,*PedNStream*has a time complexity of𝒪​\(T​\(N\+E\)\)\\mathcal\{O\}\(T\(N\+E\)\), whereNNis the number of nodes appearing on the candidate paths between OD pairs,EEis the number of links in the network, andTTis 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𝒪​\(T×E\)\\mathcal\{O\}\(T\\times E\), because each link pre\-allocates state arrays \(e\.g\. flow, speed, and density\) of lengthTTfor 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](https://arxiv.org/html/2607.01021#S9.F14)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\.

![Refer to caption](https://arxiv.org/html/2607.01021v1/x16.png)Figure 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\.

## XConclusion and Future Work

In this paper, we presented*PedNStream*, a network\-based pedestrian flow simulation tool built upon the original Link 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 control\-oriented 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 optimization\-based controllers for automated crowd management, as well as validating the model using additional real\-world datasets across diverse urban environments\.

## Appendix ARule\-Based and Pressure\-Based Gate Controllers

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𝒢\\mathcal\{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\.

#### Rule\-Based Controller \(Algorithm[2](https://arxiv.org/html/2607.01021#alg2)\)\.

The rule\-based controller applies a discrete bang\-bang update driven by a density thresholdk⋆k^\{\\star\}\. For every gategg, the own\-direction densityk​\(g\)k\(g\)is compared againstk⋆k^\{\\star\}; when exceeded, the gate is closed by a fixed stepΔ​w\\Delta 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\\Delta w\. This controller is simple and interpretable, but its fixed step size and hard threshold make it oscillation\-prone neark⋆k^\{\\star\}and insensitive to the magnitude of congestion\.

Algorithm 2Rule\-Based Gate Control1:Set of controlled gates

𝒢\\mathcal\{G\}at junction

uu; density threshold

k⋆k^\{\\star\}; fixed step

Δ​w\\Delta w
2:For each

g∈𝒢g\\in\\mathcal\{G\}: own\-direction density

k​\(g\)k\(g\), paired density

k′​\(g\)k^\{\\prime\}\(g\), and current width

w​\(g\)w\(g\)
3:procedureRuleBasedControl\(

𝒢,k⋆,Δ​w\\mathcal\{G\},k^\{\\star\},\\Delta w\)

4:foreach gate

g∈𝒢g\\in\\mathcal\{G\}do

5:if

k​\(g\)\>k⋆k\(g\)\>k^\{\\star\}then

6:

a​\(g\)←w​\(g\)−Δ​wa\(g\)\\leftarrow w\(g\)\-\\Delta w
7:elseif

k​\(g\)\+k′​\(g\)\>k⋆∧k​\(g\)≥k′​\(g\)k\(g\)\+k^\{\\prime\}\(g\)\>k^\{\\star\}\\;\\land\\;k\(g\)\\geq k^\{\\prime\}\(g\)then

8:

a​\(g\)←w​\(g\)−Δ​wa\(g\)\\leftarrow w\(g\)\-\\Delta w
9:else⊳\\trianglerightsafe to open the gate

10:

a​\(g\)←w​\(g\)\+Δ​wa\(g\)\\leftarrow w\(g\)\+\\Delta w
11:endif

12:endfor

13:endprocedure

14:Target gate widths

a​\(g\)a\(g\)for all

g∈𝒢g\\in\\mathcal\{G\}

#### Pressure\-Based Controller \(Algorithm[3](https://arxiv.org/html/2607.01021#alg3)\)\.

The pressure\-based controller is inspired by max\-pressure control from vehicular traffic signal literature\[[21](https://arxiv.org/html/2607.01021#bib.bib30)\]\. For each gategg, it defines a local pressureP​\(g\)=kup​\(g\)−kdown​\(g\)P\(g\)=k\_\{\\text\{up\}\}\(g\)\-k\_\{\\text\{down\}\}\(g\), i\.e\. the difference between upstream demand and downstream resistance\. A proportional lawδ​\(g\)=clip​\(K⋅P​\(g\),−Δmax,\+Δmax\)\\delta\(g\)=\\mathrm\{clip\}\(K\\cdot P\(g\),\\,\-\\Delta\_\{\\max\},\+\\Delta\_\{\\max\}\)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 gainKKand the safety clampΔmax\\Delta\_\{\\max\}\.

Both controllers produce target gate widths that are subsequently clipped to their physical bounds\[0,width​\(ℓ\)\]\[0,\\text\{width\}\(\\ell\)\], 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 3Pressure\-Based Gate Control1:Set of controlled gates

𝒢\\mathcal\{G\}at junction

uu; proportional gain

KK; per\-step bound

Δmax\\Delta\_\{\\max\}
2:For each

g∈𝒢g\\in\\mathcal\{G\}: upstream density

kup​\(g\)k\_\{\\text\{up\}\}\(g\), downstream density

kdown​\(g\)k\_\{\\text\{down\}\}\(g\), and current width

w​\(g\)w\(g\)
3:procedurePressureControl\(

𝒢,K,Δmax\\mathcal\{G\},K,\\Delta\_\{\\max\}\)

4:foreach gate

g∈𝒢g\\in\\mathcal\{G\}do

5:

P​\(g\)←kup​\(g\)−kdown​\(g\)P\(g\)\\leftarrow k\_\{\\text\{up\}\}\(g\)\-k\_\{\\text\{down\}\}\(g\)
6:

δ​\(g\)←clip​\(K⋅P​\(g\),−Δmax,\+Δmax\)\\delta\(g\)\\leftarrow\\mathrm\{clip\}\\\!\\left\(K\\cdot P\(g\),\\,\-\\Delta\_\{\\max\},\\,\+\\Delta\_\{\\max\}\\right\)
7:

a​\(g\)←w​\(g\)\+δ​\(g\)a\(g\)\\leftarrow w\(g\)\+\\delta\(g\)
8:endfor

9:endprocedure

10:Target gate widths

a​\(g\)a\(g\)for all

g∈𝒢g\\in\\mathcal\{G\}

## References

- \[1\]\(1998\)Emergent fundamental pedestrian flows from cellular automata microsimulation\.Transportation Research Record1644\(1\),pp\. 29–36\.Cited by:[§I](https://arxiv.org/html/2607.01021#S1.p1.1)\.
- \[2\]L\. G\. Chalmet, R\. L\. Francis, and P\. B\. Saunders\(1982\)Network models for building evacuation\.Management science28\(1\),pp\. 86–105\.Cited by:[§I](https://arxiv.org/html/2607.01021#S1.p1.1),[§I](https://arxiv.org/html/2607.01021#S1.p3.1)\.
- \[3\]X\. Chen and F\. B\. Zhan\(2008\)Agent\-based modelling and simulation of urban evacuation: relative effectiveness of simultaneous and staged evacuation strategies\.Journal of the Operational Research Society59\(1\),pp\. 25–33\.Cited by:[§I](https://arxiv.org/html/2607.01021#S1.p1.1)\.
- \[4\]W\. Daamen\(2004\)Modelling passenger flows in public transport facilities\.Ph\.D\. Thesis,DUP Science Delft, the Netherlands,Delft University of Technology\.Cited by:[§I](https://arxiv.org/html/2607.01021#S1.p1.1),[§III](https://arxiv.org/html/2607.01021#S3.p1.1)\.
- \[5\]R\. Dowling, A\. Skabardonis, and V\. Alexiadis\(2004\)Traffic analysis toolbox, volume iii: guidelines for applying traffic microsimulation modeling software\.Federal Highway Administration\.Cited by:[§VIII\-B](https://arxiv.org/html/2607.01021#S8.SS2.p2.2)\.
- \[6\]D\. C\. Duives, W\. Daamen, and S\. P\. Hoogendoorn\(2016\)Continuum modelling of pedestrian flows—part 2: sensitivity analysis featuring crowd movement phenomena\.Physica A: Statistical Mechanics and its Applications447,pp\. 36–48\.Cited by:[§I](https://arxiv.org/html/2607.01021#S1.p1.1)\.
- \[7\]D\. Helbing and P\. Molnar\(1995\)Social force model for pedestrian dynamics\.Physical review E51\(5\),pp\. 4282\.Cited by:[§I](https://arxiv.org/html/2607.01021#S1.p1.1)\.
- \[8\]S\. P\. Hoogendoorn, F\. van Wageningen\-Kessels, W\. Daamen, D\. C\. Duives, and M\. Sarvi\(2015\)Continuum theory for pedestrian traffic flow: local route choice modelling and its implications\.Transportation Research Procedia7,pp\. 381–397\.Cited by:[§I](https://arxiv.org/html/2607.01021#S1.p1.1)\.
- \[9\]B\. Kleinmeier, B\. Zönnchen, M\. Gödel, and G\. Köster\(2019\)Vadere: an open\-source simulation framework to promote interdisciplinary understanding\.arXiv preprint arXiv:1907\.09520\.Cited by:[TABLE I](https://arxiv.org/html/2607.01021#S1.T1.9.3.2.1),[§I](https://arxiv.org/html/2607.01021#S1.p6.1)\.
- \[10\]S\. Liang, F\. Wei, X\. Hu, and W\. Chen\(2023\)Reinforcement learning for crowd control optimization with an a\* based social force interaction model\.In2023 13th International Conference on Information Science and Technology \(ICIST\),pp\. 668–677\.Cited by:[§V](https://arxiv.org/html/2607.01021#S5.p2.1)\.
- \[11\]X\. Liao, W\. Chen, X\. Guo, J\. Zhong, and D\. Wang\(2025\)DRIFT: a dynamic crowd inflow control system using lstm\-based deep reinforcement learning\.IEEE Transactions on Systems, Man, and Cybernetics: Systems55\(6\),pp\. 4202–4215\.External Links:[Document](https://dx.doi.org/10.1109/TSMC.2025.3549627)Cited by:[§V](https://arxiv.org/html/2607.01021#S5.p2.1)\.
- \[12\]M\. J\. Lighthill and G\. B\. Whitham\(1955\)On kinematic waves i\. flood movement in long rivers\.Proceedings of the Royal Society of London\. Series A\. Mathematical and Physical Sciences229\(1178\),pp\. 281–316\.Cited by:[§II\-A](https://arxiv.org/html/2607.01021#S2.SS1.p1.1)\.
- \[13\]T\. Lilasathapornkit and M\. Saberi\(2022\)Dynamic pedestrian traffic assignment with link transmission model for bidirectional sidewalk networks\.Transportation research part C: emerging technologies145,pp\. 103930\.Cited by:[§I](https://arxiv.org/html/2607.01021#S1.p4.1),[§II\-B](https://arxiv.org/html/2607.01021#S2.SS2.p1.3),[§IV](https://arxiv.org/html/2607.01021#S4.p3.2)\.
- \[14\]Y\. Liu, C\. Sun, and Y\. Bie\(2015\)Modeling unidirectional pedestrian movement: an investigation of diffusion behavior in the built environment\.Mathematical Problems in Engineering2015\(1\),pp\. 308261\.Cited by:[§I](https://arxiv.org/html/2607.01021#S1.p8.1),[§II\-D](https://arxiv.org/html/2607.01021#S2.SS4.p1.4)\.
- \[15\]P\. A\. Lopez, M\. Behrisch, L\. Bieker\-Walz, J\. Erdmann, Y\. Flötteröd, R\. Hilbrich, L\. Lücken, J\. Rummel, P\. Wagner, and E\. Wießner\(2018\)Microscopic traffic simulation using sumo\.In2018 21st international conference on intelligent transportation systems \(ITSC\),pp\. 2575–2582\.Cited by:[TABLE I](https://arxiv.org/html/2607.01021#S1.T1.9.4.3.1),[§I](https://arxiv.org/html/2607.01021#S1.p6.1)\.
- \[16\]G\. G\. Løvås\(1994\)Modeling and simulation of pedestrian traffic flow\.Transportation Research Part B: Methodological28\(6\),pp\. 429–443\.Cited by:[§I](https://arxiv.org/html/2607.01021#S1.p1.1),[§I](https://arxiv.org/html/2607.01021#S1.p3.1)\.
- \[17\]N\. Molyneaux and M\. Bierlaire\(2022\)Controlling pedestrian flows with moving walkways\.Transportation research part C: emerging technologies141,pp\. 103672\.Cited by:[§I](https://arxiv.org/html/2607.01021#S1.p2.1)\.
- \[18\]N\. Molyneaux, R\. Scarinci, and M\. Bierlaire\(2021\)Design and analysis of control strategies for pedestrian flows\.Transportation48\(4\),pp\. 1767–1807\.Cited by:[§I](https://arxiv.org/html/2607.01021#S1.p2.1),[§V](https://arxiv.org/html/2607.01021#S5.p2.1),[§V](https://arxiv.org/html/2607.01021#S5.p4.1)\.
- \[19\]A\. Tordeux, G\. Lämmel, F\. S\. Hänseler, and B\. Steffen\(2018\)A mesoscopic model for large\-scale simulation of pedestrian dynamics\.Transportation research part C: emerging technologies93,pp\. 128–147\.Cited by:[§I](https://arxiv.org/html/2607.01021#S1.p1.1)\.
- \[20\]T\. P\. van Oijen, W\. Daamen, and S\. P\. Hoogendoorn\(2020\)Estimation of a recursive link\-based logit model and link flows in a sensor equipped network\.Transportation Research Part B: Methodological140,pp\. 262–281\.Cited by:[§I](https://arxiv.org/html/2607.01021#S1.p1.1)\.
- \[21\]P\. Varaiya\(2013\)Max pressure control of a network of signalized intersections\.Transportation Research Part C: Emerging Technologies36,pp\. 177–195\.Cited by:[Appendix A](https://arxiv.org/html/2607.01021#A1.SS0.SSS0.Px2.p1.5)\.
- \[22\]K\. W Axhausen, A\. Horni, and K\. Nagel\(2016\)The multi\-agent transport simulation matsim\.Ubiquity Press\.Cited by:[TABLE I](https://arxiv.org/html/2607.01021#S1.T1.9.5.4.1),[§I](https://arxiv.org/html/2607.01021#S1.p6.1)\.
- \[23\]A\. K\. Wagoum, M\. Chraibi, J\. Zhang, and G\. Lämmel\(2015\)JuPedSim: an open framework for simulating and analyzing the dynamics of pedestrians\.In3rd Conference of Transportation Research Group of India,Vol\.12\.Cited by:[TABLE I](https://arxiv.org/html/2607.01021#S1.T1.9.2.1.1),[§I](https://arxiv.org/html/2607.01021#S1.p6.1)\.
- \[24\]Weiming Mai\(2026\-02\)PedNStream\.External Links:[Link](https://github.com/WaimenMak/PedNStream)Cited by:[§I](https://arxiv.org/html/2607.01021#S1.p8.1)\.
- \[25\]I\. Yperman, S\. Logghe, and B\. Immers\(2005\)The link transmission model: an efficient implementation of the kinematic wave theory in traffic networks\.InProceedings of the 10th EWGT Meeting,Vol\.24,pp\. 122–127\.Cited by:[§I](https://arxiv.org/html/2607.01021#S1.p3.1),[§II\-A](https://arxiv.org/html/2607.01021#S2.SS1.p1.1),[§IV](https://arxiv.org/html/2607.01021#S4.p1.4)\.

Similar Articles

SupplyNetPy: An Open-Source Python Library for High-Fidelity Modeling and Simulation of Arbitrary Supply Chain and Inventory Networks

arXiv cs.AI

SupplyNetPy is an open-source Python library for high-fidelity modeling and discrete-event simulation of arbitrary supply chain networks, supporting multi-echelon structures, replenishment policies, perishable inventory, disruptions, and stochastic demand. It aims to enable programmatic simulation for design-space exploration, what-if analysis, and digital twins.

A Graph-Based Control Interface for Traffic Signals on Heterogeneous Road Networks

arXiv cs.LG

This paper presents a graph-based traffic signal control interface using a shared graph neural network to assign scores to movements, with deterministic phase construction via incidence matrices. Experiments evaluate transfer across synthetic and city road networks, showing feasibility but sensitivity to distribution shifts.