Skip to main content

Module traffic_detector

Module traffic_detector 

Source
Expand description

Traffic-mode detector (up-peak / idle / inter-floor). Traffic-mode detector.

Classifies the current simulation moment into one of a small set of TrafficMode variants by reading the ArrivalLog’s rolling window. Consumers — dispatch tuning, adaptive reposition, HUD narration — read crate::traffic_detector::TrafficDetector::current_mode each tick to get a cheap, pre-computed answer instead of re-deriving it themselves.

V1 implements the hard-rule classifier from Siikonen’s fuzzy-labelled traffic patterns (the fuzzy membership math reduces to the same threshold crossings once defuzzified): up-peak is triggered when the lobby-origin fraction crosses a threshold over a rolling window; idle when the total arrival rate is below a noise floor; everything else is inter-floor. Down-peak detection needs a destination signal (rides heading to the lobby, not arrivals from it) which the base ArrivalLog doesn’t carry; crate::traffic_detector::TrafficMode::DownPeak is in the enum for API stability and will flip on in a follow-up.

Structs§

TrafficDetector
Rolling-window classifier for the sim’s current traffic pattern.

Enums§

TrafficMode
Detected traffic mode. Consumers read this via TrafficDetector::current_mode each tick.