Expand description
§Macro Traffic Simulation Core
Implementation of the classical 4-step macroscopic traffic demand model:
- Trip Generation - Produces trip productions/attractions per zone
- Trip Distribution - Gravity model with Furness balancing
- Mode Choice - Multinomial logit (AUTO, BIKE, WALK)
- Traffic Assignment - User Equilibrium via Frank-Wolfe, MSA, or Gradient Projection
§Network Format
Based on GMNS (General Modeling Network Specification) at the mesoscopic level. Turn restrictions are encoded in the graph topology: connection links exist only for allowed movements. Routing algorithms respect restrictions automatically.
§Quick Start
use macro_traffic_sim_core::config::{ModelConfig, AssignmentMethodType};
use macro_traffic_sim_core::pipeline::run_four_step_model;
use macro_traffic_sim_core::trip_generation::RegressionGenerator;
use macro_traffic_sim_core::trip_distribution::ExponentialImpedance;
use macro_traffic_sim_core::mode_choice::MultinomialLogit;
// Acquire meso network (load from CSV/JSON/REST API, whatever), configure, and runModules§
- assignment
- Traffic Assignment Module (Step 4)
- config
- Configuration
- error
- Error Module
- gmns
- GMNS Module
- mode_
choice - Mode Choice Module (Step 3)
- od
- OD Matrix Module
- pipeline
- Pipeline Module
- trip_
distribution - Trip Distribution Module (Step 2)
- trip_
generation - Trip Generation Module (Step 1)
- verbose
- Logging Module
- zone
- Zone
Macros§
- log_
additional - Logs a debug-level message if the global verbose level is
VerboseLevel::Additionalor higher. - log_all
- Logs a trace-level message if the global verbose level is
VerboseLevel::All. - log_
main - Logs an info-level message if the global verbose level is
VerboseLevel::Mainor higher. - verbose_
log - Convenience macro for global verbose logging.