Reference documentation and code samples for the Google Cloud Optimization V1 Client class FrequencyConstraint.
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
Generated from protobuf message google.cloud.optimization.v1.ShipmentModel.BreakRule.FrequencyConstraint
Namespace
Google \ Cloud \ Optimization \ V1 \ ShipmentModel \ BreakRuleMethods
__construct
Constructor.
Parameters | |
---|---|
Name | Description |
data |
array
Optional. Data for populating the Message object. |
↳ min_break_duration |
Google\Protobuf\Duration
Required. Minimum break duration for this constraint. Nonnegative. See description of |
↳ max_inter_break_duration |
Google\Protobuf\Duration
Required. Maximum allowed span of any interval of time in the route that does not include at least partially a break of |
getMinBreakDuration
Required. Minimum break duration for this constraint. Nonnegative.
See description of FrequencyConstraint
.
Returns | |
---|---|
Type | Description |
Google\Protobuf\Duration|null |
hasMinBreakDuration
clearMinBreakDuration
setMinBreakDuration
Required. Minimum break duration for this constraint. Nonnegative.
See description of FrequencyConstraint
.
Parameter | |
---|---|
Name | Description |
var |
Google\Protobuf\Duration
|
Returns | |
---|---|
Type | Description |
$this |
getMaxInterBreakDuration
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.
Returns | |
---|---|
Type | Description |
Google\Protobuf\Duration|null |
hasMaxInterBreakDuration
clearMaxInterBreakDuration
setMaxInterBreakDuration
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.
Parameter | |
---|---|
Name | Description |
var |
Google\Protobuf\Duration
|
Returns | |
---|---|
Type | Description |
$this |