This release is a pre-release and may not be stable for production use.
PedNStream: Pedestrian Network Flow Simulator
PedNStream is a light-weight/Python-native pedestrian traffic simulation tool based on the Link Transmission Model (LTM). It enables modeling and simulation of pedestrian movements through complex networks, providing insights into crowd dynamics and flow behaviors.
Key Features
- Network-based Simulation: Model pedestrian movement through interconnected pathways and decision points
- Flexible Network Configuration: Support for various network topologies from simple corridors to complex urban layouts
- Customizable Parameters: Configure link properties, flow speeds, and capacity constraints
- Visualization Tools: Analyze simulation outputs through interactive visualizations and animations
Modular Design
Network Module (src/LTM/network.py)
The central component managing the simulation network and execution:
- Flow assignment based in link's sending and receiving flow
- Step-by-step simulation execution
- Integration of links and nodes
Link Module (src/LTM/link.py)
Models physical pathways with properties like:
- Length and width
- Free-flow speed
- Critical and jam densities
- Bi-directional flow support
Node Module (src/LTM/node.py)
Handles intersection points and decision making:
- Flow distribution between connected links
- Turning fraction calculation
Path Finding (src/LTM/path_finder.py)
Manages route choice and navigation:
- K shortest paths between origins and destinations
- Route choise based in utility function
Quick Start
Basic Network Simulation
from src.utils.env_loader import NetworkEnvGenerator
from src.utils.visualizer import NetworkVisualizer
# Initialize network from configuration
env_generator = NetworkEnvGenerator()
network_env = env_generator.create_network("example_config")
# Run simulation
for t in range(1, env_generator.config['params']['simulation_steps']):
network_env.network_loading(t)
# Visualize results
visualizer = NetworkVisualizer(simulation_dir="output_dir")
anim = visualizer.animate_network(
start_time=0,
end_time=env_generator.config['params']['simulation_steps'],
edge_property='density'
)
Configuration Example
# sim_params.yaml
network:
adjacency_matrix: [
[0, 1, 1, 0, 0, 0], # node 0
[1, 0, 0, 1, 0, 0], # node 1
[1, 0, 0, 1, 1, 0], # node 2
[0, 1, 1, 0, 0, 1], # node 3
[0, 0, 1, 0, 0, 1], # node 4
[0, 0, 0, 1, 1, 0] # node 5
]
origin_nodes: [1]
destination_nodes: [5]
simulation:
unit_time: 10
simulation_steps: 500
default_link:
length: 50
width: 1
free_flow_speed: 1.5
k_critical: 2
k_jam: 6
demand:
origin_0:
peak_lambda: 15
base_lambda: 5
Example Scenarios
The examples/ directory contains various simulation scenarios:
long_corridor.py: Simple bi-directional flow in a corridornine_node.py: Grid network with multiple OD pairsdelft_exp.py: Real-world network simulation (Delft, Netherlands)melbourne.py: Large-scale urban network simulation
Visualization
PedNStream provides rich visualization capabilities:
- Network state visualization
- Density and flow animations
- Interactive network dashboard
- Time-series analysis tools
Demo on Delft Center
Project Structure
project_root/
├── src/
│ ├── LTM/ # Core simulation components
│ │ ├── link.py # Link dynamics
│ │ ├── node.py # Node behavior
│ │ ├── network.py # Network management
│ │ └── path_finder.py # Route choice
│ └── utils/ # Utility functions
│ ├── visualizer.py # Visualization tools
│ └── env_loader.py # Environment setup
├── examples/ # Example scenarios
└── data/ # Network configurations
Contributing
Contributions are welcome! Please check the issues page for current development priorities.
License
PedNStream is released under the MIT License. See the LICENSE file for details.
Metadata
Release files for pednstream 0.0.2a0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pednstream-0.0.2a0.tar.gz | 9.5 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pednstream-0.0.2a0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 9.6 MB
Release files / pednstream-0.0.2a0.tar.gz
| Download URL | pednstream-0.0.2a0.tar.gz |
|---|---|
| Size | 9.5 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d904ae8af7f41078b026f69f8848167be62062301af3c3fc659b5b3bbaf8031f
|
|
BLAKE2b-256 checksum How to use checksums |
28b84f4ef014ae79e32f5cf7e59fba1202abc179655b6bf402166f569eaa0d1a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 11, 2026.
Transparency logRelease files / pednstream-0.0.2a0-py3-none-any.whl
| Download URL | pednstream-0.0.2a0-py3-none-any.whl |
|---|---|
| Size | 52.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3c78600e778d00db325ebc759a616647f4060f574d158bc5244843e9ab3d8fa8
|
|
BLAKE2b-256 checksum How to use checksums |
431714fae78dba81cbf3180f84afd0f0ffa39917c64f674158c70cf568433de4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 11, 2026.
Transparency log