#[non_exhaustive]pub struct VehicleFullness {
pub max_fullness: Option<f64>,
pub distance: Option<f64>,
pub travel_duration: Option<f64>,
pub active_duration: Option<f64>,
pub max_load: Option<f64>,
pub active_span: Option<f64>,
/* private fields */
}Expand description
VehicleFullness is a metric which computes how full a vehicle is. Each VehicleFullness field is between 0 and 1, computed as the ratio between a capped metric field (e.g. AggregatedMetrics.travel_distance_meters) and its related vehicle limit (e.g. Vehicle.route_distance_limit), if it exists. Otherwise the fullness ratio stays unset. If the limit is 0, the field is set to 1. Note: when a route is subject to traffic infeasibilities, some raw fullness ratios might exceed 1.0, e.g. the vehicle might exceed its distance limit. In these cases, we cap the fullness values at 1.0.
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_fullness: Option<f64>Maximum of all other fields in this message.
distance: Option<f64>The ratio between AggregatedMetrics.travel_distance_meters and Vehicle.route_distance_limit. If Vehicle.route_distance_limit is unset, this field will be unset.
travel_duration: Option<f64>The ratio between [AggregatedMetrics.travel_duration_seconds][] and Vehicle.travel_duration_limit. If Vehicle.travel_duration_limit is unset, this field will be unset.
active_duration: Option<f64>The ratio between [AggregatedMetrics.total_duration_seconds][] and Vehicle.route_duration_limit. If Vehicle.route_duration_limit is unset, this field will be unset.
max_load: Option<f64>The maximum ratio among all types of [AggregatedMetrics.max_load][] and their respective Vehicle.load_limits. If all Vehicle.load_limits fields are unset, this field will be unset.
active_span: Option<f64>The ratio (vehicle_end_time - vehicle_start_time) / (latest_vehicle_end_time - earliest_vehicle_start_time) for a
given vehicle. If the denominator is not present, it uses
([ShipmentModel.global_end_time] - [ShipmentModel.global_start_time])
instead.
Implementations§
Source§impl VehicleFullness
impl VehicleFullness
Sourcepub fn set_max_fullness<T>(self, v: T) -> Self
pub fn set_max_fullness<T>(self, v: T) -> Self
Sourcepub fn set_or_clear_max_fullness<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_max_fullness<T>(self, v: Option<T>) -> Self
Sets or clears the value of max_fullness.
§Example
let x = VehicleFullness::new().set_or_clear_max_fullness(Some(42.0));
let x = VehicleFullness::new().set_or_clear_max_fullness(None::<f32>);Sourcepub fn set_distance<T>(self, v: T) -> Self
pub fn set_distance<T>(self, v: T) -> Self
Sourcepub fn set_or_clear_distance<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_distance<T>(self, v: Option<T>) -> Self
Sourcepub fn set_travel_duration<T>(self, v: T) -> Self
pub fn set_travel_duration<T>(self, v: T) -> Self
Sets the value of travel_duration.
§Example
let x = VehicleFullness::new().set_travel_duration(42.0);Sourcepub fn set_or_clear_travel_duration<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_travel_duration<T>(self, v: Option<T>) -> Self
Sets or clears the value of travel_duration.
§Example
let x = VehicleFullness::new().set_or_clear_travel_duration(Some(42.0));
let x = VehicleFullness::new().set_or_clear_travel_duration(None::<f32>);Sourcepub fn set_active_duration<T>(self, v: T) -> Self
pub fn set_active_duration<T>(self, v: T) -> Self
Sets the value of active_duration.
§Example
let x = VehicleFullness::new().set_active_duration(42.0);Sourcepub fn set_or_clear_active_duration<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_active_duration<T>(self, v: Option<T>) -> Self
Sets or clears the value of active_duration.
§Example
let x = VehicleFullness::new().set_or_clear_active_duration(Some(42.0));
let x = VehicleFullness::new().set_or_clear_active_duration(None::<f32>);Sourcepub fn set_max_load<T>(self, v: T) -> Self
pub fn set_max_load<T>(self, v: T) -> Self
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
Sourcepub fn set_active_span<T>(self, v: T) -> Self
pub fn set_active_span<T>(self, v: T) -> Self
Sourcepub fn set_or_clear_active_span<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_active_span<T>(self, v: Option<T>) -> Self
Sets or clears the value of active_span.
§Example
let x = VehicleFullness::new().set_or_clear_active_span(Some(42.0));
let x = VehicleFullness::new().set_or_clear_active_span(None::<f32>);Trait Implementations§
Source§impl Clone for VehicleFullness
impl Clone for VehicleFullness
Source§fn clone(&self) -> VehicleFullness
fn clone(&self) -> VehicleFullness
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for VehicleFullness
impl Debug for VehicleFullness
Source§impl Default for VehicleFullness
impl Default for VehicleFullness
Source§fn default() -> VehicleFullness
fn default() -> VehicleFullness
Source§impl Message for VehicleFullness
impl Message for VehicleFullness
Source§impl PartialEq for VehicleFullness
impl PartialEq for VehicleFullness
impl StructuralPartialEq for VehicleFullness
Auto Trait Implementations§
impl Freeze for VehicleFullness
impl RefUnwindSafe for VehicleFullness
impl Send for VehicleFullness
impl Sync for VehicleFullness
impl Unpin for VehicleFullness
impl UnsafeUnpin for VehicleFullness
impl UnwindSafe for VehicleFullness
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request