pub struct LoopScheduleDispatch { /* private fields */ }Expand description
Dispatch strategy that holds Loop cars to a uniform dwell at every stop, with hold-recovery to keep the timetable stable under load.
See the module-level documentation for the full contract. The
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 fn new(
dwell_ticks: u32,
target_headway_ticks: u32,
hold_cap_ticks: u32,
) -> Self
pub fn new( dwell_ticks: u32, target_headway_ticks: u32, hold_cap_ticks: u32, ) -> Self
Construct a LoopScheduleDispatch with explicit tunables.
All three integer parameters are clamped to a minimum of 1:
a zero dwell would collapse the door cycle into a no-op, a zero
headway would never trigger recovery, and a zero hold cap would
disable recovery entirely (use a small but positive value to
keep recovery active without unbounded waits).
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 at the same stop.
Sourcepub const fn hold_cap_ticks(&self) -> u32
pub const fn hold_cap_ticks(&self) -> u32
Maximum extra dwell hold-recovery will apply per stop.
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