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.Builder
addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)
InjectedSolutionConstraint.ConstraintRelaxation.Relaxation
build()
InjectedSolutionConstraint.ConstraintRelaxation.Relaxation
buildPartial()
InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Builder
clear()
InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Builder
clearField(com.google.protobuf.Descriptors.FieldDescriptor field)
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.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Builder
clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)
InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Builder
clearThresholdTime()
The time at or after which the relaxation `level` may be applied.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Builder
clearThresholdVisitCount()
The number of visits at or after which the relaxation `level` may be applied.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Builder
clone()
InjectedSolutionConstraint.ConstraintRelaxation.Relaxation
getDefaultInstanceForType()
static com.google.protobuf.Descriptors.Descriptor
getDescriptor()
com.google.protobuf.Descriptors.Descriptor
getDescriptorForType()
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.int
getLevelValue()
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.Timestamp
getThresholdTime()
The time at or after which the relaxation `level` may be applied.com.google.protobuf.Timestamp.Builder
getThresholdTimeBuilder()
The time at or after which the relaxation `level` may be applied.com.google.protobuf.TimestampOrBuilder
getThresholdTimeOrBuilder()
The time at or after which the relaxation `level` may be applied.int
getThresholdVisitCount()
The number of visits at or after which the relaxation `level` may be applied.boolean
hasThresholdTime()
The time at or after which the relaxation `level` may be applied.protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable()
boolean
isInitialized()
InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Builder
mergeFrom(InjectedSolutionConstraint.ConstraintRelaxation.Relaxation other)
InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Builder
mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Builder
mergeFrom(com.google.protobuf.Message other)
InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Builder
mergeThresholdTime(com.google.protobuf.Timestamp value)
The time at or after which the relaxation `level` may be applied.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Builder
mergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Builder
setField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)
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.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.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Builder
setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, Object value)
InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Builder
setThresholdTime(com.google.protobuf.Timestamp value)
The time at or after which the relaxation `level` may be applied.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Builder
setThresholdTime(com.google.protobuf.Timestamp.Builder builderForValue)
The time at or after which the relaxation `level` may be applied.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Builder
setThresholdVisitCount(int value)
The number of visits at or after which the relaxation `level` may be applied.InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Builder
setUnknownFields(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:
internalGetFieldAccessorTable
in classcom.google.protobuf.GeneratedMessageV3.Builder<InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Builder>
-
clear
public InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Builder clear()
- Specified by:
clear
in interfacecom.google.protobuf.Message.Builder
- Specified by:
clear
in interfacecom.google.protobuf.MessageLite.Builder
- Overrides:
clear
in classcom.google.protobuf.GeneratedMessageV3.Builder<InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Builder>
-
getDescriptorForType
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
- Specified by:
getDescriptorForType
in interfacecom.google.protobuf.Message.Builder
- Specified by:
getDescriptorForType
in interfacecom.google.protobuf.MessageOrBuilder
- Overrides:
getDescriptorForType
in classcom.google.protobuf.GeneratedMessageV3.Builder<InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Builder>
-
getDefaultInstanceForType
public InjectedSolutionConstraint.ConstraintRelaxation.Relaxation getDefaultInstanceForType()
- Specified by:
getDefaultInstanceForType
in interfacecom.google.protobuf.MessageLiteOrBuilder
- Specified by:
getDefaultInstanceForType
in interfacecom.google.protobuf.MessageOrBuilder
-
build
public InjectedSolutionConstraint.ConstraintRelaxation.Relaxation build()
- Specified by:
build
in interfacecom.google.protobuf.Message.Builder
- Specified by:
build
in interfacecom.google.protobuf.MessageLite.Builder
-
buildPartial
public InjectedSolutionConstraint.ConstraintRelaxation.Relaxation buildPartial()
- Specified by:
buildPartial
in interfacecom.google.protobuf.Message.Builder
- Specified by:
buildPartial
in interfacecom.google.protobuf.MessageLite.Builder
-
clone
public InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Builder clone()
- Specified by:
clone
in interfacecom.google.protobuf.Message.Builder
- Specified by:
clone
in interfacecom.google.protobuf.MessageLite.Builder
- Overrides:
clone
in 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:
setField
in interfacecom.google.protobuf.Message.Builder
- Overrides:
setField
in classcom.google.protobuf.GeneratedMessageV3.Builder<InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Builder>
-
clearField
public InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field)
- Specified by:
clearField
in interfacecom.google.protobuf.Message.Builder
- Overrides:
clearField
in classcom.google.protobuf.GeneratedMessageV3.Builder<InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Builder>
-
clearOneof
public InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)
- Specified by:
clearOneof
in interfacecom.google.protobuf.Message.Builder
- Overrides:
clearOneof
in 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:
setRepeatedField
in interfacecom.google.protobuf.Message.Builder
- Overrides:
setRepeatedField
in 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:
addRepeatedField
in interfacecom.google.protobuf.Message.Builder
- Overrides:
addRepeatedField
in classcom.google.protobuf.GeneratedMessageV3.Builder<InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Builder>
-
mergeFrom
public InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Builder mergeFrom(com.google.protobuf.Message other)
- Specified by:
mergeFrom
in interfacecom.google.protobuf.Message.Builder
- Overrides:
mergeFrom
in 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:
isInitialized
in interfacecom.google.protobuf.MessageLiteOrBuilder
- Overrides:
isInitialized
in 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:
mergeFrom
in interfacecom.google.protobuf.Message.Builder
- Specified by:
mergeFrom
in interfacecom.google.protobuf.MessageLite.Builder
- Overrides:
mergeFrom
in 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:
getLevelValue
in 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:
getLevel
in 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:
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.
-
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:
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.
-
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:
setUnknownFields
in interfacecom.google.protobuf.Message.Builder
- Overrides:
setUnknownFields
in classcom.google.protobuf.GeneratedMessageV3.Builder<InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Builder>
-
mergeUnknownFields
public final InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Builder mergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
- Specified by:
mergeUnknownFields
in interfacecom.google.protobuf.Message.Builder
- Overrides:
mergeUnknownFields
in classcom.google.protobuf.GeneratedMessageV3.Builder<InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Builder>
-
-