Skip to main content

DestinationDispatch

Struct DestinationDispatch 

Source
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

Source

pub const fn new() -> Self

Create a new DestinationDispatch with defaults (immediate sticky, no commitment window).

Source

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).

Source

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.

Source

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

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for DestinationDispatch

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl DispatchStrategy for DestinationDispatch

Source§

fn pre_dispatch( &mut self, group: &ElevatorGroup, manifest: &DispatchManifest, world: &mut World, )

Optional hook called once per group before the assignment pass. Read more
Source§

fn rank(&self, ctx: &RankContext<'_>) -> Option<f64>

Score the cost of sending car to stop. Lower is better. Read more
Source§

fn builtin_id(&self) -> Option<BuiltinStrategy>

If this strategy is a known built-in variant, return it so Simulation::new can stamp the correct BuiltinStrategy into the group’s snapshot identity. Read more
Source§

fn candidate_limit(&self) -> Option<usize>

Maximum candidate stops the assignment phase considers per car. Read more
Source§

fn snapshot_config(&self) -> Option<String>

Serialize this strategy’s tunable configuration to a string that restore_config can apply to a freshly-instantiated instance. Read more
Source§

fn restore_config(&mut self, serialized: &str) -> Result<(), String>

Restore tunable configuration from a string previously produced by 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
Source§

fn prepare_car( &mut self, _car: EntityId, _car_position: f64, _group: &ElevatorGroup, _manifest: &DispatchManifest, _world: &World, )

Optional hook called once per candidate car, before any rank calls for that car in the current pass. Read more
Source§

fn fallback( &mut self, _car: EntityId, _car_position: f64, _group: &ElevatorGroup, _manifest: &DispatchManifest, _world: &World, ) -> DispatchDecision

Decide what an idle car should do when no stop was assigned to it. Read more
Source§

fn notify_removed(&mut self, _elevator: EntityId)

Notify the strategy that an elevator has been removed. Read more
Source§

impl Serialize for DestinationDispatch

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,