pub struct DestinationLog { /* private fields */ }Expand description
Append-only log of rider destinations, mirror of ArrivalLog
for the outgoing side of a trip.
Enables destination-aware signals that the origin-only
ArrivalLog can’t produce — specifically
TrafficMode::DownPeak
detection, which triggers on “lots of riders heading to the
lobby” rather than “lots of riders arriving from it.”
Auto-installed alongside ArrivalLog by Simulation::new and
appended to in the same rider-spawn path. Shares
ArrivalLogRetention’s retention window so the two logs can’t
drift against each other’s time horizon.
Implementations§
Source§impl DestinationLog
impl DestinationLog
Sourcepub fn record(&mut self, tick: u64, destination: EntityId)
pub fn record(&mut self, tick: u64, destination: EntityId)
Record that a rider spawned at tick heading to destination.
Sourcepub fn destinations_in_window(
&self,
stop: EntityId,
now: u64,
window_ticks: u64,
) -> u64
pub fn destinations_in_window( &self, stop: EntityId, now: u64, window_ticks: u64, ) -> u64
Count rides to stop within the window [now - window, now]
inclusive. window_ticks = 0 always returns 0.
Sourcepub fn prune_before(&mut self, cutoff: u64)
pub fn prune_before(&mut self, cutoff: u64)
Prune entries older than cutoff ticks. Called from
Simulation::advance_tick alongside ArrivalLog::prune_before.
Sourcepub fn remap_entity_ids(&mut self, id_remap: &HashMap<EntityId, EntityId>)
pub fn remap_entity_ids(&mut self, id_remap: &HashMap<EntityId, EntityId>)
Remap entity IDs for snapshot restore. Mirrors
ArrivalLog::remap_entity_ids.
Trait Implementations§
Source§impl Clone for DestinationLog
impl Clone for DestinationLog
Source§fn clone(&self) -> DestinationLog
fn clone(&self) -> DestinationLog
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more