Skip to main content

EtdDispatch

Struct EtdDispatch 

Source
pub struct EtdDispatch {
    pub wait_weight: f64,
    pub delay_weight: f64,
    pub door_weight: f64,
    /* private fields */
}
Expand description

Estimated Time to Destination (ETD) dispatch algorithm.

For each (car, stop) pair the rank is a cost estimate combining travel time, delay imposed on riders already aboard, door-overhead for intervening stops, and a small bonus for cars already heading toward the stop. The dispatch system runs an optimal assignment across all pairs so the globally best matching is chosen.

Fields§

§wait_weight: f64

Weight for travel time to reach the calling stop.

§delay_weight: f64

Weight for delay imposed on existing riders.

§door_weight: f64

Weight for door open/close overhead at intermediate stops.

Implementations§

Source§

impl EtdDispatch

Source

pub fn new() -> Self

Create a new EtdDispatch with default weights.

Defaults: wait_weight = 1.0, delay_weight = 1.0, door_weight = 0.5.

Source

pub fn with_delay_weight(delay_weight: f64) -> Self

Create with a single delay weight (backwards-compatible shorthand).

Source

pub fn with_weights( wait_weight: f64, delay_weight: f64, door_weight: f64, ) -> Self

Create with fully custom weights.

Trait Implementations§

Source§

impl Default for EtdDispatch

Source§

fn default() -> Self

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

impl DispatchStrategy for EtdDispatch

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( &mut self, car: EntityId, car_position: f64, _stop: EntityId, stop_position: f64, _group: &ElevatorGroup, _manifest: &DispatchManifest, world: &World, ) -> Option<f64>

Score the cost of sending car to stop. Lower is better. 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

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.