pub struct EtdDispatch {
pub wait_weight: f64,
pub delay_weight: f64,
pub door_weight: f64,
}Expand description
Estimated Time to Destination (ETD) dispatch algorithm.
Industry-standard algorithm for modern elevator systems. For each pending call, evaluates every elevator and assigns the one that minimizes total cost: (time to serve the new rider) + (delay imposed on all existing riders) + (door/loading overhead).
§Cost model
cost = wait_weight * travel_time + delay_weight * existing_rider_delay + door_weight * estimated_door_overhead + direction_bonus
Rider delay is computed from actual route destinations of riders currently aboard each elevator.
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 const fn new() -> Self
pub const fn new() -> Self
Create a new EtdDispatch with default weights.
Defaults: wait_weight = 1.0, delay_weight = 1.0, door_weight = 0.5.
Sourcepub const fn with_delay_weight(delay_weight: f64) -> Self
pub const fn with_delay_weight(delay_weight: f64) -> Self
Create with a single delay weight (backwards-compatible shorthand).
Sets wait_weight = 1.0 and door_weight = 0.5.
Sourcepub const fn with_weights(
wait_weight: f64,
delay_weight: f64,
door_weight: f64,
) -> Self
pub const 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 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
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() per elevator.