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.
Implementations§
Trait Implementations§
Source§impl Default for NearestCarDispatch
impl Default for NearestCarDispatch
Source§impl DispatchStrategy for NearestCarDispatch
impl DispatchStrategy for NearestCarDispatch
Source§fn rank(
&mut self,
_car: EntityId,
car_position: f64,
_stop: EntityId,
stop_position: f64,
_group: &ElevatorGroup,
_manifest: &DispatchManifest,
_world: &World,
) -> Option<f64>
fn rank( &mut self, _car: EntityId, car_position: f64, _stop: EntityId, stop_position: f64, _group: &ElevatorGroup, _manifest: &DispatchManifest, _world: &World, ) -> Option<f64>
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