Class BreakRule.FrequencyConstraint.Builder (1.27.0)

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: ` { 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.BreakRule.FrequencyConstraint

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptor

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public BreakRule.FrequencyConstraint.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
BreakRule.FrequencyConstraint.Builder
Overrides

build()

public BreakRule.FrequencyConstraint build()
Returns
TypeDescription
BreakRule.FrequencyConstraint

buildPartial()

public BreakRule.FrequencyConstraint buildPartial()
Returns
TypeDescription
BreakRule.FrequencyConstraint

clear()

public BreakRule.FrequencyConstraint.Builder clear()
Returns
TypeDescription
BreakRule.FrequencyConstraint.Builder
Overrides

clearField(Descriptors.FieldDescriptor field)

public BreakRule.FrequencyConstraint.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
NameDescription
fieldFieldDescriptor
Returns
TypeDescription
BreakRule.FrequencyConstraint.Builder
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
TypeDescription
BreakRule.FrequencyConstraint.Builder

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
TypeDescription
BreakRule.FrequencyConstraint.Builder

clearOneof(Descriptors.OneofDescriptor oneof)

public BreakRule.FrequencyConstraint.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
NameDescription
oneofOneofDescriptor
Returns
TypeDescription
BreakRule.FrequencyConstraint.Builder
Overrides

clone()

public BreakRule.FrequencyConstraint.Builder clone()
Returns
TypeDescription
BreakRule.FrequencyConstraint.Builder
Overrides

getDefaultInstanceForType()

public BreakRule.FrequencyConstraint getDefaultInstanceForType()
Returns
TypeDescription
BreakRule.FrequencyConstraint

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
Descriptor
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
TypeDescription
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
TypeDescription
Builder

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
TypeDescription
DurationOrBuilder

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
TypeDescription
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
TypeDescription
Builder

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
TypeDescription
DurationOrBuilder

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
TypeDescription
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
TypeDescription
boolean

Whether the minBreakDuration field is set.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

mergeFrom(BreakRule.FrequencyConstraint other)

public BreakRule.FrequencyConstraint.Builder mergeFrom(BreakRule.FrequencyConstraint other)
Parameter
NameDescription
otherBreakRule.FrequencyConstraint
Returns
TypeDescription
BreakRule.FrequencyConstraint.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public BreakRule.FrequencyConstraint.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
BreakRule.FrequencyConstraint.Builder
Overrides
Exceptions
TypeDescription
IOException

mergeFrom(Message other)

public BreakRule.FrequencyConstraint.Builder mergeFrom(Message other)
Parameter
NameDescription
otherMessage
Returns
TypeDescription
BreakRule.FrequencyConstraint.Builder
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
NameDescription
valueDuration
Returns
TypeDescription
BreakRule.FrequencyConstraint.Builder

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
NameDescription
valueDuration
Returns
TypeDescription
BreakRule.FrequencyConstraint.Builder

mergeUnknownFields(UnknownFieldSet unknownFields)

public final BreakRule.FrequencyConstraint.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
BreakRule.FrequencyConstraint.Builder
Overrides

setField(Descriptors.FieldDescriptor field, Object value)

public BreakRule.FrequencyConstraint.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
BreakRule.FrequencyConstraint.Builder
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
NameDescription
valueDuration
Returns
TypeDescription
BreakRule.FrequencyConstraint.Builder

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
NameDescription
builderForValueBuilder
Returns
TypeDescription
BreakRule.FrequencyConstraint.Builder

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
NameDescription
valueDuration
Returns
TypeDescription
BreakRule.FrequencyConstraint.Builder

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
NameDescription
builderForValueBuilder
Returns
TypeDescription
BreakRule.FrequencyConstraint.Builder

setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)

public BreakRule.FrequencyConstraint.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
NameDescription
fieldFieldDescriptor
indexint
valueObject
Returns
TypeDescription
BreakRule.FrequencyConstraint.Builder
Overrides

setUnknownFields(UnknownFieldSet unknownFields)

public final BreakRule.FrequencyConstraint.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
BreakRule.FrequencyConstraint.Builder
Overrides