Package com.google.ortools.linearsolver
Class MPConstraintProto.Builder
- java.lang.Object
-
- com.google.protobuf.AbstractMessageLite.Builder
-
- com.google.protobuf.AbstractMessage.Builder<BuilderT>
-
- com.google.protobuf.GeneratedMessageV3.Builder<MPConstraintProto.Builder>
-
- com.google.ortools.linearsolver.MPConstraintProto.Builder
-
- All Implemented Interfaces:
MPConstraintProtoOrBuilder,com.google.protobuf.Message.Builder,com.google.protobuf.MessageLite.Builder,com.google.protobuf.MessageLiteOrBuilder,com.google.protobuf.MessageOrBuilder,java.lang.Cloneable
- Enclosing class:
- MPConstraintProto
public static final class MPConstraintProto.Builder extends com.google.protobuf.GeneratedMessageV3.Builder<MPConstraintProto.Builder> implements MPConstraintProtoOrBuilder
A linear constraint is always of the form: lower_bound <= sum of linear term elements <= upper_bound, where lower_bound and upper_bound: - Can form a singleton: lower_bound == upper_bound. The constraint is an equation. - Can form a finite interval [lower_bound, upper_bound]. The constraint is both lower- and upper-bounded, i.e. "boxed". - Can form a semi-infinite interval. lower_bound = -infinity: the constraint is upper-bounded. upper_bound = +infinity: the constraint is lower-bounded. - Can form the infinite interval: lower_bound = -infinity and upper_bound = +infinity. The constraint is free.
Protobuf typeoperations_research.MPConstraintProto
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description MPConstraintProto.BuilderaddAllCoefficient(java.lang.Iterable<? extends java.lang.Double> values)Must be finite.MPConstraintProto.BuilderaddAllVarIndex(java.lang.Iterable<? extends java.lang.Integer> values)var_index[i] is the variable index (w.r.t.MPConstraintProto.BuilderaddCoefficient(double value)Must be finite.MPConstraintProto.BuilderaddRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)MPConstraintProto.BuilderaddVarIndex(int value)var_index[i] is the variable index (w.r.t.MPConstraintProtobuild()MPConstraintProtobuildPartial()MPConstraintProto.Builderclear()MPConstraintProto.BuilderclearCoefficient()Must be finite.MPConstraintProto.BuilderclearField(com.google.protobuf.Descriptors.FieldDescriptor field)MPConstraintProto.BuilderclearIsLazy()[Advanced usage: do not use this if you don't know what you're doing.] A lazy constraint is handled differently by the core solving engine, but it does not change the result.MPConstraintProto.BuilderclearLowerBound()lower_bound must be <= upper_bound.MPConstraintProto.BuilderclearName()The name of the constraint.MPConstraintProto.BuilderclearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)MPConstraintProto.BuilderclearUpperBound()optional double upper_bound = 3 [default = inf];MPConstraintProto.BuilderclearVarIndex()var_index[i] is the variable index (w.r.t.MPConstraintProto.Builderclone()doublegetCoefficient(int index)Must be finite.intgetCoefficientCount()Must be finite.java.util.List<java.lang.Double>getCoefficientList()Must be finite.MPConstraintProtogetDefaultInstanceForType()static com.google.protobuf.Descriptors.DescriptorgetDescriptor()com.google.protobuf.Descriptors.DescriptorgetDescriptorForType()booleangetIsLazy()[Advanced usage: do not use this if you don't know what you're doing.] A lazy constraint is handled differently by the core solving engine, but it does not change the result.doublegetLowerBound()lower_bound must be <= upper_bound.java.lang.StringgetName()The name of the constraint.com.google.protobuf.ByteStringgetNameBytes()The name of the constraint.doublegetUpperBound()optional double upper_bound = 3 [default = inf];intgetVarIndex(int index)var_index[i] is the variable index (w.r.t.intgetVarIndexCount()var_index[i] is the variable index (w.r.t.java.util.List<java.lang.Integer>getVarIndexList()var_index[i] is the variable index (w.r.t.booleanhasIsLazy()[Advanced usage: do not use this if you don't know what you're doing.] A lazy constraint is handled differently by the core solving engine, but it does not change the result.booleanhasLowerBound()lower_bound must be <= upper_bound.booleanhasName()The name of the constraint.booleanhasUpperBound()optional double upper_bound = 3 [default = inf];protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTableinternalGetFieldAccessorTable()booleanisInitialized()MPConstraintProto.BuildermergeFrom(MPConstraintProto other)MPConstraintProto.BuildermergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)MPConstraintProto.BuildermergeFrom(com.google.protobuf.Message other)MPConstraintProto.BuildermergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)MPConstraintProto.BuildersetCoefficient(int index, double value)Must be finite.MPConstraintProto.BuildersetField(com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)MPConstraintProto.BuildersetIsLazy(boolean value)[Advanced usage: do not use this if you don't know what you're doing.] A lazy constraint is handled differently by the core solving engine, but it does not change the result.MPConstraintProto.BuildersetLowerBound(double value)lower_bound must be <= upper_bound.MPConstraintProto.BuildersetName(java.lang.String value)The name of the constraint.MPConstraintProto.BuildersetNameBytes(com.google.protobuf.ByteString value)The name of the constraint.MPConstraintProto.BuildersetRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)MPConstraintProto.BuildersetUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)MPConstraintProto.BuildersetUpperBound(double value)optional double upper_bound = 3 [default = inf];MPConstraintProto.BuildersetVarIndex(int index, int value)var_index[i] is the variable index (w.r.t.-
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<MPConstraintProto.Builder>
-
clear
public MPConstraintProto.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<MPConstraintProto.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<MPConstraintProto.Builder>
-
getDefaultInstanceForType
public MPConstraintProto getDefaultInstanceForType()
- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageLiteOrBuilder- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageOrBuilder
-
build
public MPConstraintProto build()
- Specified by:
buildin interfacecom.google.protobuf.Message.Builder- Specified by:
buildin interfacecom.google.protobuf.MessageLite.Builder
-
buildPartial
public MPConstraintProto buildPartial()
- Specified by:
buildPartialin interfacecom.google.protobuf.Message.Builder- Specified by:
buildPartialin interfacecom.google.protobuf.MessageLite.Builder
-
clone
public MPConstraintProto.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<MPConstraintProto.Builder>
-
setField
public MPConstraintProto.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<MPConstraintProto.Builder>
-
clearField
public MPConstraintProto.Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field)
- Specified by:
clearFieldin interfacecom.google.protobuf.Message.Builder- Overrides:
clearFieldin classcom.google.protobuf.GeneratedMessageV3.Builder<MPConstraintProto.Builder>
-
clearOneof
public MPConstraintProto.Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)
- Specified by:
clearOneofin interfacecom.google.protobuf.Message.Builder- Overrides:
clearOneofin classcom.google.protobuf.GeneratedMessageV3.Builder<MPConstraintProto.Builder>
-
setRepeatedField
public MPConstraintProto.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<MPConstraintProto.Builder>
-
addRepeatedField
public MPConstraintProto.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<MPConstraintProto.Builder>
-
mergeFrom
public MPConstraintProto.Builder mergeFrom(com.google.protobuf.Message other)
- Specified by:
mergeFromin interfacecom.google.protobuf.Message.Builder- Overrides:
mergeFromin classcom.google.protobuf.AbstractMessage.Builder<MPConstraintProto.Builder>
-
mergeFrom
public MPConstraintProto.Builder mergeFrom(MPConstraintProto other)
-
isInitialized
public final boolean isInitialized()
- Specified by:
isInitializedin interfacecom.google.protobuf.MessageLiteOrBuilder- Overrides:
isInitializedin classcom.google.protobuf.GeneratedMessageV3.Builder<MPConstraintProto.Builder>
-
mergeFrom
public MPConstraintProto.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<MPConstraintProto.Builder>- Throws:
java.io.IOException
-
getVarIndexList
public java.util.List<java.lang.Integer> getVarIndexList()
var_index[i] is the variable index (w.r.t. to "variable" field of MPModelProto) of the i-th linear term involved in this constraint, and coefficient[i] is its coefficient. Only the terms with non-zero coefficients need to appear. var_index may not contain duplicates.
repeated int32 var_index = 6 [packed = true];- Specified by:
getVarIndexListin interfaceMPConstraintProtoOrBuilder- Returns:
- A list containing the varIndex.
-
getVarIndexCount
public int getVarIndexCount()
var_index[i] is the variable index (w.r.t. to "variable" field of MPModelProto) of the i-th linear term involved in this constraint, and coefficient[i] is its coefficient. Only the terms with non-zero coefficients need to appear. var_index may not contain duplicates.
repeated int32 var_index = 6 [packed = true];- Specified by:
getVarIndexCountin interfaceMPConstraintProtoOrBuilder- Returns:
- The count of varIndex.
-
getVarIndex
public int getVarIndex(int index)
var_index[i] is the variable index (w.r.t. to "variable" field of MPModelProto) of the i-th linear term involved in this constraint, and coefficient[i] is its coefficient. Only the terms with non-zero coefficients need to appear. var_index may not contain duplicates.
repeated int32 var_index = 6 [packed = true];- Specified by:
getVarIndexin interfaceMPConstraintProtoOrBuilder- Parameters:
index- The index of the element to return.- Returns:
- The varIndex at the given index.
-
setVarIndex
public MPConstraintProto.Builder setVarIndex(int index, int value)
var_index[i] is the variable index (w.r.t. to "variable" field of MPModelProto) of the i-th linear term involved in this constraint, and coefficient[i] is its coefficient. Only the terms with non-zero coefficients need to appear. var_index may not contain duplicates.
repeated int32 var_index = 6 [packed = true];- Parameters:
index- The index to set the value at.value- The varIndex to set.- Returns:
- This builder for chaining.
-
addVarIndex
public MPConstraintProto.Builder addVarIndex(int value)
var_index[i] is the variable index (w.r.t. to "variable" field of MPModelProto) of the i-th linear term involved in this constraint, and coefficient[i] is its coefficient. Only the terms with non-zero coefficients need to appear. var_index may not contain duplicates.
repeated int32 var_index = 6 [packed = true];- Parameters:
value- The varIndex to add.- Returns:
- This builder for chaining.
-
addAllVarIndex
public MPConstraintProto.Builder addAllVarIndex(java.lang.Iterable<? extends java.lang.Integer> values)
var_index[i] is the variable index (w.r.t. to "variable" field of MPModelProto) of the i-th linear term involved in this constraint, and coefficient[i] is its coefficient. Only the terms with non-zero coefficients need to appear. var_index may not contain duplicates.
repeated int32 var_index = 6 [packed = true];- Parameters:
values- The varIndex to add.- Returns:
- This builder for chaining.
-
clearVarIndex
public MPConstraintProto.Builder clearVarIndex()
var_index[i] is the variable index (w.r.t. to "variable" field of MPModelProto) of the i-th linear term involved in this constraint, and coefficient[i] is its coefficient. Only the terms with non-zero coefficients need to appear. var_index may not contain duplicates.
repeated int32 var_index = 6 [packed = true];- Returns:
- This builder for chaining.
-
getCoefficientList
public java.util.List<java.lang.Double> getCoefficientList()
Must be finite.
repeated double coefficient = 7 [packed = true];- Specified by:
getCoefficientListin interfaceMPConstraintProtoOrBuilder- Returns:
- A list containing the coefficient.
-
getCoefficientCount
public int getCoefficientCount()
Must be finite.
repeated double coefficient = 7 [packed = true];- Specified by:
getCoefficientCountin interfaceMPConstraintProtoOrBuilder- Returns:
- The count of coefficient.
-
getCoefficient
public double getCoefficient(int index)
Must be finite.
repeated double coefficient = 7 [packed = true];- Specified by:
getCoefficientin interfaceMPConstraintProtoOrBuilder- Parameters:
index- The index of the element to return.- Returns:
- The coefficient at the given index.
-
setCoefficient
public MPConstraintProto.Builder setCoefficient(int index, double value)
Must be finite.
repeated double coefficient = 7 [packed = true];- Parameters:
index- The index to set the value at.value- The coefficient to set.- Returns:
- This builder for chaining.
-
addCoefficient
public MPConstraintProto.Builder addCoefficient(double value)
Must be finite.
repeated double coefficient = 7 [packed = true];- Parameters:
value- The coefficient to add.- Returns:
- This builder for chaining.
-
addAllCoefficient
public MPConstraintProto.Builder addAllCoefficient(java.lang.Iterable<? extends java.lang.Double> values)
Must be finite.
repeated double coefficient = 7 [packed = true];- Parameters:
values- The coefficient to add.- Returns:
- This builder for chaining.
-
clearCoefficient
public MPConstraintProto.Builder clearCoefficient()
Must be finite.
repeated double coefficient = 7 [packed = true];- Returns:
- This builder for chaining.
-
hasLowerBound
public boolean hasLowerBound()
lower_bound must be <= upper_bound.
optional double lower_bound = 2 [default = -inf];- Specified by:
hasLowerBoundin interfaceMPConstraintProtoOrBuilder- Returns:
- Whether the lowerBound field is set.
-
getLowerBound
public double getLowerBound()
lower_bound must be <= upper_bound.
optional double lower_bound = 2 [default = -inf];- Specified by:
getLowerBoundin interfaceMPConstraintProtoOrBuilder- Returns:
- The lowerBound.
-
setLowerBound
public MPConstraintProto.Builder setLowerBound(double value)
lower_bound must be <= upper_bound.
optional double lower_bound = 2 [default = -inf];- Parameters:
value- The lowerBound to set.- Returns:
- This builder for chaining.
-
clearLowerBound
public MPConstraintProto.Builder clearLowerBound()
lower_bound must be <= upper_bound.
optional double lower_bound = 2 [default = -inf];- Returns:
- This builder for chaining.
-
hasUpperBound
public boolean hasUpperBound()
optional double upper_bound = 3 [default = inf];- Specified by:
hasUpperBoundin interfaceMPConstraintProtoOrBuilder- Returns:
- Whether the upperBound field is set.
-
getUpperBound
public double getUpperBound()
optional double upper_bound = 3 [default = inf];- Specified by:
getUpperBoundin interfaceMPConstraintProtoOrBuilder- Returns:
- The upperBound.
-
setUpperBound
public MPConstraintProto.Builder setUpperBound(double value)
optional double upper_bound = 3 [default = inf];- Parameters:
value- The upperBound to set.- Returns:
- This builder for chaining.
-
clearUpperBound
public MPConstraintProto.Builder clearUpperBound()
optional double upper_bound = 3 [default = inf];- Returns:
- This builder for chaining.
-
hasName
public boolean hasName()
The name of the constraint.
optional string name = 4 [default = ""];- Specified by:
hasNamein interfaceMPConstraintProtoOrBuilder- Returns:
- Whether the name field is set.
-
getName
public java.lang.String getName()
The name of the constraint.
optional string name = 4 [default = ""];- Specified by:
getNamein interfaceMPConstraintProtoOrBuilder- Returns:
- The name.
-
getNameBytes
public com.google.protobuf.ByteString getNameBytes()
The name of the constraint.
optional string name = 4 [default = ""];- Specified by:
getNameBytesin interfaceMPConstraintProtoOrBuilder- Returns:
- The bytes for name.
-
setName
public MPConstraintProto.Builder setName(java.lang.String value)
The name of the constraint.
optional string name = 4 [default = ""];- Parameters:
value- The name to set.- Returns:
- This builder for chaining.
-
clearName
public MPConstraintProto.Builder clearName()
The name of the constraint.
optional string name = 4 [default = ""];- Returns:
- This builder for chaining.
-
setNameBytes
public MPConstraintProto.Builder setNameBytes(com.google.protobuf.ByteString value)
The name of the constraint.
optional string name = 4 [default = ""];- Parameters:
value- The bytes for name to set.- Returns:
- This builder for chaining.
-
hasIsLazy
public boolean hasIsLazy()
[Advanced usage: do not use this if you don't know what you're doing.] A lazy constraint is handled differently by the core solving engine, but it does not change the result. It may or may not impact the performance. For more info see: http://tinyurl.com/lazy-constraints.
optional bool is_lazy = 5 [default = false];- Specified by:
hasIsLazyin interfaceMPConstraintProtoOrBuilder- Returns:
- Whether the isLazy field is set.
-
getIsLazy
public boolean getIsLazy()
[Advanced usage: do not use this if you don't know what you're doing.] A lazy constraint is handled differently by the core solving engine, but it does not change the result. It may or may not impact the performance. For more info see: http://tinyurl.com/lazy-constraints.
optional bool is_lazy = 5 [default = false];- Specified by:
getIsLazyin interfaceMPConstraintProtoOrBuilder- Returns:
- The isLazy.
-
setIsLazy
public MPConstraintProto.Builder setIsLazy(boolean value)
[Advanced usage: do not use this if you don't know what you're doing.] A lazy constraint is handled differently by the core solving engine, but it does not change the result. It may or may not impact the performance. For more info see: http://tinyurl.com/lazy-constraints.
optional bool is_lazy = 5 [default = false];- Parameters:
value- The isLazy to set.- Returns:
- This builder for chaining.
-
clearIsLazy
public MPConstraintProto.Builder clearIsLazy()
[Advanced usage: do not use this if you don't know what you're doing.] A lazy constraint is handled differently by the core solving engine, but it does not change the result. It may or may not impact the performance. For more info see: http://tinyurl.com/lazy-constraints.
optional bool is_lazy = 5 [default = false];- Returns:
- This builder for chaining.
-
setUnknownFields
public final MPConstraintProto.Builder setUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
- Specified by:
setUnknownFieldsin interfacecom.google.protobuf.Message.Builder- Overrides:
setUnknownFieldsin classcom.google.protobuf.GeneratedMessageV3.Builder<MPConstraintProto.Builder>
-
mergeUnknownFields
public final MPConstraintProto.Builder mergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
- Specified by:
mergeUnknownFieldsin interfacecom.google.protobuf.Message.Builder- Overrides:
mergeUnknownFieldsin classcom.google.protobuf.GeneratedMessageV3.Builder<MPConstraintProto.Builder>
-
-