pub struct NearestCarDispatch;Expand description
Scores (car, stop) by absolute distance between the car and the stop.
Paired with the Hungarian assignment in the dispatch system, this yields the globally minimum-total-distance matching across the group — no two cars can be sent to the same hall call.
Two guards are applied on top of the raw distance:
- The
(car, stop)pair must be serviceable — at least one aboard rider can exit, or at least one waiting rider can fit. A full car at a pickup stop it cannot serve otherwise self-assigns at zero cost (doors cycle open → reject → close forever). - A car carrying riders refuses pickups that would pull it backward (off the path to every aboard rider’s destination). Without this, a stream of closer-destination boarders can indefinitely preempt a farther aboard rider’s delivery — the reported “never reaches the passenger’s desired stop” loop.
Implementations§
Trait Implementations§
Source§impl Default for NearestCarDispatch
impl Default for NearestCarDispatch
Source§impl DispatchStrategy for NearestCarDispatch
impl DispatchStrategy for NearestCarDispatch
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, )
Optional hook called once per group before the assignment pass. Read more
Source§fn prepare_car(
&mut self,
_car: EntityId,
_car_position: f64,
_group: &ElevatorGroup,
_manifest: &DispatchManifest,
_world: &World,
)
fn prepare_car( &mut self, _car: EntityId, _car_position: f64, _group: &ElevatorGroup, _manifest: &DispatchManifest, _world: &World, )
Source§fn fallback(
&mut self,
_car: EntityId,
_car_position: f64,
_group: &ElevatorGroup,
_manifest: &DispatchManifest,
_world: &World,
) -> DispatchDecision
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)
fn notify_removed(&mut self, _elevator: EntityId)
Notify the strategy that an elevator has been removed. Read more
Auto Trait Implementations§
impl Freeze for NearestCarDispatch
impl RefUnwindSafe for NearestCarDispatch
impl Send for NearestCarDispatch
impl Sync for NearestCarDispatch
impl Unpin for NearestCarDispatch
impl UnsafeUnpin for NearestCarDispatch
impl UnwindSafe for NearestCarDispatch
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more