pub struct EtdDispatch {
pub wait_weight: f64,
pub delay_weight: f64,
pub door_weight: f64,
pub wait_squared_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.
wait_squared_weight: f64Weight for the squared-wait “group-time” fairness bonus. Each
candidate stop’s cost is reduced by this weight times the sum
of wait_ticks² across waiting riders at the stop, so stops
hosting older calls win ties. Defaults to 0.0 (no bias);
positive values damp the long-wait tail (Aalto EJOR 2016
group-time assignment model).
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, wait_squared_weight = 0.0.
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.
Sourcepub fn with_wait_squared_weight(self, weight: f64) -> Self
pub fn with_wait_squared_weight(self, weight: f64) -> Self
Turn on the squared-wait fairness bonus. Higher values prefer
older waiters more aggressively; 0.0 (the default) disables.
§Panics
Panics on non-finite or negative weights. A NaN weight would
propagate through mul_add and silently disable every dispatch
rank; a negative weight would invert the fairness ordering.
Either is a programming error rather than a valid configuration.