Package com.google.cloud.optimization.v1
Class InjectedSolutionConstraint.ConstraintRelaxation.Relaxation
java.lang.Object
com.google.protobuf.AbstractMessageLite
com.google.protobuf.AbstractMessage
com.google.protobuf.GeneratedMessage
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.GeneratedMessage
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 type
google.cloud.optimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classIf `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 enumExpresses 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.GeneratedMessage
com.google.protobuf.GeneratedMessage.ExtendableBuilder<MessageT extends com.google.protobuf.GeneratedMessage.ExtendableMessage<MessageT>,BuilderT extends com.google.protobuf.GeneratedMessage.ExtendableBuilder<MessageT, BuilderT>>, com.google.protobuf.GeneratedMessage.ExtendableMessage<MessageT extends com.google.protobuf.GeneratedMessage.ExtendableMessage<MessageT>>, com.google.protobuf.GeneratedMessage.ExtendableMessageOrBuilder<MessageT extends com.google.protobuf.GeneratedMessage.ExtendableMessage<MessageT>>, com.google.protobuf.GeneratedMessage.FieldAccessorTable, com.google.protobuf.GeneratedMessage.GeneratedExtension<ContainingT extends com.google.protobuf.Message, T extends Object>, com.google.protobuf.GeneratedMessage.UnusedPrivateParameter Nested classes/interfaces inherited from class com.google.protobuf.AbstractMessage
com.google.protobuf.AbstractMessage.BuilderParentNested classes/interfaces inherited from class com.google.protobuf.AbstractMessageLite
com.google.protobuf.AbstractMessageLite.InternalOneOfEnum -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intFields inherited from class com.google.protobuf.GeneratedMessage
alwaysUseFieldBuilders, loggedPre22TypeNames, unknownFieldsFields inherited from class com.google.protobuf.AbstractMessage
memoizedSizeFields inherited from class com.google.protobuf.AbstractMessageLite
memoizedHashCode -
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic final com.google.protobuf.Descriptors.DescriptorgetLevel()The constraint relaxation level that applies when the conditions at or after `threshold_time` AND at least `threshold_visit_count` are satisfied.intThe constraint relaxation level that applies when the conditions at or after `threshold_time` AND at least `threshold_visit_count` are satisfied.com.google.protobuf.Parser<InjectedSolutionConstraint.ConstraintRelaxation.Relaxation>intcom.google.protobuf.TimestampThe time at or after which the relaxation `level` may be applied.com.google.protobuf.TimestampOrBuilderThe time at or after which the relaxation `level` may be applied.intThe number of visits at or after which the relaxation `level` may be applied.inthashCode()booleanThe time at or after which the relaxation `level` may be applied.protected com.google.protobuf.GeneratedMessage.FieldAccessorTablefinal booleannewBuilderForType(com.google.protobuf.AbstractMessage.BuilderParent parent) parseDelimitedFrom(InputStream input) parseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) parseFrom(byte[] data) parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) parseFrom(com.google.protobuf.ByteString data) parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) parseFrom(com.google.protobuf.CodedInputStream input) parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) parseFrom(InputStream input) parseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) parseFrom(ByteBuffer data) parseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static com.google.protobuf.Parser<InjectedSolutionConstraint.ConstraintRelaxation.Relaxation>parser()voidwriteTo(com.google.protobuf.CodedOutputStream output) Methods inherited from class com.google.protobuf.GeneratedMessage
canUseUnsafe, computeStringSize, computeStringSizeNoTag, emptyBooleanList, emptyDoubleList, emptyFloatList, emptyIntList, emptyList, emptyLongList, getAllFields, getDescriptorForType, getField, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof, internalGetMapField, internalGetMapFieldReflection, isStringEmpty, makeExtensionsImmutable, makeMutableCopy, makeMutableCopy, mergeFromAndMakeImmutableInternal, newFileScopedGeneratedExtension, newInstance, newMessageScopedGeneratedExtension, parseDelimitedWithIOException, parseDelimitedWithIOException, parseUnknownField, parseUnknownFieldProto3, parseWithIOException, parseWithIOException, parseWithIOException, parseWithIOException, serializeBooleanMapTo, serializeIntegerMapTo, serializeLongMapTo, serializeStringMapTo, writeReplace, writeString, writeStringNoTagMethods inherited from class com.google.protobuf.AbstractMessage
findInitializationErrors, getInitializationErrorString, hashFields, toStringMethods inherited from class com.google.protobuf.AbstractMessageLite
addAll, checkByteStringIsUtf8, toByteArray, toByteString, writeDelimitedTo, writeToMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.google.protobuf.MessageLite
toByteArray, toByteString, writeDelimitedTo, writeToMethods inherited from interface com.google.protobuf.MessageOrBuilder
findInitializationErrors, getAllFields, getDescriptorForType, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof
-
Field Details
-
LEVEL_FIELD_NUMBER
public static final int LEVEL_FIELD_NUMBER- See Also:
-
THRESHOLD_TIME_FIELD_NUMBER
public static final int THRESHOLD_TIME_FIELD_NUMBER- See Also:
-
THRESHOLD_VISIT_COUNT_FIELD_NUMBER
public static final int THRESHOLD_VISIT_COUNT_FIELD_NUMBER- See Also:
-
-
Method Details
-
getDescriptor
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() -
internalGetFieldAccessorTable
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()- Specified by:
internalGetFieldAccessorTablein classcom.google.protobuf.GeneratedMessage
-
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:
getLevelValuein interfaceInjectedSolutionConstraint.ConstraintRelaxation.RelaxationOrBuilder- Returns:
- The enum numeric value on the wire for 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:
getLevelin 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:
hasThresholdTimein 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:
getThresholdTimein 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:
getThresholdTimeOrBuilderin 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:
getThresholdVisitCountin interfaceInjectedSolutionConstraint.ConstraintRelaxation.RelaxationOrBuilder- Returns:
- The thresholdVisitCount.
-
isInitialized
public final boolean isInitialized()- Specified by:
isInitializedin interfacecom.google.protobuf.MessageLiteOrBuilder- Overrides:
isInitializedin classcom.google.protobuf.GeneratedMessage
-
writeTo
- Specified by:
writeToin interfacecom.google.protobuf.MessageLite- Overrides:
writeToin classcom.google.protobuf.GeneratedMessage- Throws:
IOException
-
getSerializedSize
public int getSerializedSize()- Specified by:
getSerializedSizein interfacecom.google.protobuf.MessageLite- Overrides:
getSerializedSizein classcom.google.protobuf.GeneratedMessage
-
equals
- Specified by:
equalsin interfacecom.google.protobuf.Message- Overrides:
equalsin classcom.google.protobuf.AbstractMessage
-
hashCode
public int hashCode()- Specified by:
hashCodein interfacecom.google.protobuf.Message- Overrides:
hashCodein 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
- Specified by:
newBuilderForTypein interfacecom.google.protobuf.Message- Specified by:
newBuilderForTypein interfacecom.google.protobuf.MessageLite
-
newBuilder
-
newBuilder
public static InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Builder newBuilder(InjectedSolutionConstraint.ConstraintRelaxation.Relaxation prototype) -
toBuilder
- Specified by:
toBuilderin interfacecom.google.protobuf.Message- Specified by:
toBuilderin interfacecom.google.protobuf.MessageLite
-
newBuilderForType
protected InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Builder newBuilderForType(com.google.protobuf.AbstractMessage.BuilderParent parent) - Overrides:
newBuilderForTypein classcom.google.protobuf.AbstractMessage
-
getDefaultInstance
-
parser
public static com.google.protobuf.Parser<InjectedSolutionConstraint.ConstraintRelaxation.Relaxation> parser() -
getParserForType
public com.google.protobuf.Parser<InjectedSolutionConstraint.ConstraintRelaxation.Relaxation> getParserForType()- Specified by:
getParserForTypein interfacecom.google.protobuf.Message- Specified by:
getParserForTypein interfacecom.google.protobuf.MessageLite- Overrides:
getParserForTypein classcom.google.protobuf.GeneratedMessage
-
getDefaultInstanceForType
- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageLiteOrBuilder- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageOrBuilder
-