Skip to main content

Crate macro_traffic_sim_core

Crate macro_traffic_sim_core 

Source
Expand description

§Macro Traffic Simulation Core

Implementation of the classical 4-step macroscopic traffic demand model:

  1. Trip Generation - Produces trip productions/attractions per zone
  2. Trip Distribution - Gravity model with Furness balancing
  3. Mode Choice - Multinomial logit (AUTO, BIKE, WALK)
  4. 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 run

Modules§

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::Additional or 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::Main or higher.
verbose_log
Convenience macro for global verbose logging.