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: f64Weight for travel time to reach the calling stop.
delay_weight: f64Weight for delay imposed on existing riders.
door_weight: f64Weight for door open/close overhead at intermediate stops.
Implementations§
Source§impl EtdDispatch
impl EtdDispatch
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new EtdDispatch with default weights.
Defaults: wait_weight = 1.0, delay_weight = 1.0, door_weight = 0.5.
Sourcepub fn with_delay_weight(delay_weight: f64) -> Self
pub fn with_delay_weight(delay_weight: f64) -> Self
Create with a single delay weight (backwards-compatible shorthand).
Sourcepub fn with_weights(
wait_weight: f64,
delay_weight: f64,
door_weight: f64,
) -> Self
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
impl Default for EtdDispatch
Source§impl DispatchStrategy for EtdDispatch
impl DispatchStrategy for EtdDispatch
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 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 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 EtdDispatch
impl RefUnwindSafe for EtdDispatch
impl Send for EtdDispatch
impl Sync for EtdDispatch
impl Unpin for EtdDispatch
impl UnsafeUnpin for EtdDispatch
impl UnwindSafe for EtdDispatch
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