Class BreakRule.FrequencyConstraint (0.1.2)

public static final class BreakRule.FrequencyConstraint extends GeneratedMessageV3 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 Fields

MAX_INTER_BREAK_DURATION_FIELD_NUMBER

public static final int MAX_INTER_BREAK_DURATION_FIELD_NUMBER
Field Value
TypeDescription
int

MIN_BREAK_DURATION_FIELD_NUMBER

public static final int MIN_BREAK_DURATION_FIELD_NUMBER
Field Value
TypeDescription
int

Static Methods

getDefaultInstance()

public static BreakRule.FrequencyConstraint getDefaultInstance()
Returns
TypeDescription
BreakRule.FrequencyConstraint

getDescriptor()

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

newBuilder()

public static BreakRule.FrequencyConstraint.Builder newBuilder()
Returns
TypeDescription
BreakRule.FrequencyConstraint.Builder

newBuilder(BreakRule.FrequencyConstraint prototype)

public static BreakRule.FrequencyConstraint.Builder newBuilder(BreakRule.FrequencyConstraint prototype)
Parameter
NameDescription
prototypeBreakRule.FrequencyConstraint
Returns
TypeDescription
BreakRule.FrequencyConstraint.Builder

parseDelimitedFrom(InputStream input)

public static BreakRule.FrequencyConstraint parseDelimitedFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
BreakRule.FrequencyConstraint
Exceptions
TypeDescription
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static BreakRule.FrequencyConstraint parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
BreakRule.FrequencyConstraint
Exceptions
TypeDescription
IOException

parseFrom(byte[] data)

public static BreakRule.FrequencyConstraint parseFrom(byte[] data)
Parameter
NameDescription
databyte[]
Returns
TypeDescription
BreakRule.FrequencyConstraint
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static BreakRule.FrequencyConstraint parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
databyte[]
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
BreakRule.FrequencyConstraint
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data)

public static BreakRule.FrequencyConstraint parseFrom(ByteString data)
Parameter
NameDescription
dataByteString
Returns
TypeDescription
BreakRule.FrequencyConstraint
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static BreakRule.FrequencyConstraint parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteString
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
BreakRule.FrequencyConstraint
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static BreakRule.FrequencyConstraint parseFrom(CodedInputStream input)
Parameter
NameDescription
inputCodedInputStream
Returns
TypeDescription
BreakRule.FrequencyConstraint
Exceptions
TypeDescription
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static BreakRule.FrequencyConstraint parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
BreakRule.FrequencyConstraint
Exceptions
TypeDescription
IOException

parseFrom(InputStream input)

public static BreakRule.FrequencyConstraint parseFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
BreakRule.FrequencyConstraint
Exceptions
TypeDescription
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static BreakRule.FrequencyConstraint parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
BreakRule.FrequencyConstraint
Exceptions
TypeDescription
IOException

parseFrom(ByteBuffer data)

public static BreakRule.FrequencyConstraint parseFrom(ByteBuffer data)
Parameter
NameDescription
dataByteBuffer
Returns
TypeDescription
BreakRule.FrequencyConstraint
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static BreakRule.FrequencyConstraint parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteBuffer
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
BreakRule.FrequencyConstraint
Exceptions
TypeDescription
InvalidProtocolBufferException

parser()

public static Parser<BreakRule.FrequencyConstraint> parser()
Returns
TypeDescription
Parser<FrequencyConstraint>

Methods

equals(Object obj)

public boolean equals(Object obj)
Parameter
NameDescription
objObject
Returns
TypeDescription
boolean
Overrides

getDefaultInstanceForType()

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

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.

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.

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

getParserForType()

public Parser<BreakRule.FrequencyConstraint> getParserForType()
Returns
TypeDescription
Parser<FrequencyConstraint>
Overrides

getSerializedSize()

public int getSerializedSize()
Returns
TypeDescription
int
Overrides

getUnknownFields()

public final UnknownFieldSet getUnknownFields()
Returns
TypeDescription
UnknownFieldSet
Overrides

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.

hashCode()

public int hashCode()
Returns
TypeDescription
int
Overrides

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

newBuilderForType()

public BreakRule.FrequencyConstraint.Builder newBuilderForType()
Returns
TypeDescription
BreakRule.FrequencyConstraint.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected BreakRule.FrequencyConstraint.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
NameDescription
parentBuilderParent
Returns
TypeDescription
BreakRule.FrequencyConstraint.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
NameDescription
unusedUnusedPrivateParameter
Returns
TypeDescription
Object
Overrides

toBuilder()

public BreakRule.FrequencyConstraint.Builder toBuilder()
Returns
TypeDescription
BreakRule.FrequencyConstraint.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
NameDescription
outputCodedOutputStream
Overrides Exceptions
TypeDescription
IOException