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.GeneratedMessageV3.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.GeneratedMessageV3.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 typegoogle.cloud.optimization.v1.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.BuilderaddRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)InjectedSolutionConstraint.ConstraintRelaxation.Relaxationbuild()InjectedSolutionConstraint.ConstraintRelaxation.RelaxationbuildPartial()InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Builderclear()InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.BuilderclearField(com.google.protobuf.Descriptors.FieldDescriptor field)InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.BuilderclearLevel()The constraint relaxation level that applies when the conditions at or after `threshold_time` AND at least `threshold_visit_count` are satisfied.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.BuilderclearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.BuilderclearThresholdTime()The time at or after which the relaxation `level` may be applied.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.BuilderclearThresholdVisitCount()The number of visits at or after which the relaxation `level` may be applied.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Builderclone()InjectedSolutionConstraint.ConstraintRelaxation.RelaxationgetDefaultInstanceForType()static com.google.protobuf.Descriptors.DescriptorgetDescriptor()com.google.protobuf.Descriptors.DescriptorgetDescriptorForType()InjectedSolutionConstraint.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.intgetLevelValue()The constraint relaxation level that applies when the conditions at or after `threshold_time` AND at least `threshold_visit_count` are satisfied.com.google.protobuf.TimestampgetThresholdTime()The time at or after which the relaxation `level` may be applied.com.google.protobuf.Timestamp.BuildergetThresholdTimeBuilder()The time at or after which the relaxation `level` may be applied.com.google.protobuf.TimestampOrBuildergetThresholdTimeOrBuilder()The time at or after which the relaxation `level` may be applied.intgetThresholdVisitCount()The number of visits at or after which the relaxation `level` may be applied.booleanhasThresholdTime()The time at or after which the relaxation `level` may be applied.protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTableinternalGetFieldAccessorTable()booleanisInitialized()InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.BuildermergeFrom(InjectedSolutionConstraint.ConstraintRelaxation.Relaxation other)InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.BuildermergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.BuildermergeFrom(com.google.protobuf.Message other)InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.BuildermergeThresholdTime(com.google.protobuf.Timestamp value)The time at or after which the relaxation `level` may be applied.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.BuildermergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.BuildersetField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.BuildersetLevel(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.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.BuildersetLevelValue(int value)The constraint relaxation level that applies when the conditions at or after `threshold_time` AND at least `threshold_visit_count` are satisfied.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.BuildersetRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, Object value)InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.BuildersetThresholdTime(com.google.protobuf.Timestamp value)The time at or after which the relaxation `level` may be applied.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.BuildersetThresholdTime(com.google.protobuf.Timestamp.Builder builderForValue)The time at or after which the relaxation `level` may be applied.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.BuildersetThresholdVisitCount(int value)The number of visits at or after which the relaxation `level` may be applied.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.BuildersetUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)-
Methods inherited from class com.google.protobuf.GeneratedMessageV3.Builder
getAllFields, getField, getFieldBuilder, getOneofFieldDescriptor, getParentForChildren, getRepeatedField, getRepeatedFieldBuilder, getRepeatedFieldCount, getUnknownFields, getUnknownFieldSetBuilder, hasField, hasOneof, internalGetMapField, internalGetMutableMapField, isClean, markClean, mergeUnknownLengthDelimitedField, mergeUnknownVarintField, newBuilderForField, onBuilt, onChanged, parseUnknownField, setUnknownFieldSetBuilder, setUnknownFieldsProto3
-
Methods inherited from class com.google.protobuf.AbstractMessage.Builder
findInitializationErrors, getInitializationErrorString, internalMergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException, toString
-
Methods inherited from class com.google.protobuf.AbstractMessageLite.Builder
addAll, addAll, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, newUninitializedMessageException
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
-
-
-
Method Detail
-
getDescriptor
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
-
internalGetFieldAccessorTable
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
- Specified by:
internalGetFieldAccessorTablein classcom.google.protobuf.GeneratedMessageV3.Builder<InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Builder>
-
clear
public 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.GeneratedMessageV3.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.GeneratedMessageV3.Builder<InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Builder>
-
getDefaultInstanceForType
public InjectedSolutionConstraint.ConstraintRelaxation.Relaxation getDefaultInstanceForType()
- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageLiteOrBuilder- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageOrBuilder
-
build
public InjectedSolutionConstraint.ConstraintRelaxation.Relaxation build()
- Specified by:
buildin interfacecom.google.protobuf.Message.Builder- Specified by:
buildin interfacecom.google.protobuf.MessageLite.Builder
-
buildPartial
public InjectedSolutionConstraint.ConstraintRelaxation.Relaxation buildPartial()
- Specified by:
buildPartialin interfacecom.google.protobuf.Message.Builder- Specified by:
buildPartialin interfacecom.google.protobuf.MessageLite.Builder
-
clone
public InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Builder clone()
- Specified by:
clonein interfacecom.google.protobuf.Message.Builder- Specified by:
clonein interfacecom.google.protobuf.MessageLite.Builder- Overrides:
clonein classcom.google.protobuf.GeneratedMessageV3.Builder<InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Builder>
-
setField
public InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Builder setField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)
- Specified by:
setFieldin interfacecom.google.protobuf.Message.Builder- Overrides:
setFieldin classcom.google.protobuf.GeneratedMessageV3.Builder<InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Builder>
-
clearField
public InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field)
- Specified by:
clearFieldin interfacecom.google.protobuf.Message.Builder- Overrides:
clearFieldin classcom.google.protobuf.GeneratedMessageV3.Builder<InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Builder>
-
clearOneof
public InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)
- Specified by:
clearOneofin interfacecom.google.protobuf.Message.Builder- Overrides:
clearOneofin classcom.google.protobuf.GeneratedMessageV3.Builder<InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Builder>
-
setRepeatedField
public InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Builder setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, Object value)
- Specified by:
setRepeatedFieldin interfacecom.google.protobuf.Message.Builder- Overrides:
setRepeatedFieldin classcom.google.protobuf.GeneratedMessageV3.Builder<InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Builder>
-
addRepeatedField
public InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Builder addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)
- Specified by:
addRepeatedFieldin interfacecom.google.protobuf.Message.Builder- Overrides:
addRepeatedFieldin classcom.google.protobuf.GeneratedMessageV3.Builder<InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.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
public InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Builder mergeFrom(InjectedSolutionConstraint.ConstraintRelaxation.Relaxation other)
-
isInitialized
public final boolean isInitialized()
- Specified by:
isInitializedin interfacecom.google.protobuf.MessageLiteOrBuilder- Overrides:
isInitializedin classcom.google.protobuf.GeneratedMessageV3.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
public InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Builder 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.
.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
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:
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
public InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Builder 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
public InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Builder 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.
-
setUnknownFields
public final InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Builder setUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
- Specified by:
setUnknownFieldsin interfacecom.google.protobuf.Message.Builder- Overrides:
setUnknownFieldsin classcom.google.protobuf.GeneratedMessageV3.Builder<InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Builder>
-
mergeUnknownFields
public final InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Builder mergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
- Specified by:
mergeUnknownFieldsin interfacecom.google.protobuf.Message.Builder- Overrides:
mergeUnknownFieldsin classcom.google.protobuf.GeneratedMessageV3.Builder<InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Builder>
-
-