pub struct PredictiveParking { /* private fields */ }Expand description
Predictive parking: park idle elevators near stops with the highest recent per-stop arrival rate.
Reads the ArrivalLog and CurrentTick world resources
(always present under a built sim) to compute a rolling window of
arrivals. Cars are greedily assigned to the highest-rate stops that
don’t already have a car nearby, so the group spreads across the
hottest floors rather than clustering on one.
Parallels the headline feature of Otis Compass Infinity — forecast demand from recent traffic, pre-position cars accordingly. Falls back to no-op when no arrivals have been logged.
Implementations§
Source§impl PredictiveParking
impl PredictiveParking
Sourcepub const fn new() -> Self
pub const fn new() -> Self
Create with the default rolling window
(DEFAULT_ARRIVAL_WINDOW_TICKS).
Sourcepub const fn with_window_ticks(window_ticks: u64) -> Self
pub const fn with_window_ticks(window_ticks: u64) -> Self
Create with a custom rolling window (ticks). Shorter windows react faster to traffic shifts; longer windows smooth out noise.
§Panics
Panics on window_ticks == 0. A zero window would cause
ArrivalLog::arrivals_in_window to return 0 for every stop —
the strategy would silently no-op, which is almost never what
the caller meant.