Package com.google.ortools.linearsolver
Class MPIndicatorConstraint.Builder
- java.lang.Object
-
- com.google.protobuf.AbstractMessageLite.Builder
-
- com.google.protobuf.AbstractMessage.Builder<BuilderT>
-
- com.google.protobuf.GeneratedMessageV3.Builder<MPIndicatorConstraint.Builder>
-
- com.google.ortools.linearsolver.MPIndicatorConstraint.Builder
-
- All Implemented Interfaces:
MPIndicatorConstraintOrBuilder,com.google.protobuf.Message.Builder,com.google.protobuf.MessageLite.Builder,com.google.protobuf.MessageLiteOrBuilder,com.google.protobuf.MessageOrBuilder,java.lang.Cloneable
- Enclosing class:
- MPIndicatorConstraint
public static final class MPIndicatorConstraint.Builder extends com.google.protobuf.GeneratedMessageV3.Builder<MPIndicatorConstraint.Builder> implements MPIndicatorConstraintOrBuilder
Indicator constraints encode the activation or deactivation of linear constraints given the value of one Boolean variable in the model. For example: y = 0 => 2 * x1 + 3 * x2 >= 42 The 2 * x1 + 3 * x2 >= 42 constraint is only active if the variable y is equal to 0. As of 2019/04, only SCIP, CP-SAT and Gurobi support this constraint type.Protobuf typeoperations_research.MPIndicatorConstraint
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description MPIndicatorConstraint.BuilderaddRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)MPIndicatorConstraintbuild()MPIndicatorConstraintbuildPartial()MPIndicatorConstraint.Builderclear()MPIndicatorConstraint.BuilderclearConstraint()The constraint activated by the indicator variable.MPIndicatorConstraint.BuilderclearField(com.google.protobuf.Descriptors.FieldDescriptor field)MPIndicatorConstraint.BuilderclearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)MPIndicatorConstraint.BuilderclearVarIndex()Variable index (w.r.t.MPIndicatorConstraint.BuilderclearVarValue()Value the above variable should take.MPIndicatorConstraint.Builderclone()MPConstraintProtogetConstraint()The constraint activated by the indicator variable.MPConstraintProto.BuildergetConstraintBuilder()The constraint activated by the indicator variable.MPConstraintProtoOrBuildergetConstraintOrBuilder()The constraint activated by the indicator variable.MPIndicatorConstraintgetDefaultInstanceForType()static com.google.protobuf.Descriptors.DescriptorgetDescriptor()com.google.protobuf.Descriptors.DescriptorgetDescriptorForType()intgetVarIndex()Variable index (w.r.t.intgetVarValue()Value the above variable should take.booleanhasConstraint()The constraint activated by the indicator variable.booleanhasVarIndex()Variable index (w.r.t.booleanhasVarValue()Value the above variable should take.protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTableinternalGetFieldAccessorTable()booleanisInitialized()MPIndicatorConstraint.BuildermergeConstraint(MPConstraintProto value)The constraint activated by the indicator variable.MPIndicatorConstraint.BuildermergeFrom(MPIndicatorConstraint other)MPIndicatorConstraint.BuildermergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)MPIndicatorConstraint.BuildermergeFrom(com.google.protobuf.Message other)MPIndicatorConstraint.BuildermergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)MPIndicatorConstraint.BuildersetConstraint(MPConstraintProto value)The constraint activated by the indicator variable.MPIndicatorConstraint.BuildersetConstraint(MPConstraintProto.Builder builderForValue)The constraint activated by the indicator variable.MPIndicatorConstraint.BuildersetField(com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)MPIndicatorConstraint.BuildersetRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)MPIndicatorConstraint.BuildersetUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)MPIndicatorConstraint.BuildersetVarIndex(int value)Variable index (w.r.t.MPIndicatorConstraint.BuildersetVarValue(int value)Value the above variable should take.-
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<MPIndicatorConstraint.Builder>
-
clear
public MPIndicatorConstraint.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<MPIndicatorConstraint.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<MPIndicatorConstraint.Builder>
-
getDefaultInstanceForType
public MPIndicatorConstraint getDefaultInstanceForType()
- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageLiteOrBuilder- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageOrBuilder
-
build
public MPIndicatorConstraint build()
- Specified by:
buildin interfacecom.google.protobuf.Message.Builder- Specified by:
buildin interfacecom.google.protobuf.MessageLite.Builder
-
buildPartial
public MPIndicatorConstraint buildPartial()
- Specified by:
buildPartialin interfacecom.google.protobuf.Message.Builder- Specified by:
buildPartialin interfacecom.google.protobuf.MessageLite.Builder
-
clone
public MPIndicatorConstraint.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<MPIndicatorConstraint.Builder>
-
setField
public MPIndicatorConstraint.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<MPIndicatorConstraint.Builder>
-
clearField
public MPIndicatorConstraint.Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field)
- Specified by:
clearFieldin interfacecom.google.protobuf.Message.Builder- Overrides:
clearFieldin classcom.google.protobuf.GeneratedMessageV3.Builder<MPIndicatorConstraint.Builder>
-
clearOneof
public MPIndicatorConstraint.Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)
- Specified by:
clearOneofin interfacecom.google.protobuf.Message.Builder- Overrides:
clearOneofin classcom.google.protobuf.GeneratedMessageV3.Builder<MPIndicatorConstraint.Builder>
-
setRepeatedField
public MPIndicatorConstraint.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<MPIndicatorConstraint.Builder>
-
addRepeatedField
public MPIndicatorConstraint.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<MPIndicatorConstraint.Builder>
-
mergeFrom
public MPIndicatorConstraint.Builder mergeFrom(com.google.protobuf.Message other)
- Specified by:
mergeFromin interfacecom.google.protobuf.Message.Builder- Overrides:
mergeFromin classcom.google.protobuf.AbstractMessage.Builder<MPIndicatorConstraint.Builder>
-
mergeFrom
public MPIndicatorConstraint.Builder mergeFrom(MPIndicatorConstraint other)
-
isInitialized
public final boolean isInitialized()
- Specified by:
isInitializedin interfacecom.google.protobuf.MessageLiteOrBuilder- Overrides:
isInitializedin classcom.google.protobuf.GeneratedMessageV3.Builder<MPIndicatorConstraint.Builder>
-
mergeFrom
public MPIndicatorConstraint.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<MPIndicatorConstraint.Builder>- Throws:
java.io.IOException
-
hasVarIndex
public boolean hasVarIndex()
Variable index (w.r.t. the "variable" field of MPModelProto) of the Boolean variable used as indicator.
optional int32 var_index = 1;- Specified by:
hasVarIndexin interfaceMPIndicatorConstraintOrBuilder- Returns:
- Whether the varIndex field is set.
-
getVarIndex
public int getVarIndex()
Variable index (w.r.t. the "variable" field of MPModelProto) of the Boolean variable used as indicator.
optional int32 var_index = 1;- Specified by:
getVarIndexin interfaceMPIndicatorConstraintOrBuilder- Returns:
- The varIndex.
-
setVarIndex
public MPIndicatorConstraint.Builder setVarIndex(int value)
Variable index (w.r.t. the "variable" field of MPModelProto) of the Boolean variable used as indicator.
optional int32 var_index = 1;- Parameters:
value- The varIndex to set.- Returns:
- This builder for chaining.
-
clearVarIndex
public MPIndicatorConstraint.Builder clearVarIndex()
Variable index (w.r.t. the "variable" field of MPModelProto) of the Boolean variable used as indicator.
optional int32 var_index = 1;- Returns:
- This builder for chaining.
-
hasVarValue
public boolean hasVarValue()
Value the above variable should take. Must be 0 or 1.
optional int32 var_value = 2;- Specified by:
hasVarValuein interfaceMPIndicatorConstraintOrBuilder- Returns:
- Whether the varValue field is set.
-
getVarValue
public int getVarValue()
Value the above variable should take. Must be 0 or 1.
optional int32 var_value = 2;- Specified by:
getVarValuein interfaceMPIndicatorConstraintOrBuilder- Returns:
- The varValue.
-
setVarValue
public MPIndicatorConstraint.Builder setVarValue(int value)
Value the above variable should take. Must be 0 or 1.
optional int32 var_value = 2;- Parameters:
value- The varValue to set.- Returns:
- This builder for chaining.
-
clearVarValue
public MPIndicatorConstraint.Builder clearVarValue()
Value the above variable should take. Must be 0 or 1.
optional int32 var_value = 2;- Returns:
- This builder for chaining.
-
hasConstraint
public boolean hasConstraint()
The constraint activated by the indicator variable.
optional .operations_research.MPConstraintProto constraint = 3;- Specified by:
hasConstraintin interfaceMPIndicatorConstraintOrBuilder- Returns:
- Whether the constraint field is set.
-
getConstraint
public MPConstraintProto getConstraint()
The constraint activated by the indicator variable.
optional .operations_research.MPConstraintProto constraint = 3;- Specified by:
getConstraintin interfaceMPIndicatorConstraintOrBuilder- Returns:
- The constraint.
-
setConstraint
public MPIndicatorConstraint.Builder setConstraint(MPConstraintProto value)
The constraint activated by the indicator variable.
optional .operations_research.MPConstraintProto constraint = 3;
-
setConstraint
public MPIndicatorConstraint.Builder setConstraint(MPConstraintProto.Builder builderForValue)
The constraint activated by the indicator variable.
optional .operations_research.MPConstraintProto constraint = 3;
-
mergeConstraint
public MPIndicatorConstraint.Builder mergeConstraint(MPConstraintProto value)
The constraint activated by the indicator variable.
optional .operations_research.MPConstraintProto constraint = 3;
-
clearConstraint
public MPIndicatorConstraint.Builder clearConstraint()
The constraint activated by the indicator variable.
optional .operations_research.MPConstraintProto constraint = 3;
-
getConstraintBuilder
public MPConstraintProto.Builder getConstraintBuilder()
The constraint activated by the indicator variable.
optional .operations_research.MPConstraintProto constraint = 3;
-
getConstraintOrBuilder
public MPConstraintProtoOrBuilder getConstraintOrBuilder()
The constraint activated by the indicator variable.
optional .operations_research.MPConstraintProto constraint = 3;- Specified by:
getConstraintOrBuilderin interfaceMPIndicatorConstraintOrBuilder
-
setUnknownFields
public final MPIndicatorConstraint.Builder setUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
- Specified by:
setUnknownFieldsin interfacecom.google.protobuf.Message.Builder- Overrides:
setUnknownFieldsin classcom.google.protobuf.GeneratedMessageV3.Builder<MPIndicatorConstraint.Builder>
-
mergeUnknownFields
public final MPIndicatorConstraint.Builder mergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
- Specified by:
mergeUnknownFieldsin interfacecom.google.protobuf.Message.Builder- Overrides:
mergeUnknownFieldsin classcom.google.protobuf.GeneratedMessageV3.Builder<MPIndicatorConstraint.Builder>
-
-