pub struct LoopScheduleDispatch { /* private fields */ }Expand description
Dispatch strategy that holds Loop cars to a uniform dwell at every stop.
See the module-level documentation for the full contract. The two
tunable fields are exposed through accessors so hosts can inspect
the schedule in-flight (HUDs, debuggers). The struct itself is
immutable after construction — replace the active strategy via
Simulation::set_dispatch
with a freshly-built instance to retune live, or rely on
restore_config on the snapshot
path.
Implementations§
Source§impl LoopScheduleDispatch
impl LoopScheduleDispatch
Sourcepub const fn new(dwell_ticks: u32, target_headway_ticks: u32) -> Self
pub const fn new(dwell_ticks: u32, target_headway_ticks: u32) -> Self
Construct a LoopScheduleDispatch.
Both dwell_ticks and target_headway_ticks are clamped to a
minimum of 1 — a zero dwell would collapse the door cycle into
a no-op (the car arrives, immediately departs, never boards),
and a zero headway is meaningless. Construction-time validation
in validate_explicit_topology rejects pathological values up
front; this clamp is a defence in depth for hosts wiring the
strategy at runtime through set_dispatch.
Sourcepub const fn dwell_ticks(&self) -> u32
pub const fn dwell_ticks(&self) -> u32
Dwell at each stop, in ticks. See Self::new for the
invariants this guarantees.
Sourcepub const fn target_headway_ticks(&self) -> u32
pub const fn target_headway_ticks(&self) -> u32
Desired tick gap between consecutive arrivals.
Trait Implementations§
Source§impl Clone for LoopScheduleDispatch
impl Clone for LoopScheduleDispatch
Source§fn clone(&self) -> LoopScheduleDispatch
fn clone(&self) -> LoopScheduleDispatch
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for LoopScheduleDispatch
impl Debug for LoopScheduleDispatch
Source§impl Default for LoopScheduleDispatch
impl Default for LoopScheduleDispatch
Source§impl<'de> Deserialize<'de> for LoopScheduleDispatch
impl<'de> Deserialize<'de> for LoopScheduleDispatch
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl DispatchStrategy for LoopScheduleDispatch
impl DispatchStrategy for LoopScheduleDispatch
Source§fn pre_dispatch(
&mut self,
group: &ElevatorGroup,
_manifest: &DispatchManifest,
world: &mut World,
)
fn pre_dispatch( &mut self, group: &ElevatorGroup, _manifest: &DispatchManifest, world: &mut World, )
Source§fn builtin_id(&self) -> Option<BuiltinStrategy>
fn builtin_id(&self) -> Option<BuiltinStrategy>
Simulation::new can stamp the
correct BuiltinStrategy into the group’s snapshot identity. Read moreSource§fn snapshot_config(&self) -> Option<String>
fn snapshot_config(&self) -> Option<String>
restore_config can apply to a
freshly-instantiated instance. Read moreSource§fn restore_config(&mut self, config: &str) -> Result<(), String>
fn restore_config(&mut self, config: &str) -> Result<(), String>
snapshot_config on the same
strategy variant. Called by
crate::snapshot::WorldSnapshot::restore immediately after
BuiltinStrategy::instantiate builds the default instance,
so the restore writes over the defaults. Read more