pub struct LookDispatch { /* private fields */ }Expand description
Elevator dispatch using the LOOK algorithm.
Like SCAN, but reverses at the last request in the current direction instead of traveling to the end of the shaft. More efficient than pure SCAN for sparse request distributions.
This is the standard “elevator algorithm” used in real buildings.
Implementations§
Source§impl LookDispatch
impl LookDispatch
Trait Implementations§
Source§impl Default for LookDispatch
impl Default for LookDispatch
Source§impl DispatchStrategy for LookDispatch
impl DispatchStrategy for LookDispatch
Source§fn decide(
&mut self,
elevator: EntityId,
elevator_position: f64,
group: &ElevatorGroup,
manifest: &DispatchManifest,
world: &World,
) -> DispatchDecision
fn decide( &mut self, elevator: EntityId, elevator_position: f64, group: &ElevatorGroup, manifest: &DispatchManifest, world: &World, ) -> DispatchDecision
Decide for a single elevator.
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
Source§fn decide_all(
&mut self,
elevators: &[(EntityId, f64)],
group: &ElevatorGroup,
manifest: &DispatchManifest,
world: &World,
) -> Vec<(EntityId, DispatchDecision)>
fn decide_all( &mut self, elevators: &[(EntityId, f64)], group: &ElevatorGroup, manifest: &DispatchManifest, world: &World, ) -> Vec<(EntityId, DispatchDecision)>
Decide for all idle elevators in a group.
Default: calls
decide() per elevator.Auto Trait Implementations§
impl Freeze for LookDispatch
impl RefUnwindSafe for LookDispatch
impl Send for LookDispatch
impl Sync for LookDispatch
impl Unpin for LookDispatch
impl UnsafeUnpin for LookDispatch
impl UnwindSafe for LookDispatch
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