PedNStream is a light-weight/Python-native pedestrian traffic simulation tool based on the Link Transmission Model (LTM)
Project description
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pednstream-0.0.1a0.tar.gz.
File metadata
- Download URL: pednstream-0.0.1a0.tar.gz
- Upload date:
- Size: 34.5 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
da6f0e2a56053b03c5ed5a1a94a2bfa0bf7a0fe5971598797b41e66844dbfb76
|
|
| MD5 |
a6b52ab225362a76833cccafb3a30b6d
|
|
| BLAKE2b-256 |
d1b9d3930cd5107f110a4969f5f585e2ae6989b03dc8a07f9358dd9b85925319
|
Provenance
The following attestation bundles were made for pednstream-0.0.1a0.tar.gz:
Publisher:
published.yml on WaimenMak/PedNStream
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pednstream-0.0.1a0.tar.gz -
Subject digest:
da6f0e2a56053b03c5ed5a1a94a2bfa0bf7a0fe5971598797b41e66844dbfb76 - Sigstore transparency entry: 969502899
- Sigstore integration time:
-
Permalink:
WaimenMak/PedNStream@fe5054088111eb76c629bafa8433a7113b985f2d -
Branch / Tag:
refs/heads/main - Owner: https://github.com/WaimenMak
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
published.yml@fe5054088111eb76c629bafa8433a7113b985f2d -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file pednstream-0.0.1a0-py3-none-any.whl.
File metadata
- Download URL: pednstream-0.0.1a0-py3-none-any.whl
- Upload date:
- Size: 57.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bb20cb32f1936af2cc91fb891647637e3522f7d0952487a1d00c76f16414a7b7
|
|
| MD5 |
e9398042f44431cb423396f3451f7d29
|
|
| BLAKE2b-256 |
9a11d1097df6a942de56b0cfea34233f88863da015a5a9c9be3851ab11a7c397
|
Provenance
The following attestation bundles were made for pednstream-0.0.1a0-py3-none-any.whl:
Publisher:
published.yml on WaimenMak/PedNStream
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pednstream-0.0.1a0-py3-none-any.whl -
Subject digest:
bb20cb32f1936af2cc91fb891647637e3522f7d0952487a1d00c76f16414a7b7 - Sigstore transparency entry: 969502902
- Sigstore integration time:
-
Permalink:
WaimenMak/PedNStream@fe5054088111eb76c629bafa8433a7113b985f2d -
Branch / Tag:
refs/heads/main - Owner: https://github.com/WaimenMak
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
published.yml@fe5054088111eb76c629bafa8433a7113b985f2d -
Trigger Event:
workflow_dispatch
-
Statement type: