public static final class ShipmentModel.BreakRule.FrequencyConstraint.Builder extends GeneratedMessageV3.Builder<ShipmentModel.BreakRule.FrequencyConstraint.Builder> implements ShipmentModel.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
:
`
{
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
`
Protobuf type
google.cloud.optimization.v1.ShipmentModel.BreakRule.FrequencyConstraint
Inherited Members
com.google.protobuf.GeneratedMessageV3.Builder.getUnknownFieldSetBuilder()
com.google.protobuf.GeneratedMessageV3.Builder.internalGetMapFieldReflection(int)
com.google.protobuf.GeneratedMessageV3.Builder.internalGetMutableMapFieldReflection(int)
com.google.protobuf.GeneratedMessageV3.Builder.mergeUnknownLengthDelimitedField(int,com.google.protobuf.ByteString)
com.google.protobuf.GeneratedMessageV3.Builder.mergeUnknownVarintField(int,int)
com.google.protobuf.GeneratedMessageV3.Builder.parseUnknownField(com.google.protobuf.CodedInputStream,com.google.protobuf.ExtensionRegistryLite,int)
com.google.protobuf.GeneratedMessageV3.Builder.setUnknownFieldSetBuilder(com.google.protobuf.UnknownFieldSet.Builder)
Static Methods
getDescriptor()
public static final Descriptors.Descriptor getDescriptor()
Methods
addRepeatedField(Descriptors.FieldDescriptor field, Object value)
public ShipmentModel.BreakRule.FrequencyConstraint.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Overrides
build()
public ShipmentModel.BreakRule.FrequencyConstraint build()
buildPartial()
public ShipmentModel.BreakRule.FrequencyConstraint buildPartial()
clear()
public ShipmentModel.BreakRule.FrequencyConstraint.Builder clear()
Overrides
clearField(Descriptors.FieldDescriptor field)
public ShipmentModel.BreakRule.FrequencyConstraint.Builder clearField(Descriptors.FieldDescriptor field)
Overrides
clearMaxInterBreakDuration()
public ShipmentModel.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];
clearMinBreakDuration()
public ShipmentModel.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];
clearOneof(Descriptors.OneofDescriptor oneof)
public ShipmentModel.BreakRule.FrequencyConstraint.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Overrides
clone()
public ShipmentModel.BreakRule.FrequencyConstraint.Builder clone()
Overrides
getDefaultInstanceForType()
public ShipmentModel.BreakRule.FrequencyConstraint getDefaultInstanceForType()
getDescriptorForType()
public Descriptors.Descriptor getDescriptorForType()
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];
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];
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];
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];
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()
Overrides
isInitialized()
public final boolean isInitialized()
Overrides
mergeFrom(ShipmentModel.BreakRule.FrequencyConstraint other)
public ShipmentModel.BreakRule.FrequencyConstraint.Builder mergeFrom(ShipmentModel.BreakRule.FrequencyConstraint other)
public ShipmentModel.BreakRule.FrequencyConstraint.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Overrides
mergeFrom(Message other)
public ShipmentModel.BreakRule.FrequencyConstraint.Builder mergeFrom(Message other)
Parameter |
Name |
Description |
other |
Message
|
Overrides
mergeMaxInterBreakDuration(Duration value)
public ShipmentModel.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 |
Name |
Description |
value |
Duration
|
mergeMinBreakDuration(Duration value)
public ShipmentModel.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 |
Name |
Description |
value |
Duration
|
mergeUnknownFields(UnknownFieldSet unknownFields)
public final ShipmentModel.BreakRule.FrequencyConstraint.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Overrides
setField(Descriptors.FieldDescriptor field, Object value)
public ShipmentModel.BreakRule.FrequencyConstraint.Builder setField(Descriptors.FieldDescriptor field, Object value)
Overrides
setMaxInterBreakDuration(Duration value)
public ShipmentModel.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 |
Name |
Description |
value |
Duration
|
setMaxInterBreakDuration(Duration.Builder builderForValue)
public ShipmentModel.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
|
setMinBreakDuration(Duration value)
public ShipmentModel.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 |
Name |
Description |
value |
Duration
|
setMinBreakDuration(Duration.Builder builderForValue)
public ShipmentModel.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
|
setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
public ShipmentModel.BreakRule.FrequencyConstraint.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Overrides
setUnknownFields(UnknownFieldSet unknownFields)
public final ShipmentModel.BreakRule.FrequencyConstraint.Builder setUnknownFields(UnknownFieldSet unknownFields)
Overrides