pub struct ElevatorGroup { /* private fields */ }Expand description
Runtime elevator group: a set of lines sharing a dispatch strategy.
A group is the logical dispatch unit. It contains one or more
LineInfo entries, each representing a physical path with its
elevators and served stops.
The flat elevator_entities and stop_entities fields are derived
caches (union of all lines’ elevators/stops), rebuilt automatically
via rebuild_caches().
Implementations§
Source§impl ElevatorGroup
impl ElevatorGroup
Sourcepub fn new(id: GroupId, name: String, lines: Vec<LineInfo>) -> Self
pub fn new(id: GroupId, name: String, lines: Vec<LineInfo>) -> Self
Create a new group with the given lines. Caches are built automatically.
Defaults: HallCallMode::Classic, ack_latency_ticks = 0.
Sourcepub const fn with_hall_call_mode(self, mode: HallCallMode) -> Self
pub const fn with_hall_call_mode(self, mode: HallCallMode) -> Self
Override the hall call mode for this group.
Sourcepub const fn with_ack_latency_ticks(self, ticks: u32) -> Self
pub const fn with_ack_latency_ticks(self, ticks: u32) -> Self
Override the ack latency for this group.
Sourcepub const fn set_hall_call_mode(&mut self, mode: HallCallMode)
pub const fn set_hall_call_mode(&mut self, mode: HallCallMode)
Set the hall call mode in-place (for mutation via
Simulation::groups_mut).
Sourcepub const fn set_ack_latency_ticks(&mut self, ticks: u32)
pub const fn set_ack_latency_ticks(&mut self, ticks: u32)
Set the ack latency in-place.
Sourcepub const fn hall_call_mode(&self) -> HallCallMode
pub const fn hall_call_mode(&self) -> HallCallMode
Hall call mode for this group.
Sourcepub const fn ack_latency_ticks(&self) -> u32
pub const fn ack_latency_ticks(&self) -> u32
Controller ack latency for this group.
Sourcepub const fn lines_mut(&mut self) -> &mut Vec<LineInfo>
pub const fn lines_mut(&mut self) -> &mut Vec<LineInfo>
Mutable access to lines (call rebuild_caches() after mutating).
Sourcepub fn elevator_entities(&self) -> &[EntityId]
pub fn elevator_entities(&self) -> &[EntityId]
Elevator entities belonging to this group (derived from lines).
Sourcepub fn stop_entities(&self) -> &[EntityId]
pub fn stop_entities(&self) -> &[EntityId]
Stop entities served by this group (derived from lines, deduplicated).
Sourcepub fn rebuild_caches(&mut self)
pub fn rebuild_caches(&mut self)
Rebuild derived caches from lines. Call after mutating lines.
Trait Implementations§
Source§impl Clone for ElevatorGroup
impl Clone for ElevatorGroup
Source§fn clone(&self) -> ElevatorGroup
fn clone(&self) -> ElevatorGroup
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more