public static final class BreakRule.FrequencyConstraint.Builder extends GeneratedMessageV3.Builder<BreakRule.FrequencyConstraint.Builder> implements BreakRule.FrequencyConstraintOrBuilder
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
:
<code><code>
{
min_break_duration { seconds: 3600 } # 1 hour.
max_inter_break_duration { seconds: 39600 } # 11 hours (12 - 1 = 11).
}
</code></code><code>
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 </code>BreakRequest<code>.
A </code>FrequencyConstraint<code> may in practice apply to non-consecutive breaks.
For example, the following schedule honors the "1h every 12h" example:
</code><code><code>
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
</code></code>
Protobuf type google.cloud.optimization.v1.BreakRule.FrequencyConstraint
Static Methods
getDescriptor()
public static final Descriptors.Descriptor getDescriptor()
Returns
Methods
addRepeatedField(Descriptors.FieldDescriptor field, Object value)
public BreakRule.FrequencyConstraint.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
Returns
Overrides
build()
public BreakRule.FrequencyConstraint build()
Returns
buildPartial()
public BreakRule.FrequencyConstraint buildPartial()
Returns
clear()
public BreakRule.FrequencyConstraint.Builder clear()
Returns
Overrides
clearField(Descriptors.FieldDescriptor field)
public BreakRule.FrequencyConstraint.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
Returns
Overrides
clearMaxInterBreakDuration()
public BreakRule.FrequencyConstraint.Builder clearMaxInterBreakDuration()
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.
.google.protobuf.Duration max_inter_break_duration = 2 [(.google.api.field_behavior) = REQUIRED];
Returns
clearMinBreakDuration()
public BreakRule.FrequencyConstraint.Builder clearMinBreakDuration()
Required. Minimum break duration for this constraint. Nonnegative.
See description of FrequencyConstraint
.
.google.protobuf.Duration min_break_duration = 1 [(.google.api.field_behavior) = REQUIRED];
Returns
clearOneof(Descriptors.OneofDescriptor oneof)
public BreakRule.FrequencyConstraint.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
Returns
Overrides
clone()
public BreakRule.FrequencyConstraint.Builder clone()
Returns
Overrides
getDefaultInstanceForType()
public BreakRule.FrequencyConstraint getDefaultInstanceForType()
Returns
getDescriptorForType()
public Descriptors.Descriptor getDescriptorForType()
Returns
Overrides
getMaxInterBreakDuration()
public Duration 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.
.google.protobuf.Duration max_inter_break_duration = 2 [(.google.api.field_behavior) = REQUIRED];
Returns
Type | Description |
Duration | The maxInterBreakDuration.
|
getMaxInterBreakDurationBuilder()
public Duration.Builder getMaxInterBreakDurationBuilder()
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.
.google.protobuf.Duration max_inter_break_duration = 2 [(.google.api.field_behavior) = REQUIRED];
Returns
getMaxInterBreakDurationOrBuilder()
public DurationOrBuilder getMaxInterBreakDurationOrBuilder()
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.
.google.protobuf.Duration max_inter_break_duration = 2 [(.google.api.field_behavior) = REQUIRED];
Returns
getMinBreakDuration()
public Duration getMinBreakDuration()
Required. Minimum break duration for this constraint. Nonnegative.
See description of FrequencyConstraint
.
.google.protobuf.Duration min_break_duration = 1 [(.google.api.field_behavior) = REQUIRED];
Returns
Type | Description |
Duration | The minBreakDuration.
|
getMinBreakDurationBuilder()
public Duration.Builder getMinBreakDurationBuilder()
Required. Minimum break duration for this constraint. Nonnegative.
See description of FrequencyConstraint
.
.google.protobuf.Duration min_break_duration = 1 [(.google.api.field_behavior) = REQUIRED];
Returns
getMinBreakDurationOrBuilder()
public DurationOrBuilder getMinBreakDurationOrBuilder()
Required. Minimum break duration for this constraint. Nonnegative.
See description of FrequencyConstraint
.
.google.protobuf.Duration min_break_duration = 1 [(.google.api.field_behavior) = REQUIRED];
Returns
hasMaxInterBreakDuration()
public boolean hasMaxInterBreakDuration()
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.
.google.protobuf.Duration max_inter_break_duration = 2 [(.google.api.field_behavior) = REQUIRED];
Returns
Type | Description |
boolean | Whether the maxInterBreakDuration field is set.
|
hasMinBreakDuration()
public boolean hasMinBreakDuration()
Required. Minimum break duration for this constraint. Nonnegative.
See description of FrequencyConstraint
.
.google.protobuf.Duration min_break_duration = 1 [(.google.api.field_behavior) = REQUIRED];
Returns
Type | Description |
boolean | Whether the minBreakDuration field is set.
|
internalGetFieldAccessorTable()
protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Overrides
isInitialized()
public final boolean isInitialized()
Returns
Overrides
mergeFrom(BreakRule.FrequencyConstraint other)
public BreakRule.FrequencyConstraint.Builder mergeFrom(BreakRule.FrequencyConstraint other)
Parameter
Returns
public BreakRule.FrequencyConstraint.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Returns
Overrides
Exceptions
mergeFrom(Message other)
public BreakRule.FrequencyConstraint.Builder mergeFrom(Message other)
Parameter
Returns
Overrides
mergeMaxInterBreakDuration(Duration value)
public BreakRule.FrequencyConstraint.Builder mergeMaxInterBreakDuration(Duration value)
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.
.google.protobuf.Duration max_inter_break_duration = 2 [(.google.api.field_behavior) = REQUIRED];
Parameter
Returns
mergeMinBreakDuration(Duration value)
public BreakRule.FrequencyConstraint.Builder mergeMinBreakDuration(Duration value)
Required. Minimum break duration for this constraint. Nonnegative.
See description of FrequencyConstraint
.
.google.protobuf.Duration min_break_duration = 1 [(.google.api.field_behavior) = REQUIRED];
Parameter
Returns
mergeUnknownFields(UnknownFieldSet unknownFields)
public final BreakRule.FrequencyConstraint.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
Returns
Overrides
setField(Descriptors.FieldDescriptor field, Object value)
public BreakRule.FrequencyConstraint.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
Returns
Overrides
setMaxInterBreakDuration(Duration value)
public BreakRule.FrequencyConstraint.Builder setMaxInterBreakDuration(Duration value)
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.
.google.protobuf.Duration max_inter_break_duration = 2 [(.google.api.field_behavior) = REQUIRED];
Parameter
Returns
setMaxInterBreakDuration(Duration.Builder builderForValue)
public BreakRule.FrequencyConstraint.Builder setMaxInterBreakDuration(Duration.Builder builderForValue)
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.
.google.protobuf.Duration max_inter_break_duration = 2 [(.google.api.field_behavior) = REQUIRED];
Parameter
Name | Description |
builderForValue | Builder
|
Returns
setMinBreakDuration(Duration value)
public BreakRule.FrequencyConstraint.Builder setMinBreakDuration(Duration value)
Required. Minimum break duration for this constraint. Nonnegative.
See description of FrequencyConstraint
.
.google.protobuf.Duration min_break_duration = 1 [(.google.api.field_behavior) = REQUIRED];
Parameter
Returns
setMinBreakDuration(Duration.Builder builderForValue)
public BreakRule.FrequencyConstraint.Builder setMinBreakDuration(Duration.Builder builderForValue)
Required. Minimum break duration for this constraint. Nonnegative.
See description of FrequencyConstraint
.
.google.protobuf.Duration min_break_duration = 1 [(.google.api.field_behavior) = REQUIRED];
Parameter
Name | Description |
builderForValue | Builder
|
Returns
setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
public BreakRule.FrequencyConstraint.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
Returns
Overrides
setUnknownFields(UnknownFieldSet unknownFields)
public final BreakRule.FrequencyConstraint.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
Returns
Overrides