Struct google_api_proto::google::maps::routeoptimization::v1::injected_solution_constraint::constraint_relaxation::Relaxation
source · pub struct Relaxation {
pub level: i32,
pub threshold_time: Option<Timestamp>,
pub threshold_visit_count: i32,
}Expand description
If relaxations is empty, the start time and sequence of all visits
on routes are fully constrained and no new visits may be inserted or
added to those routes. Also, a vehicle’s start and end time in
routes is fully constrained, unless the vehicle is empty (i.e., has no
visits and has used_if_route_is_empty set to false in the model).
relaxations(i).level specifies the constraint relaxation level applied
to a visit #j that satisfies:
route.visits(j).start_time >= relaxations(i).threshold_timeANDj + 1 >= relaxations(i).threshold_visit_count
Similarly, the vehicle start is relaxed to relaxations(i).level if it
satisfies:
vehicle_start_time >= relaxations(i).threshold_timeANDrelaxations(i).threshold_visit_count == 0and the vehicle end is relaxed torelaxations(i).levelif it satisfies:vehicle_end_time >= relaxations(i).threshold_timeANDroute.visits_size() + 1 >= relaxations(i).threshold_visit_count
To apply a relaxation level if a visit meets the threshold_visit_count
OR the threshold_time add two relaxations with the same level:
one with only threshold_visit_count set and the other with only
threshold_time set. If a visit satisfies the conditions of multiple
relaxations, the most relaxed level applies. As a result, from the
vehicle start through the route visits in order to the vehicle end, the
relaxation level becomes more relaxed: i.e., the relaxation level is
non-decreasing as the route progresses.
The timing and sequence of route visits that do not satisfy the
threshold conditions of any relaxations are fully constrained
and no visits may be inserted into these sequences. Also, if a
vehicle start or end does not satisfy the conditions of any
relaxation the time is fixed, unless the vehicle is empty.
Fields§
§level: i32The constraint relaxation level that applies when the conditions
at or after threshold_time AND at least threshold_visit_count are
satisfied.
threshold_time: Option<Timestamp>The time at or after which the relaxation level may be applied.
threshold_visit_count: i32The number of visits at or after which the relaxation level may be
applied. If threshold_visit_count is 0 (or unset), the level may be
applied directly at the vehicle start.
If it is route.visits_size() + 1, the level may only be applied to
the vehicle end. If it is more than route.visits_size() + 1,
level is not applied at all for that route.
Implementations§
Trait Implementations§
source§impl Clone for Relaxation
impl Clone for Relaxation
source§fn clone(&self) -> Relaxation
fn clone(&self) -> Relaxation
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Debug for Relaxation
impl Debug for Relaxation
source§impl Default for Relaxation
impl Default for Relaxation
source§impl Message for Relaxation
impl Message for Relaxation
source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
source§fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
source§fn encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self. Read moresource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self.source§impl PartialEq for Relaxation
impl PartialEq for Relaxation
source§fn eq(&self, other: &Relaxation) -> bool
fn eq(&self, other: &Relaxation) -> bool
self and other values to be equal, and is used
by ==.impl Copy for Relaxation
impl StructuralPartialEq for Relaxation
Auto Trait Implementations§
impl Freeze for Relaxation
impl RefUnwindSafe for Relaxation
impl Send for Relaxation
impl Sync for Relaxation
impl Unpin for Relaxation
impl UnwindSafe for Relaxation
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<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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