#[non_exhaustive]pub struct HallCall {
pub stop: EntityId,
pub direction: CallDirection,
pub press_tick: u64,
pub acknowledged_at: Option<u64>,
pub ack_latency_ticks: u32,
pub pending_riders: Vec<EntityId>,
pub destination: Option<EntityId>,
pub assigned_cars_by_line: BTreeMap<EntityId, EntityId>,
pub pinned: bool,
}Expand description
A pressed hall button at stop requesting service in direction.
Stored per (stop, direction) pair — at most two per stop. Built-in
dispatch reads calls via DispatchManifest::iter_hall_calls.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.stop: EntityIdStop where the button was pressed.
direction: CallDirectionDirection the button requests.
press_tick: u64Tick at which the button was first pressed.
acknowledged_at: Option<u64>Tick at which dispatch first sees this call (after ack latency).
None while still pending acknowledgement.
ack_latency_ticks: u32Ticks the controller took to acknowledge this call, copied from
the serving group’s ElevatorGroup::ack_latency_ticks when the
button was first pressed. Stored on the call itself so
advance_transient can tick the counter without needing to
look up the group.
pending_riders: Vec<EntityId>Riders currently waiting on this call. Empty in
HallCallMode::Destination mode
— calls there carry a single destination per press instead of a
shared direction.
destination: Option<EntityId>Destination requested at press time. Populated in
HallCallMode::Destination mode
(lobby kiosk); None in Classic mode.
assigned_cars_by_line: BTreeMap<EntityId, EntityId>Cars assigned to this call by dispatch, keyed by the line entity the car runs on. A stop served by multiple lines can hold one entry per line simultaneously — the low-bank car, the express car, and the service car can all be en route to the same lobby without one overwriting another. Within a single line the latest assignment replaces the previous one.
Pre-15.23 snapshots stored a single assigned_car: Option<EntityId>
field. Those snapshots silently drop the transient assignment on
load (serde’s default unknown-field handling); the next dispatch
pass repopulates this map.
pinned: boolWhen true, dispatch is forbidden from reassigning this call to
a different car. Set by
Simulation::pin_assignment.
Implementations§
Source§impl HallCall
impl HallCall
Sourcepub const fn new(
stop: EntityId,
direction: CallDirection,
press_tick: u64,
) -> Self
pub const fn new( stop: EntityId, direction: CallDirection, press_tick: u64, ) -> Self
Create a new unacknowledged, unassigned hall call.
Sourcepub const fn is_acknowledged(&self) -> bool
pub const fn is_acknowledged(&self) -> bool
Returns true when dispatch is allowed to see this call (ack
latency has elapsed).
Sourcepub fn any_assigned_car(&self) -> Option<EntityId>
pub fn any_assigned_car(&self) -> Option<EntityId>
Any car currently assigned to this call, preferring the entry
with the numerically smallest line-entity key (stable across
ticks because BTreeMap iteration is ordered). None when no
line has recorded an assignment yet.
This matches the pre-per-line assigned_car semantics for
callers that just want “is anyone coming?” The richer shape is
available directly on assigned_cars_by_line.