#[non_exhaustive]pub struct Visit {
pub shipment_index: i32,
pub is_pickup: bool,
pub visit_request_index: i32,
pub start_time: Option<Timestamp>,
pub load_demands: HashMap<String, Load>,
pub detour: Option<Duration>,
pub shipment_label: String,
pub visit_label: String,
pub arrival_loads: Vec<CapacityQuantity>,
pub delay_before_start: Option<Delay>,
pub demands: Vec<CapacityQuantity>,
/* private fields */
}Expand description
A visit performed during a route. This visit corresponds to a pickup or a
delivery of a Shipment.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.shipment_index: i32Index of the shipments field in the source
ShipmentModel.
is_pickup: boolIf true the visit corresponds to a pickup of a Shipment. Otherwise, it
corresponds to a delivery.
visit_request_index: i32Index of VisitRequest in either the pickup or delivery field of the
Shipment (see is_pickup).
start_time: Option<Timestamp>Time at which the visit starts. Note that the vehicle may arrive earlier
than this at the visit location. Times are consistent with the
ShipmentModel.
load_demands: HashMap<String, Load>Total visit load demand as the sum of the shipment and the visit request
load_demands. The values are negative if the visit is a delivery.
Demands are reported for the same types as the
Transition.loads
(see this field).
detour: Option<Duration>Extra detour time due to the shipments visited on the route before the visit and to the potential waiting time induced by time windows. If the visit is a delivery, the detour is computed from the corresponding pickup visit and is equal to:
start_time(delivery) - start_time(pickup)
- (duration(pickup) + travel duration from the pickup location
to the delivery location).Otherwise, it is computed from the vehicle start_location and is equal
to:
start_time - vehicle_start_time - travel duration from
the vehicle's `start_location` to the visit.shipment_label: StringCopy of the corresponding Shipment.label, if specified in the
Shipment.
visit_label: StringCopy of the corresponding
VisitRequest.label,
if specified in the VisitRequest.
arrival_loads: Vec<CapacityQuantity>Deprecated: Use
Transition.vehicle_loads
instead. Vehicle loads upon arrival at the visit location, for each type
specified in
Vehicle.capacities,
start_load_intervals, end_load_intervals or demands.
Exception: we omit loads for quantity types unconstrained by intervals and that don’t have any non-zero demand on the route.
delay_before_start: Option<Delay>Deprecated: Use ShipmentRoute.Transition.delay_duration instead. Delay occurring before the visit starts.
demands: Vec<CapacityQuantity>Deprecated: Use Visit.load_demands instead.
Implementations§
Source§impl Visit
impl Visit
pub fn new() -> Self
Sourcepub fn set_shipment_index<T: Into<i32>>(self, v: T) -> Self
pub fn set_shipment_index<T: Into<i32>>(self, v: T) -> Self
Sets the value of shipment_index.
Sourcepub fn set_is_pickup<T: Into<bool>>(self, v: T) -> Self
pub fn set_is_pickup<T: Into<bool>>(self, v: T) -> Self
Sets the value of is_pickup.
Sourcepub fn set_visit_request_index<T: Into<i32>>(self, v: T) -> Self
pub fn set_visit_request_index<T: Into<i32>>(self, v: T) -> Self
Sets the value of visit_request_index.
Sourcepub fn set_start_time<T>(self, v: T) -> Self
pub fn set_start_time<T>(self, v: T) -> Self
Sets the value of start_time.
Sourcepub fn set_or_clear_start_time<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_start_time<T>(self, v: Option<T>) -> Self
Sets or clears the value of start_time.
Sourcepub fn set_load_demands<T, K, V>(self, v: T) -> Self
pub fn set_load_demands<T, K, V>(self, v: T) -> Self
Sets the value of load_demands.
Sourcepub fn set_detour<T>(self, v: T) -> Self
pub fn set_detour<T>(self, v: T) -> Self
Sets the value of detour.
Sourcepub fn set_or_clear_detour<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_detour<T>(self, v: Option<T>) -> Self
Sets or clears the value of detour.
Sourcepub fn set_shipment_label<T: Into<String>>(self, v: T) -> Self
pub fn set_shipment_label<T: Into<String>>(self, v: T) -> Self
Sets the value of shipment_label.
Sourcepub fn set_visit_label<T: Into<String>>(self, v: T) -> Self
pub fn set_visit_label<T: Into<String>>(self, v: T) -> Self
Sets the value of visit_label.
Sourcepub fn set_arrival_loads<T, V>(self, v: T) -> Self
👎Deprecated
pub fn set_arrival_loads<T, V>(self, v: T) -> Self
Sets the value of arrival_loads.
Sourcepub fn set_delay_before_start<T>(self, v: T) -> Self
👎Deprecated
pub fn set_delay_before_start<T>(self, v: T) -> Self
Sets the value of delay_before_start.
Sourcepub fn set_or_clear_delay_before_start<T>(self, v: Option<T>) -> Self
👎Deprecated
pub fn set_or_clear_delay_before_start<T>(self, v: Option<T>) -> Self
Sets or clears the value of delay_before_start.
Sourcepub fn set_demands<T, V>(self, v: T) -> Self
👎Deprecated
pub fn set_demands<T, V>(self, v: T) -> Self
Sets the value of demands.