Class InjectedSolutionConstraint.ConstraintRelaxation.Relaxation (1.39.0)

publicstaticfinalclass InjectedSolutionConstraint.ConstraintRelaxation.RelaxationextendsGeneratedMessageV3implementsInjectedSolutionConstraint.ConstraintRelaxation.RelaxationOrBuilder

If relaxations is empty, the start time and sequence of all visits on routes are fully constrained and no new visits may be inserted or added to those routes. Also, a vehicle's start and end time in routes is fully constrained, unless the vehicle is empty (i.e., has no visits and has used_if_route_is_empty set to false in the model).

relaxations(i).level specifies the constraint relaxation level applied to a visit #j that satisfies:

  • route.visits(j).start_time >= relaxations(i).threshold_time AND
  • j + 1 >= relaxations(i).threshold_visit_count

    Similarly, the vehicle start is relaxed to relaxations(i).level if it satisfies:

  • vehicle_start_time >= relaxations(i).threshold_time AND

  • relaxations(i).threshold_visit_count == 0 and the vehicle end is relaxed to relaxations(i).level if it satisfies:
  • vehicle_end_time >= relaxations(i).threshold_time AND
  • route.visits_size() + 1 >= relaxations(i).threshold_visit_count

    To apply a relaxation level if a visit meets the threshold_visit_count OR the threshold_time add two relaxations with the same level: one with only threshold_visit_count set and the other with only threshold_time set. If a visit satisfies the conditions of multiple relaxations, the most relaxed level applies. As a result, from the vehicle start through the route visits in order to the vehicle end, the relaxation level becomes more relaxed: i.e., the relaxation level is non-decreasing as the route progresses.

    The timing and sequence of route visits that do not satisfy the threshold conditions of any relaxations are fully constrained and no visits may be inserted into these sequences. Also, if a vehicle start or end does not satisfy the conditions of any relaxation the time is fixed, unless the vehicle is empty.

Protobuf type google.cloud.optimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation

Inheritance

Object > AbstractMessageLite<MessageType,BuilderType> > AbstractMessage > GeneratedMessageV3 > InjectedSolutionConstraint.ConstraintRelaxation.Relaxation

Inherited Members

com.google.protobuf.GeneratedMessageV3.<ListT>makeMutableCopy(ListT)
com.google.protobuf.GeneratedMessageV3.<ListT>makeMutableCopy(ListT,int)
com.google.protobuf.GeneratedMessageV3.<T>emptyList(java.lang.Class<T>)
com.google.protobuf.GeneratedMessageV3.internalGetMapFieldReflection(int)

Static Fields

LEVEL_FIELD_NUMBER

publicstaticfinalintLEVEL_FIELD_NUMBER
Field Value
Type Description
int

THRESHOLD_TIME_FIELD_NUMBER

publicstaticfinalintTHRESHOLD_TIME_FIELD_NUMBER
Field Value
Type Description
int

THRESHOLD_VISIT_COUNT_FIELD_NUMBER

publicstaticfinalintTHRESHOLD_VISIT_COUNT_FIELD_NUMBER
Field Value
Type Description
int

Static Methods

getDefaultInstance()

publicstaticInjectedSolutionConstraint.ConstraintRelaxation.RelaxationgetDefaultInstance()
Returns
Type Description
InjectedSolutionConstraint.ConstraintRelaxation.Relaxation

getDescriptor()

publicstaticfinalDescriptors.DescriptorgetDescriptor()
Returns
Type Description
Descriptor

newBuilder()

publicstaticInjectedSolutionConstraint.ConstraintRelaxation.Relaxation.BuildernewBuilder()
Returns
Type Description
InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Builder

newBuilder(InjectedSolutionConstraint.ConstraintRelaxation.Relaxation prototype)

publicstaticInjectedSolutionConstraint.ConstraintRelaxation.Relaxation.BuildernewBuilder(InjectedSolutionConstraint.ConstraintRelaxation.Relaxationprototype)
Parameter
Name Description
prototype InjectedSolutionConstraint.ConstraintRelaxation.Relaxation
Returns
Type Description
InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Builder

parseDelimitedFrom(InputStream input)

publicstaticInjectedSolutionConstraint.ConstraintRelaxation.RelaxationparseDelimitedFrom(InputStreaminput)
Parameter
Name Description
input InputStream
Returns
Type Description
InjectedSolutionConstraint.ConstraintRelaxation.Relaxation
Exceptions
Type Description
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

publicstaticInjectedSolutionConstraint.ConstraintRelaxation.RelaxationparseDelimitedFrom(InputStreaminput,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
InjectedSolutionConstraint.ConstraintRelaxation.Relaxation
Exceptions
Type Description
IOException

parseFrom(byte[] data)

publicstaticInjectedSolutionConstraint.ConstraintRelaxation.RelaxationparseFrom(byte[]data)
Parameter
Name Description
data byte[]
Returns
Type Description
InjectedSolutionConstraint.ConstraintRelaxation.Relaxation
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

publicstaticInjectedSolutionConstraint.ConstraintRelaxation.RelaxationparseFrom(byte[]data,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
data byte[]
extensionRegistry ExtensionRegistryLite
Returns
Type Description
InjectedSolutionConstraint.ConstraintRelaxation.Relaxation
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data)

publicstaticInjectedSolutionConstraint.ConstraintRelaxation.RelaxationparseFrom(ByteStringdata)
Parameter
Name Description
data ByteString
Returns
Type Description
InjectedSolutionConstraint.ConstraintRelaxation.Relaxation
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

publicstaticInjectedSolutionConstraint.ConstraintRelaxation.RelaxationparseFrom(ByteStringdata,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
data ByteString
extensionRegistry ExtensionRegistryLite
Returns
Type Description
InjectedSolutionConstraint.ConstraintRelaxation.Relaxation
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

publicstaticInjectedSolutionConstraint.ConstraintRelaxation.RelaxationparseFrom(CodedInputStreaminput)
Parameter
Name Description
input CodedInputStream
Returns
Type Description
InjectedSolutionConstraint.ConstraintRelaxation.Relaxation
Exceptions
Type Description
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

publicstaticInjectedSolutionConstraint.ConstraintRelaxation.RelaxationparseFrom(CodedInputStreaminput,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
InjectedSolutionConstraint.ConstraintRelaxation.Relaxation
Exceptions
Type Description
IOException

parseFrom(InputStream input)

publicstaticInjectedSolutionConstraint.ConstraintRelaxation.RelaxationparseFrom(InputStreaminput)
Parameter
Name Description
input InputStream
Returns
Type Description
InjectedSolutionConstraint.ConstraintRelaxation.Relaxation
Exceptions
Type Description
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

publicstaticInjectedSolutionConstraint.ConstraintRelaxation.RelaxationparseFrom(InputStreaminput,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
InjectedSolutionConstraint.ConstraintRelaxation.Relaxation
Exceptions
Type Description
IOException

parseFrom(ByteBuffer data)

publicstaticInjectedSolutionConstraint.ConstraintRelaxation.RelaxationparseFrom(ByteBufferdata)
Parameter
Name Description
data ByteBuffer
Returns
Type Description
InjectedSolutionConstraint.ConstraintRelaxation.Relaxation
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

publicstaticInjectedSolutionConstraint.ConstraintRelaxation.RelaxationparseFrom(ByteBufferdata,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
data ByteBuffer
extensionRegistry ExtensionRegistryLite
Returns
Type Description
InjectedSolutionConstraint.ConstraintRelaxation.Relaxation
Exceptions
Type Description
InvalidProtocolBufferException

parser()

publicstaticParser<InjectedSolutionConstraint.ConstraintRelaxation.Relaxation>parser()
Returns
Type Description
Parser<Relaxation>

Methods

equals(Object obj)

publicbooleanequals(Objectobj)
Parameter
Name Description
obj Object
Returns
Type Description
boolean
Overrides

getDefaultInstanceForType()

publicInjectedSolutionConstraint.ConstraintRelaxation.RelaxationgetDefaultInstanceForType()
Returns
Type Description
InjectedSolutionConstraint.ConstraintRelaxation.Relaxation

getLevel()

publicInjectedSolutionConstraint.ConstraintRelaxation.Relaxation.LevelgetLevel()

The constraint relaxation level that applies when the conditions at or after threshold_time AND at least threshold_visit_count are satisfied.

.google.cloud.optimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Level level = 1;

Returns
Type Description
InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Level

The level.

getLevelValue()

publicintgetLevelValue()

The constraint relaxation level that applies when the conditions at or after threshold_time AND at least threshold_visit_count are satisfied.

.google.cloud.optimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Level level = 1;

Returns
Type Description
int

The enum numeric value on the wire for level.

getParserForType()

publicParser<InjectedSolutionConstraint.ConstraintRelaxation.Relaxation>getParserForType()
Returns
Type Description
Parser<Relaxation>
Overrides

getSerializedSize()

publicintgetSerializedSize()
Returns
Type Description
int
Overrides

getThresholdTime()

publicTimestampgetThresholdTime()

The time at or after which the relaxation level may be applied.

.google.protobuf.Timestamp threshold_time = 2;

Returns
Type Description
Timestamp

The thresholdTime.

getThresholdTimeOrBuilder()

publicTimestampOrBuildergetThresholdTimeOrBuilder()

The time at or after which the relaxation level may be applied.

.google.protobuf.Timestamp threshold_time = 2;

Returns
Type Description
TimestampOrBuilder

getThresholdVisitCount()

publicintgetThresholdVisitCount()

The number of visits at or after which the relaxation level may be applied. If threshold_visit_count is 0 (or unset), the level may be applied directly at the vehicle start.

If it is route.visits_size() + 1, the level may only be applied to the vehicle end. If it is more than route.visits_size() + 1, level is not applied at all for that route.

int32 threshold_visit_count = 3;

Returns
Type Description
int

The thresholdVisitCount.

hasThresholdTime()

publicbooleanhasThresholdTime()

The time at or after which the relaxation level may be applied.

.google.protobuf.Timestamp threshold_time = 2;

Returns
Type Description
boolean

Whether the thresholdTime field is set.

hashCode()

publicinthashCode()
Returns
Type Description
int
Overrides

internalGetFieldAccessorTable()

protectedGeneratedMessageV3.FieldAccessorTableinternalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

publicfinalbooleanisInitialized()
Returns
Type Description
boolean
Overrides

newBuilderForType()

publicInjectedSolutionConstraint.ConstraintRelaxation.Relaxation.BuildernewBuilderForType()
Returns
Type Description
InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protectedInjectedSolutionConstraint.ConstraintRelaxation.Relaxation.BuildernewBuilderForType(GeneratedMessageV3.BuilderParentparent)
Parameter
Name Description
parent BuilderParent
Returns
Type Description
InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protectedObjectnewInstance(GeneratedMessageV3.UnusedPrivateParameterunused)
Parameter
Name Description
unused UnusedPrivateParameter
Returns
Type Description
Object
Overrides

toBuilder()

publicInjectedSolutionConstraint.ConstraintRelaxation.Relaxation.BuildertoBuilder()
Returns
Type Description
InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Builder

writeTo(CodedOutputStream output)

publicvoidwriteTo(CodedOutputStreamoutput)
Parameter
Name Description
output CodedOutputStream
Overrides
Exceptions
Type Description
IOException

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025年10月30日 UTC.