Package com.google.cloud.optimization.v1
Class InjectedSolutionConstraint.ConstraintRelaxation.Relaxation
- java.lang.Object
-
- com.google.protobuf.AbstractMessageLite
-
- com.google.protobuf.AbstractMessage
-
- com.google.protobuf.GeneratedMessageV3
-
- com.google.cloud.optimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation
-
- All Implemented Interfaces:
InjectedSolutionConstraint.ConstraintRelaxation.RelaxationOrBuilder
,com.google.protobuf.Message
,com.google.protobuf.MessageLite
,com.google.protobuf.MessageLiteOrBuilder
,com.google.protobuf.MessageOrBuilder
,Serializable
- Enclosing class:
- InjectedSolutionConstraint.ConstraintRelaxation
public static final class InjectedSolutionConstraint.ConstraintRelaxation.Relaxation extends com.google.protobuf.GeneratedMessageV3 implements InjectedSolutionConstraint.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 typegoogle.cloud.optimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Builder
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.static class
InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Level
Expresses the different constraint relaxation levels, which are applied for a visit and those that follow when it satisfies the threshold conditions.-
Nested classes/interfaces inherited from class com.google.protobuf.GeneratedMessageV3
com.google.protobuf.GeneratedMessageV3.BuilderParent, com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<MessageT extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT>,BuilderT extends com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<MessageT,BuilderT>>, com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT>>, com.google.protobuf.GeneratedMessageV3.ExtendableMessageOrBuilder<MessageT extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT>>, com.google.protobuf.GeneratedMessageV3.FieldAccessorTable, com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter
-
-
Field Summary
Fields Modifier and Type Field Description static int
LEVEL_FIELD_NUMBER
static int
THRESHOLD_TIME_FIELD_NUMBER
static int
THRESHOLD_VISIT_COUNT_FIELD_NUMBER
-
Method Summary
-
Methods inherited from class com.google.protobuf.GeneratedMessageV3
canUseUnsafe, computeStringSize, computeStringSizeNoTag, emptyBooleanList, emptyDoubleList, emptyFloatList, emptyIntList, emptyLongList, getAllFields, getDescriptorForType, getField, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof, internalGetMapField, isStringEmpty, makeExtensionsImmutable, makeMutableCopy, mergeFromAndMakeImmutableInternal, mutableCopy, mutableCopy, mutableCopy, mutableCopy, mutableCopy, newBooleanList, newBuilderForType, newDoubleList, newFloatList, newIntList, newLongList, parseDelimitedWithIOException, parseDelimitedWithIOException, parseUnknownField, parseUnknownFieldProto3, parseWithIOException, parseWithIOException, parseWithIOException, parseWithIOException, serializeBooleanMapTo, serializeIntegerMapTo, serializeLongMapTo, serializeStringMapTo, writeReplace, writeString, writeStringNoTag
-
Methods inherited from class com.google.protobuf.AbstractMessage
findInitializationErrors, getInitializationErrorString, hashBoolean, hashEnum, hashEnumList, hashFields, hashLong, toString
-
Methods inherited from class com.google.protobuf.AbstractMessageLite
addAll, addAll, checkByteStringIsUtf8, toByteArray, toByteString, writeDelimitedTo, writeTo
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
-
-
-
Field Detail
-
LEVEL_FIELD_NUMBER
public static final int LEVEL_FIELD_NUMBER
- See Also:
- Constant Field Values
-
THRESHOLD_TIME_FIELD_NUMBER
public static final int THRESHOLD_TIME_FIELD_NUMBER
- See Also:
- Constant Field Values
-
THRESHOLD_VISIT_COUNT_FIELD_NUMBER
public static final int THRESHOLD_VISIT_COUNT_FIELD_NUMBER
- See Also:
- Constant Field Values
-
-
Method Detail
-
newInstance
protected Object newInstance(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused)
- Overrides:
newInstance
in classcom.google.protobuf.GeneratedMessageV3
-
getDescriptor
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
-
internalGetFieldAccessorTable
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
- Specified by:
internalGetFieldAccessorTable
in classcom.google.protobuf.GeneratedMessageV3
-
getLevelValue
public int getLevelValue()
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;
- Specified by:
getLevelValue
in interfaceInjectedSolutionConstraint.ConstraintRelaxation.RelaxationOrBuilder
- Returns:
- The enum numeric value on the wire for level.
-
getLevel
public InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Level getLevel()
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;
- Specified by:
getLevel
in interfaceInjectedSolutionConstraint.ConstraintRelaxation.RelaxationOrBuilder
- Returns:
- The level.
-
hasThresholdTime
public boolean hasThresholdTime()
The time at or after which the relaxation `level` may be applied.
.google.protobuf.Timestamp threshold_time = 2;
- Specified by:
hasThresholdTime
in interfaceInjectedSolutionConstraint.ConstraintRelaxation.RelaxationOrBuilder
- Returns:
- Whether the thresholdTime field is set.
-
getThresholdTime
public com.google.protobuf.Timestamp getThresholdTime()
The time at or after which the relaxation `level` may be applied.
.google.protobuf.Timestamp threshold_time = 2;
- Specified by:
getThresholdTime
in interfaceInjectedSolutionConstraint.ConstraintRelaxation.RelaxationOrBuilder
- Returns:
- The thresholdTime.
-
getThresholdTimeOrBuilder
public com.google.protobuf.TimestampOrBuilder getThresholdTimeOrBuilder()
The time at or after which the relaxation `level` may be applied.
.google.protobuf.Timestamp threshold_time = 2;
- Specified by:
getThresholdTimeOrBuilder
in interfaceInjectedSolutionConstraint.ConstraintRelaxation.RelaxationOrBuilder
-
getThresholdVisitCount
public int getThresholdVisitCount()
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;
- Specified by:
getThresholdVisitCount
in interfaceInjectedSolutionConstraint.ConstraintRelaxation.RelaxationOrBuilder
- Returns:
- The thresholdVisitCount.
-
isInitialized
public final boolean isInitialized()
- Specified by:
isInitialized
in interfacecom.google.protobuf.MessageLiteOrBuilder
- Overrides:
isInitialized
in classcom.google.protobuf.GeneratedMessageV3
-
writeTo
public void writeTo(com.google.protobuf.CodedOutputStream output) throws IOException
- Specified by:
writeTo
in interfacecom.google.protobuf.MessageLite
- Overrides:
writeTo
in classcom.google.protobuf.GeneratedMessageV3
- Throws:
IOException
-
getSerializedSize
public int getSerializedSize()
- Specified by:
getSerializedSize
in interfacecom.google.protobuf.MessageLite
- Overrides:
getSerializedSize
in classcom.google.protobuf.GeneratedMessageV3
-
equals
public boolean equals(Object obj)
- Specified by:
equals
in interfacecom.google.protobuf.Message
- Overrides:
equals
in classcom.google.protobuf.AbstractMessage
-
hashCode
public int hashCode()
- Specified by:
hashCode
in interfacecom.google.protobuf.Message
- Overrides:
hashCode
in classcom.google.protobuf.AbstractMessage
-
parseFrom
public static InjectedSolutionConstraint.ConstraintRelaxation.Relaxation parseFrom(ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException
- Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static InjectedSolutionConstraint.ConstraintRelaxation.Relaxation parseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
- Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static InjectedSolutionConstraint.ConstraintRelaxation.Relaxation parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException
- Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static InjectedSolutionConstraint.ConstraintRelaxation.Relaxation parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
- Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static InjectedSolutionConstraint.ConstraintRelaxation.Relaxation parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException
- Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static InjectedSolutionConstraint.ConstraintRelaxation.Relaxation parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
- Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static InjectedSolutionConstraint.ConstraintRelaxation.Relaxation parseFrom(InputStream input) throws IOException
- Throws:
IOException
-
parseFrom
public static InjectedSolutionConstraint.ConstraintRelaxation.Relaxation parseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
- Throws:
IOException
-
parseDelimitedFrom
public static InjectedSolutionConstraint.ConstraintRelaxation.Relaxation parseDelimitedFrom(InputStream input) throws IOException
- Throws:
IOException
-
parseDelimitedFrom
public static InjectedSolutionConstraint.ConstraintRelaxation.Relaxation parseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
- Throws:
IOException
-
parseFrom
public static InjectedSolutionConstraint.ConstraintRelaxation.Relaxation parseFrom(com.google.protobuf.CodedInputStream input) throws IOException
- Throws:
IOException
-
parseFrom
public static InjectedSolutionConstraint.ConstraintRelaxation.Relaxation parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
- Throws:
IOException
-
newBuilderForType
public InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Builder newBuilderForType()
- Specified by:
newBuilderForType
in interfacecom.google.protobuf.Message
- Specified by:
newBuilderForType
in interfacecom.google.protobuf.MessageLite
-
newBuilder
public static InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Builder newBuilder()
-
newBuilder
public static InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Builder newBuilder(InjectedSolutionConstraint.ConstraintRelaxation.Relaxation prototype)
-
toBuilder
public InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Builder toBuilder()
- Specified by:
toBuilder
in interfacecom.google.protobuf.Message
- Specified by:
toBuilder
in interfacecom.google.protobuf.MessageLite
-
newBuilderForType
protected InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)
- Specified by:
newBuilderForType
in classcom.google.protobuf.GeneratedMessageV3
-
getDefaultInstance
public static InjectedSolutionConstraint.ConstraintRelaxation.Relaxation getDefaultInstance()
-
parser
public static com.google.protobuf.Parser<InjectedSolutionConstraint.ConstraintRelaxation.Relaxation> parser()
-
getParserForType
public com.google.protobuf.Parser<InjectedSolutionConstraint.ConstraintRelaxation.Relaxation> getParserForType()
- Specified by:
getParserForType
in interfacecom.google.protobuf.Message
- Specified by:
getParserForType
in interfacecom.google.protobuf.MessageLite
- Overrides:
getParserForType
in classcom.google.protobuf.GeneratedMessageV3
-
getDefaultInstanceForType
public InjectedSolutionConstraint.ConstraintRelaxation.Relaxation getDefaultInstanceForType()
- Specified by:
getDefaultInstanceForType
in interfacecom.google.protobuf.MessageLiteOrBuilder
- Specified by:
getDefaultInstanceForType
in interfacecom.google.protobuf.MessageOrBuilder
-
-