Package com.google.ortools.sat
Class LinearBooleanConstraint.Builder
- java.lang.Object
-
- com.google.protobuf.AbstractMessageLite.Builder
-
- com.google.protobuf.AbstractMessage.Builder<BuilderT>
-
- com.google.protobuf.GeneratedMessageV3.Builder<LinearBooleanConstraint.Builder>
-
- com.google.ortools.sat.LinearBooleanConstraint.Builder
-
- All Implemented Interfaces:
LinearBooleanConstraintOrBuilder,com.google.protobuf.Message.Builder,com.google.protobuf.MessageLite.Builder,com.google.protobuf.MessageLiteOrBuilder,com.google.protobuf.MessageOrBuilder,java.lang.Cloneable
- Enclosing class:
- LinearBooleanConstraint
public static final class LinearBooleanConstraint.Builder extends com.google.protobuf.GeneratedMessageV3.Builder<LinearBooleanConstraint.Builder> implements LinearBooleanConstraintOrBuilder
A linear Boolean constraint which is a bounded sum of linear terms. Each term beeing a literal times an integer coefficient. If we assume that a literal takes the value 1 if it is true and 0 otherwise, the constraint is: lower_bound <= ... + coefficients[i] * literals[i] + ... <= upper_bound
Protobuf typeoperations_research.sat.LinearBooleanConstraint
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description LinearBooleanConstraint.BuilderaddAllCoefficients(java.lang.Iterable<? extends java.lang.Long> values)repeated int64 coefficients = 2;LinearBooleanConstraint.BuilderaddAllLiterals(java.lang.Iterable<? extends java.lang.Integer> values)Linear terms involved in this constraint.LinearBooleanConstraint.BuilderaddCoefficients(long value)repeated int64 coefficients = 2;LinearBooleanConstraint.BuilderaddLiterals(int value)Linear terms involved in this constraint.LinearBooleanConstraint.BuilderaddRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)LinearBooleanConstraintbuild()LinearBooleanConstraintbuildPartial()LinearBooleanConstraint.Builderclear()LinearBooleanConstraint.BuilderclearCoefficients()repeated int64 coefficients = 2;LinearBooleanConstraint.BuilderclearField(com.google.protobuf.Descriptors.FieldDescriptor field)LinearBooleanConstraint.BuilderclearLiterals()Linear terms involved in this constraint.LinearBooleanConstraint.BuilderclearLowerBound()Optional lower (resp.LinearBooleanConstraint.BuilderclearName()The name of this constraint.LinearBooleanConstraint.BuilderclearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)LinearBooleanConstraint.BuilderclearUpperBound()optional int64 upper_bound = 4;LinearBooleanConstraint.Builderclone()longgetCoefficients(int index)repeated int64 coefficients = 2;intgetCoefficientsCount()repeated int64 coefficients = 2;java.util.List<java.lang.Long>getCoefficientsList()repeated int64 coefficients = 2;LinearBooleanConstraintgetDefaultInstanceForType()static com.google.protobuf.Descriptors.DescriptorgetDescriptor()com.google.protobuf.Descriptors.DescriptorgetDescriptorForType()intgetLiterals(int index)Linear terms involved in this constraint.intgetLiteralsCount()Linear terms involved in this constraint.java.util.List<java.lang.Integer>getLiteralsList()Linear terms involved in this constraint.longgetLowerBound()Optional lower (resp.java.lang.StringgetName()The name of this constraint.com.google.protobuf.ByteStringgetNameBytes()The name of this constraint.longgetUpperBound()optional int64 upper_bound = 4;booleanhasLowerBound()Optional lower (resp.booleanhasName()The name of this constraint.booleanhasUpperBound()optional int64 upper_bound = 4;protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTableinternalGetFieldAccessorTable()booleanisInitialized()LinearBooleanConstraint.BuildermergeFrom(LinearBooleanConstraint other)LinearBooleanConstraint.BuildermergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)LinearBooleanConstraint.BuildermergeFrom(com.google.protobuf.Message other)LinearBooleanConstraint.BuildermergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)LinearBooleanConstraint.BuildersetCoefficients(int index, long value)repeated int64 coefficients = 2;LinearBooleanConstraint.BuildersetField(com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)LinearBooleanConstraint.BuildersetLiterals(int index, int value)Linear terms involved in this constraint.LinearBooleanConstraint.BuildersetLowerBound(long value)Optional lower (resp.LinearBooleanConstraint.BuildersetName(java.lang.String value)The name of this constraint.LinearBooleanConstraint.BuildersetNameBytes(com.google.protobuf.ByteString value)The name of this constraint.LinearBooleanConstraint.BuildersetRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)LinearBooleanConstraint.BuildersetUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)LinearBooleanConstraint.BuildersetUpperBound(long value)optional int64 upper_bound = 4;-
Methods inherited from class com.google.protobuf.GeneratedMessageV3.Builder
getAllFields, getField, getFieldBuilder, getOneofFieldDescriptor, getParentForChildren, getRepeatedField, getRepeatedFieldBuilder, getRepeatedFieldCount, getUnknownFields, getUnknownFieldSetBuilder, hasField, hasOneof, internalGetMapField, internalGetMapFieldReflection, internalGetMutableMapField, internalGetMutableMapFieldReflection, 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<LinearBooleanConstraint.Builder>
-
clear
public LinearBooleanConstraint.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<LinearBooleanConstraint.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<LinearBooleanConstraint.Builder>
-
getDefaultInstanceForType
public LinearBooleanConstraint getDefaultInstanceForType()
- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageLiteOrBuilder- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageOrBuilder
-
build
public LinearBooleanConstraint build()
- Specified by:
buildin interfacecom.google.protobuf.Message.Builder- Specified by:
buildin interfacecom.google.protobuf.MessageLite.Builder
-
buildPartial
public LinearBooleanConstraint buildPartial()
- Specified by:
buildPartialin interfacecom.google.protobuf.Message.Builder- Specified by:
buildPartialin interfacecom.google.protobuf.MessageLite.Builder
-
clone
public LinearBooleanConstraint.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<LinearBooleanConstraint.Builder>
-
setField
public LinearBooleanConstraint.Builder setField(com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)
- Specified by:
setFieldin interfacecom.google.protobuf.Message.Builder- Overrides:
setFieldin classcom.google.protobuf.GeneratedMessageV3.Builder<LinearBooleanConstraint.Builder>
-
clearField
public LinearBooleanConstraint.Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field)
- Specified by:
clearFieldin interfacecom.google.protobuf.Message.Builder- Overrides:
clearFieldin classcom.google.protobuf.GeneratedMessageV3.Builder<LinearBooleanConstraint.Builder>
-
clearOneof
public LinearBooleanConstraint.Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)
- Specified by:
clearOneofin interfacecom.google.protobuf.Message.Builder- Overrides:
clearOneofin classcom.google.protobuf.GeneratedMessageV3.Builder<LinearBooleanConstraint.Builder>
-
setRepeatedField
public LinearBooleanConstraint.Builder setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)
- Specified by:
setRepeatedFieldin interfacecom.google.protobuf.Message.Builder- Overrides:
setRepeatedFieldin classcom.google.protobuf.GeneratedMessageV3.Builder<LinearBooleanConstraint.Builder>
-
addRepeatedField
public LinearBooleanConstraint.Builder addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)
- Specified by:
addRepeatedFieldin interfacecom.google.protobuf.Message.Builder- Overrides:
addRepeatedFieldin classcom.google.protobuf.GeneratedMessageV3.Builder<LinearBooleanConstraint.Builder>
-
mergeFrom
public LinearBooleanConstraint.Builder mergeFrom(com.google.protobuf.Message other)
- Specified by:
mergeFromin interfacecom.google.protobuf.Message.Builder- Overrides:
mergeFromin classcom.google.protobuf.AbstractMessage.Builder<LinearBooleanConstraint.Builder>
-
mergeFrom
public LinearBooleanConstraint.Builder mergeFrom(LinearBooleanConstraint other)
-
isInitialized
public final boolean isInitialized()
- Specified by:
isInitializedin interfacecom.google.protobuf.MessageLiteOrBuilder- Overrides:
isInitializedin classcom.google.protobuf.GeneratedMessageV3.Builder<LinearBooleanConstraint.Builder>
-
mergeFrom
public LinearBooleanConstraint.Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException
- Specified by:
mergeFromin interfacecom.google.protobuf.Message.Builder- Specified by:
mergeFromin interfacecom.google.protobuf.MessageLite.Builder- Overrides:
mergeFromin classcom.google.protobuf.AbstractMessage.Builder<LinearBooleanConstraint.Builder>- Throws:
java.io.IOException
-
getLiteralsList
public java.util.List<java.lang.Integer> getLiteralsList()
Linear terms involved in this constraint. literals[i] is the signed representation of the i-th literal of the constraint and coefficients[i] its coefficients. The signed representation is as follow: for a 0-based variable index x, (x + 1) represents the variable x and -(x + 1) represents its negation. Note that the same variable shouldn't appear twice and that zero coefficients are not allowed.
repeated int32 literals = 1;- Specified by:
getLiteralsListin interfaceLinearBooleanConstraintOrBuilder- Returns:
- A list containing the literals.
-
getLiteralsCount
public int getLiteralsCount()
Linear terms involved in this constraint. literals[i] is the signed representation of the i-th literal of the constraint and coefficients[i] its coefficients. The signed representation is as follow: for a 0-based variable index x, (x + 1) represents the variable x and -(x + 1) represents its negation. Note that the same variable shouldn't appear twice and that zero coefficients are not allowed.
repeated int32 literals = 1;- Specified by:
getLiteralsCountin interfaceLinearBooleanConstraintOrBuilder- Returns:
- The count of literals.
-
getLiterals
public int getLiterals(int index)
Linear terms involved in this constraint. literals[i] is the signed representation of the i-th literal of the constraint and coefficients[i] its coefficients. The signed representation is as follow: for a 0-based variable index x, (x + 1) represents the variable x and -(x + 1) represents its negation. Note that the same variable shouldn't appear twice and that zero coefficients are not allowed.
repeated int32 literals = 1;- Specified by:
getLiteralsin interfaceLinearBooleanConstraintOrBuilder- Parameters:
index- The index of the element to return.- Returns:
- The literals at the given index.
-
setLiterals
public LinearBooleanConstraint.Builder setLiterals(int index, int value)
Linear terms involved in this constraint. literals[i] is the signed representation of the i-th literal of the constraint and coefficients[i] its coefficients. The signed representation is as follow: for a 0-based variable index x, (x + 1) represents the variable x and -(x + 1) represents its negation. Note that the same variable shouldn't appear twice and that zero coefficients are not allowed.
repeated int32 literals = 1;- Parameters:
index- The index to set the value at.value- The literals to set.- Returns:
- This builder for chaining.
-
addLiterals
public LinearBooleanConstraint.Builder addLiterals(int value)
Linear terms involved in this constraint. literals[i] is the signed representation of the i-th literal of the constraint and coefficients[i] its coefficients. The signed representation is as follow: for a 0-based variable index x, (x + 1) represents the variable x and -(x + 1) represents its negation. Note that the same variable shouldn't appear twice and that zero coefficients are not allowed.
repeated int32 literals = 1;- Parameters:
value- The literals to add.- Returns:
- This builder for chaining.
-
addAllLiterals
public LinearBooleanConstraint.Builder addAllLiterals(java.lang.Iterable<? extends java.lang.Integer> values)
Linear terms involved in this constraint. literals[i] is the signed representation of the i-th literal of the constraint and coefficients[i] its coefficients. The signed representation is as follow: for a 0-based variable index x, (x + 1) represents the variable x and -(x + 1) represents its negation. Note that the same variable shouldn't appear twice and that zero coefficients are not allowed.
repeated int32 literals = 1;- Parameters:
values- The literals to add.- Returns:
- This builder for chaining.
-
clearLiterals
public LinearBooleanConstraint.Builder clearLiterals()
Linear terms involved in this constraint. literals[i] is the signed representation of the i-th literal of the constraint and coefficients[i] its coefficients. The signed representation is as follow: for a 0-based variable index x, (x + 1) represents the variable x and -(x + 1) represents its negation. Note that the same variable shouldn't appear twice and that zero coefficients are not allowed.
repeated int32 literals = 1;- Returns:
- This builder for chaining.
-
getCoefficientsList
public java.util.List<java.lang.Long> getCoefficientsList()
repeated int64 coefficients = 2;- Specified by:
getCoefficientsListin interfaceLinearBooleanConstraintOrBuilder- Returns:
- A list containing the coefficients.
-
getCoefficientsCount
public int getCoefficientsCount()
repeated int64 coefficients = 2;- Specified by:
getCoefficientsCountin interfaceLinearBooleanConstraintOrBuilder- Returns:
- The count of coefficients.
-
getCoefficients
public long getCoefficients(int index)
repeated int64 coefficients = 2;- Specified by:
getCoefficientsin interfaceLinearBooleanConstraintOrBuilder- Parameters:
index- The index of the element to return.- Returns:
- The coefficients at the given index.
-
setCoefficients
public LinearBooleanConstraint.Builder setCoefficients(int index, long value)
repeated int64 coefficients = 2;- Parameters:
index- The index to set the value at.value- The coefficients to set.- Returns:
- This builder for chaining.
-
addCoefficients
public LinearBooleanConstraint.Builder addCoefficients(long value)
repeated int64 coefficients = 2;- Parameters:
value- The coefficients to add.- Returns:
- This builder for chaining.
-
addAllCoefficients
public LinearBooleanConstraint.Builder addAllCoefficients(java.lang.Iterable<? extends java.lang.Long> values)
repeated int64 coefficients = 2;- Parameters:
values- The coefficients to add.- Returns:
- This builder for chaining.
-
clearCoefficients
public LinearBooleanConstraint.Builder clearCoefficients()
repeated int64 coefficients = 2;- Returns:
- This builder for chaining.
-
hasLowerBound
public boolean hasLowerBound()
Optional lower (resp. upper) bound of the constraint. If not present, it means that the constraint is not bounded in this direction. The bounds are INCLUSIVE.
optional int64 lower_bound = 3;- Specified by:
hasLowerBoundin interfaceLinearBooleanConstraintOrBuilder- Returns:
- Whether the lowerBound field is set.
-
getLowerBound
public long getLowerBound()
Optional lower (resp. upper) bound of the constraint. If not present, it means that the constraint is not bounded in this direction. The bounds are INCLUSIVE.
optional int64 lower_bound = 3;- Specified by:
getLowerBoundin interfaceLinearBooleanConstraintOrBuilder- Returns:
- The lowerBound.
-
setLowerBound
public LinearBooleanConstraint.Builder setLowerBound(long value)
Optional lower (resp. upper) bound of the constraint. If not present, it means that the constraint is not bounded in this direction. The bounds are INCLUSIVE.
optional int64 lower_bound = 3;- Parameters:
value- The lowerBound to set.- Returns:
- This builder for chaining.
-
clearLowerBound
public LinearBooleanConstraint.Builder clearLowerBound()
Optional lower (resp. upper) bound of the constraint. If not present, it means that the constraint is not bounded in this direction. The bounds are INCLUSIVE.
optional int64 lower_bound = 3;- Returns:
- This builder for chaining.
-
hasUpperBound
public boolean hasUpperBound()
optional int64 upper_bound = 4;- Specified by:
hasUpperBoundin interfaceLinearBooleanConstraintOrBuilder- Returns:
- Whether the upperBound field is set.
-
getUpperBound
public long getUpperBound()
optional int64 upper_bound = 4;- Specified by:
getUpperBoundin interfaceLinearBooleanConstraintOrBuilder- Returns:
- The upperBound.
-
setUpperBound
public LinearBooleanConstraint.Builder setUpperBound(long value)
optional int64 upper_bound = 4;- Parameters:
value- The upperBound to set.- Returns:
- This builder for chaining.
-
clearUpperBound
public LinearBooleanConstraint.Builder clearUpperBound()
optional int64 upper_bound = 4;- Returns:
- This builder for chaining.
-
hasName
public boolean hasName()
The name of this constraint.
optional string name = 5 [default = ""];- Specified by:
hasNamein interfaceLinearBooleanConstraintOrBuilder- Returns:
- Whether the name field is set.
-
getName
public java.lang.String getName()
The name of this constraint.
optional string name = 5 [default = ""];- Specified by:
getNamein interfaceLinearBooleanConstraintOrBuilder- Returns:
- The name.
-
getNameBytes
public com.google.protobuf.ByteString getNameBytes()
The name of this constraint.
optional string name = 5 [default = ""];- Specified by:
getNameBytesin interfaceLinearBooleanConstraintOrBuilder- Returns:
- The bytes for name.
-
setName
public LinearBooleanConstraint.Builder setName(java.lang.String value)
The name of this constraint.
optional string name = 5 [default = ""];- Parameters:
value- The name to set.- Returns:
- This builder for chaining.
-
clearName
public LinearBooleanConstraint.Builder clearName()
The name of this constraint.
optional string name = 5 [default = ""];- Returns:
- This builder for chaining.
-
setNameBytes
public LinearBooleanConstraint.Builder setNameBytes(com.google.protobuf.ByteString value)
The name of this constraint.
optional string name = 5 [default = ""];- Parameters:
value- The bytes for name to set.- Returns:
- This builder for chaining.
-
setUnknownFields
public final LinearBooleanConstraint.Builder setUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
- Specified by:
setUnknownFieldsin interfacecom.google.protobuf.Message.Builder- Overrides:
setUnknownFieldsin classcom.google.protobuf.GeneratedMessageV3.Builder<LinearBooleanConstraint.Builder>
-
mergeUnknownFields
public final LinearBooleanConstraint.Builder mergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
- Specified by:
mergeUnknownFieldsin interfacecom.google.protobuf.Message.Builder- Overrides:
mergeUnknownFieldsin classcom.google.protobuf.GeneratedMessageV3.Builder<LinearBooleanConstraint.Builder>
-
-