Struct google_api_proto::google::cloud::optimization::v1::shipment_model::break_rule::FrequencyConstraint
source · pub struct FrequencyConstraint {
pub min_break_duration: Option<Duration>,
pub max_inter_break_duration: Option<Duration>,
}
Expand description
One may further constrain the frequency and duration of the breaks
specified above, by enforcing a minimum break frequency, such as
“There must be a break of at least 1 hour every 12 hours”. Assuming that
this can be interpreted as “Within any sliding time window of 12h, there
must be at least one break of at least one hour”, that example would
translate to the following FrequencyConstraint
:
{
min_break_duration { seconds: 3600 } # 1 hour.
max_inter_break_duration { seconds: 39600 } # 11 hours (12 - 1 = 11).
}
The timing and duration of the breaks in the solution will respect all
such constraints, in addition to the time windows and minimum durations
already specified in the BreakRequest
.
A FrequencyConstraint
may in practice apply to non-consecutive breaks.
For example, the following schedule honors the “1h every 12h” example:
04:00 vehicle start
.. performing travel and visits ..
09:00 1 hour break
10:00 end of the break
.. performing travel and visits ..
12:00 20-min lunch break
12:20 end of the break
.. performing travel and visits ..
21:00 1 hour break
22:00 end of the break
.. performing travel and visits ..
23:59 vehicle end
Fields§
§min_break_duration: Option<Duration>
Required. Minimum break duration for this constraint. Nonnegative.
See description of FrequencyConstraint
.
max_inter_break_duration: Option<Duration>
Required. Maximum allowed span of any interval of time in the route
that does not include at least partially a break of duration >= min_break_duration
. Must be positive.
Trait Implementations§
source§impl Clone for FrequencyConstraint
impl Clone for FrequencyConstraint
source§fn clone(&self) -> FrequencyConstraint
fn clone(&self) -> FrequencyConstraint
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for FrequencyConstraint
impl Debug for FrequencyConstraint
source§impl Default for FrequencyConstraint
impl Default for FrequencyConstraint
source§impl Message for FrequencyConstraint
impl Message for FrequencyConstraint
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 FrequencyConstraint
impl PartialEq for FrequencyConstraint
source§fn eq(&self, other: &FrequencyConstraint) -> bool
fn eq(&self, other: &FrequencyConstraint) -> bool
self
and other
values to be equal, and is used
by ==
.impl Copy for FrequencyConstraint
impl StructuralPartialEq for FrequencyConstraint
Auto Trait Implementations§
impl Freeze for FrequencyConstraint
impl RefUnwindSafe for FrequencyConstraint
impl Send for FrequencyConstraint
impl Sync for FrequencyConstraint
impl Unpin for FrequencyConstraint
impl UnwindSafe for FrequencyConstraint
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