pub struct DestinationDispatch { /* private fields */ }Expand description
Hall-call destination dispatch (DCS).
§API choice
This strategy uses the DispatchStrategy::pre_dispatch hook
(Option B) so it can write sticky AssignedCar extensions and
committed-stop queue entries during a &mut World phase, then
return ordinary DispatchDecision::GoToStop values via the
standard decide call. The other built-in strategies continue to
work unchanged because pre_dispatch has an empty default impl.
Implementations§
Source§impl DestinationDispatch
impl DestinationDispatch
Sourcepub const fn with_stop_penalty(self, penalty: f64) -> Self
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).
Trait Implementations§
Source§impl Default for DestinationDispatch
impl Default for DestinationDispatch
Source§impl DispatchStrategy for DestinationDispatch
impl DispatchStrategy for DestinationDispatch
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 before the per-group dispatch pass. Read more
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 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.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 DestinationDispatch
impl RefUnwindSafe for DestinationDispatch
impl Send for DestinationDispatch
impl Sync for DestinationDispatch
impl Unpin for DestinationDispatch
impl UnsafeUnpin for DestinationDispatch
impl UnwindSafe for DestinationDispatch
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