#[non_exhaustive]pub struct LoadLimit {
pub max_load: Option<i64>,
pub soft_max_load: i64,
pub cost_per_unit_above_soft_max: f64,
pub start_load_interval: Option<Interval>,
pub end_load_interval: Option<Interval>,
/* private fields */
}Expand description
Defines a load limit applying to a vehicle, e.g. “this truck may only carry up to 3500 kg”. See load_limits.
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.max_load: Option<i64>The maximum acceptable amount of load.
soft_max_load: i64A soft limit of the load. See cost_per_unit_above_soft_max.
cost_per_unit_above_soft_max: f64If the load ever exceeds soft_max_load along this vehicle’s route, the following cost penalty applies (only once per vehicle): (load - soft_max_load)
- cost_per_unit_above_soft_max. All costs add up and must be in the same unit as Shipment.penalty_cost.
start_load_interval: Option<Interval>The acceptable load interval of the vehicle at the start of the route.
end_load_interval: Option<Interval>The acceptable load interval of the vehicle at the end of the route.
Implementations§
Source§impl LoadLimit
impl LoadLimit
pub fn new() -> Self
Sourcepub fn set_max_load<T>(self, v: T) -> Self
pub fn set_max_load<T>(self, v: T) -> Self
Sets the value of max_load.
Sourcepub fn set_or_clear_max_load<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_max_load<T>(self, v: Option<T>) -> Self
Sets or clears the value of max_load.
Sourcepub fn set_soft_max_load<T: Into<i64>>(self, v: T) -> Self
pub fn set_soft_max_load<T: Into<i64>>(self, v: T) -> Self
Sets the value of soft_max_load.
Sourcepub fn set_cost_per_unit_above_soft_max<T: Into<f64>>(self, v: T) -> Self
pub fn set_cost_per_unit_above_soft_max<T: Into<f64>>(self, v: T) -> Self
Sets the value of cost_per_unit_above_soft_max.
Sourcepub fn set_start_load_interval<T>(self, v: T) -> Self
pub fn set_start_load_interval<T>(self, v: T) -> Self
Sets the value of start_load_interval.
Sourcepub fn set_or_clear_start_load_interval<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_start_load_interval<T>(self, v: Option<T>) -> Self
Sets or clears the value of start_load_interval.
Sourcepub fn set_end_load_interval<T>(self, v: T) -> Self
pub fn set_end_load_interval<T>(self, v: T) -> Self
Sets the value of end_load_interval.
Sourcepub fn set_or_clear_end_load_interval<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_end_load_interval<T>(self, v: Option<T>) -> Self
Sets or clears the value of end_load_interval.