pub struct DestinationDispatch { /* private fields */ }Expand description
Hall-call destination dispatch (DCS).
§API shape
Uses DispatchStrategy::pre_dispatch to write sticky
AssignedCar extensions and rebuild each car’s committed stop
queue during a &mut World phase. DispatchStrategy::rank then
routes each car to its own queue front and returns None for every
other stop, so the group-wide Hungarian assignment trivially pairs
each car with the stop it has already committed to.
Implementations§
Source§impl DestinationDispatch
impl DestinationDispatch
Sourcepub const fn new() -> Self
pub const fn new() -> Self
Create a new DestinationDispatch with defaults (immediate sticky,
no commitment window).
Sourcepub const fn with_stop_penalty(self, penalty: f64) -> Self
pub const fn with_stop_penalty(self, penalty: f64) -> Self
Override the fresh-stop penalty (ticks per new stop added to a car’s committed route when it picks this rider up).
Sourcepub const fn with_commitment_window_ticks(self, window: u64) -> Self
pub const fn with_commitment_window_ticks(self, window: u64) -> Self
Enable deferred commitment: riders’ sticky assignments are
re-evaluated each pass until the currently-assigned car is
within window ticks of the rider’s origin. At that point the
commitment latches and later ticks leave the assignment alone.
Sourcepub const fn with_candidate_limit(self, limit: Option<usize>) -> Self
pub const fn with_candidate_limit(self, limit: Option<usize>) -> Self
Set the per-car candidate limit for the assignment cost matrix.
None disables pruning entirely; defaults to Some(50). See
DispatchStrategy::candidate_limit for the rationale.
Trait Implementations§
Source§impl Default for DestinationDispatch
impl Default for DestinationDispatch
Source§impl<'de> Deserialize<'de> for DestinationDispatch
impl<'de> Deserialize<'de> for DestinationDispatch
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 DestinationDispatch
impl DispatchStrategy for DestinationDispatch
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 candidate_limit(&self) -> Option<usize>
fn candidate_limit(&self) -> Option<usize>
Source§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, serialized: &str) -> Result<(), String>
fn restore_config(&mut self, serialized: &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