Package com.google.cloud.optimization.v1
Class InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Builder
java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<BuilderT>
com.google.protobuf.GeneratedMessage.Builder<InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Builder>
com.google.cloud.optimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Builder
- All Implemented Interfaces:
InjectedSolutionConstraint.ConstraintRelaxation.RelaxationOrBuilder,com.google.protobuf.Message.Builder,com.google.protobuf.MessageLite.Builder,com.google.protobuf.MessageLiteOrBuilder,com.google.protobuf.MessageOrBuilder,Cloneable
- Enclosing class:
- InjectedSolutionConstraint.ConstraintRelaxation.Relaxation
public static final class InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Builder
extends com.google.protobuf.GeneratedMessage.Builder<InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Builder>
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-
Method Summary
Modifier and TypeMethodDescriptionbuild()clear()The constraint relaxation level that applies when the conditions at or after `threshold_time` AND at least `threshold_visit_count` are satisfied.The time at or after which the relaxation `level` may be applied.The number of visits at or after which the relaxation `level` may be applied.static final com.google.protobuf.Descriptors.Descriptorcom.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.TimestampThe time at or after which the relaxation `level` may be applied.com.google.protobuf.Timestamp.BuilderThe 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.booleanThe time at or after which the relaxation `level` may be applied.protected com.google.protobuf.GeneratedMessage.FieldAccessorTablefinal booleanmergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) mergeFrom(com.google.protobuf.Message other) mergeThresholdTime(com.google.protobuf.Timestamp value) The time at or after which the relaxation `level` may be applied.The constraint relaxation level that applies when the conditions at or after `threshold_time` AND at least `threshold_visit_count` are satisfied.setLevelValue(int value) The constraint relaxation level that applies when the conditions at or after `threshold_time` AND at least `threshold_visit_count` are satisfied.setThresholdTime(com.google.protobuf.Timestamp value) The time at or after which the relaxation `level` may be applied.setThresholdTime(com.google.protobuf.Timestamp.Builder builderForValue) The time at or after which the relaxation `level` may be applied.setThresholdVisitCount(int value) The number of visits at or after which the relaxation `level` may be applied.Methods inherited from class com.google.protobuf.GeneratedMessage.Builder
addRepeatedField, clearField, clearOneof, clone, getAllFields, getField, getFieldBuilder, getOneofFieldDescriptor, getParentForChildren, getRepeatedField, getRepeatedFieldBuilder, getRepeatedFieldCount, getUnknownFields, getUnknownFieldSetBuilder, hasField, hasOneof, internalGetMapField, internalGetMapFieldReflection, internalGetMutableMapField, internalGetMutableMapFieldReflection, isClean, markClean, mergeUnknownFields, mergeUnknownLengthDelimitedField, mergeUnknownVarintField, newBuilderForField, onBuilt, onChanged, parseUnknownField, setField, setRepeatedField, setUnknownFields, setUnknownFieldSetBuilder, setUnknownFieldsProto3Methods inherited from class com.google.protobuf.AbstractMessage.Builder
findInitializationErrors, getInitializationErrorString, internalMergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException, toStringMethods inherited from class com.google.protobuf.AbstractMessageLite.Builder
addAll, addAll, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, newUninitializedMessageExceptionMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.google.protobuf.Message.Builder
mergeDelimitedFrom, mergeDelimitedFromMethods inherited from interface com.google.protobuf.MessageLite.Builder
mergeFromMethods inherited from interface com.google.protobuf.MessageOrBuilder
findInitializationErrors, getAllFields, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof
-
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.Builder<InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Builder>
-
clear
- Specified by:
clearin interfacecom.google.protobuf.Message.Builder- Specified by:
clearin interfacecom.google.protobuf.MessageLite.Builder- Overrides:
clearin classcom.google.protobuf.GeneratedMessage.Builder<InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Builder>
-
getDescriptorForType
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()- Specified by:
getDescriptorForTypein interfacecom.google.protobuf.Message.Builder- Specified by:
getDescriptorForTypein interfacecom.google.protobuf.MessageOrBuilder- Overrides:
getDescriptorForTypein classcom.google.protobuf.GeneratedMessage.Builder<InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Builder>
-
getDefaultInstanceForType
- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageLiteOrBuilder- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageOrBuilder
-
build
- Specified by:
buildin interfacecom.google.protobuf.Message.Builder- Specified by:
buildin interfacecom.google.protobuf.MessageLite.Builder
-
buildPartial
- Specified by:
buildPartialin interfacecom.google.protobuf.Message.Builder- Specified by:
buildPartialin interfacecom.google.protobuf.MessageLite.Builder
-
mergeFrom
public InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Builder mergeFrom(com.google.protobuf.Message other) - Specified by:
mergeFromin interfacecom.google.protobuf.Message.Builder- Overrides:
mergeFromin classcom.google.protobuf.AbstractMessage.Builder<InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Builder>
-
mergeFrom
-
isInitialized
public final boolean isInitialized()- Specified by:
isInitializedin interfacecom.google.protobuf.MessageLiteOrBuilder- Overrides:
isInitializedin classcom.google.protobuf.GeneratedMessage.Builder<InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Builder>
-
mergeFrom
public InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException - Specified by:
mergeFromin interfacecom.google.protobuf.Message.Builder- Specified by:
mergeFromin interfacecom.google.protobuf.MessageLite.Builder- Overrides:
mergeFromin classcom.google.protobuf.AbstractMessage.Builder<InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Builder>- Throws:
IOException
-
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.
-
setLevelValue
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;- Parameters:
value- The enum numeric value on the wire for level to set.- Returns:
- This builder for chaining.
-
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.
-
setLevel
public InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Builder setLevel(InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Level value) 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;- Parameters:
value- The level to set.- Returns:
- This builder for chaining.
-
clearLevel
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:
- This builder for chaining.
-
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.
-
setThresholdTime
public InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Builder setThresholdTime(com.google.protobuf.Timestamp value) The time at or after which the relaxation `level` may be applied.
.google.protobuf.Timestamp threshold_time = 2; -
setThresholdTime
public InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Builder setThresholdTime(com.google.protobuf.Timestamp.Builder builderForValue) The time at or after which the relaxation `level` may be applied.
.google.protobuf.Timestamp threshold_time = 2; -
mergeThresholdTime
public InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Builder mergeThresholdTime(com.google.protobuf.Timestamp value) The time at or after which the relaxation `level` may be applied.
.google.protobuf.Timestamp threshold_time = 2; -
clearThresholdTime
The time at or after which the relaxation `level` may be applied.
.google.protobuf.Timestamp threshold_time = 2; -
getThresholdTimeBuilder
public com.google.protobuf.Timestamp.Builder getThresholdTimeBuilder()The time at or after which the relaxation `level` may be applied.
.google.protobuf.Timestamp threshold_time = 2; -
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.
-
setThresholdVisitCount
public InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Builder setThresholdVisitCount(int value) 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;- Parameters:
value- The thresholdVisitCount to set.- Returns:
- This builder for chaining.
-
clearThresholdVisitCount
public InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Builder clearThresholdVisitCount()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:
- This builder for chaining.
-