public static final class MPIndicatorConstraint.Builder extends com.google.protobuf.GeneratedMessage.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 type
operations_research.MPIndicatorConstraint
Modifier and Type | Method and Description |
---|---|
MPIndicatorConstraint |
build() |
MPIndicatorConstraint |
buildPartial() |
MPIndicatorConstraint.Builder |
clear() |
MPIndicatorConstraint.Builder |
clearConstraint()
The constraint activated by the indicator variable.
|
MPIndicatorConstraint.Builder |
clearVarIndex()
Variable index (w.r.t. the "variable" field of MPModelProto) of the Boolean
variable used as indicator.
|
MPIndicatorConstraint.Builder |
clearVarValue()
Value the above variable should take.
|
MPConstraintProto |
getConstraint()
The constraint activated by the indicator variable.
|
MPConstraintProto.Builder |
getConstraintBuilder()
The constraint activated by the indicator variable.
|
MPConstraintProtoOrBuilder |
getConstraintOrBuilder()
The constraint activated by the indicator variable.
|
MPIndicatorConstraint |
getDefaultInstanceForType() |
static com.google.protobuf.Descriptors.Descriptor |
getDescriptor() |
com.google.protobuf.Descriptors.Descriptor |
getDescriptorForType() |
int |
getVarIndex()
Variable index (w.r.t. the "variable" field of MPModelProto) of the Boolean
variable used as indicator.
|
int |
getVarValue()
Value the above variable should take.
|
boolean |
hasConstraint()
The constraint activated by the indicator variable.
|
boolean |
hasVarIndex()
Variable index (w.r.t. the "variable" field of MPModelProto) of the Boolean
variable used as indicator.
|
boolean |
hasVarValue()
Value the above variable should take.
|
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable |
internalGetFieldAccessorTable() |
boolean |
isInitialized() |
MPIndicatorConstraint.Builder |
mergeConstraint(MPConstraintProto value)
The constraint activated by the indicator variable.
|
MPIndicatorConstraint.Builder |
mergeFrom(com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
MPIndicatorConstraint.Builder |
mergeFrom(com.google.protobuf.Message other) |
MPIndicatorConstraint.Builder |
mergeFrom(MPIndicatorConstraint other) |
MPIndicatorConstraint.Builder |
setConstraint(MPConstraintProto.Builder builderForValue)
The constraint activated by the indicator variable.
|
MPIndicatorConstraint.Builder |
setConstraint(MPConstraintProto value)
The constraint activated by the indicator variable.
|
MPIndicatorConstraint.Builder |
setVarIndex(int value)
Variable index (w.r.t. the "variable" field of MPModelProto) of the Boolean
variable used as indicator.
|
MPIndicatorConstraint.Builder |
setVarValue(int value)
Value the above variable should take.
|
addRepeatedField, clearField, clearOneof, clone, getAllFields, getField, getFieldBuilder, getOneofFieldDescriptor, getParentForChildren, getRepeatedField, getRepeatedFieldBuilder, getRepeatedFieldCount, getUnknownFields, getUnknownFieldSetBuilder, hasField, hasOneof, internalGetMapField, internalGetMapFieldReflection, internalGetMutableMapField, internalGetMutableMapFieldReflection, isClean, markClean, mergeUnknownFields, mergeUnknownLengthDelimitedField, mergeUnknownVarintField, newBuilderForField, onBuilt, onChanged, parseUnknownField, setField, setRepeatedField, setUnknownFields, setUnknownFieldSetBuilder, setUnknownFieldsProto3
findInitializationErrors, getInitializationErrorString, internalMergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException, toString
addAll, addAll, mergeDelimitedFrom, mergeDelimitedFrom, newUninitializedMessageException
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
internalGetFieldAccessorTable
in class com.google.protobuf.GeneratedMessage.Builder<MPIndicatorConstraint.Builder>
public MPIndicatorConstraint.Builder clear()
clear
in interface com.google.protobuf.Message.Builder
clear
in interface com.google.protobuf.MessageLite.Builder
clear
in class com.google.protobuf.GeneratedMessage.Builder<MPIndicatorConstraint.Builder>
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
getDescriptorForType
in interface com.google.protobuf.Message.Builder
getDescriptorForType
in interface com.google.protobuf.MessageOrBuilder
getDescriptorForType
in class com.google.protobuf.GeneratedMessage.Builder<MPIndicatorConstraint.Builder>
public MPIndicatorConstraint getDefaultInstanceForType()
getDefaultInstanceForType
in interface com.google.protobuf.MessageLiteOrBuilder
getDefaultInstanceForType
in interface com.google.protobuf.MessageOrBuilder
public MPIndicatorConstraint build()
build
in interface com.google.protobuf.Message.Builder
build
in interface com.google.protobuf.MessageLite.Builder
public MPIndicatorConstraint buildPartial()
buildPartial
in interface com.google.protobuf.Message.Builder
buildPartial
in interface com.google.protobuf.MessageLite.Builder
public MPIndicatorConstraint.Builder mergeFrom(com.google.protobuf.Message other)
mergeFrom
in interface com.google.protobuf.Message.Builder
mergeFrom
in class com.google.protobuf.AbstractMessage.Builder<MPIndicatorConstraint.Builder>
public MPIndicatorConstraint.Builder mergeFrom(MPIndicatorConstraint other)
public final boolean isInitialized()
isInitialized
in interface com.google.protobuf.MessageLiteOrBuilder
isInitialized
in class com.google.protobuf.GeneratedMessage.Builder<MPIndicatorConstraint.Builder>
public MPIndicatorConstraint.Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException
mergeFrom
in interface com.google.protobuf.Message.Builder
mergeFrom
in interface com.google.protobuf.MessageLite.Builder
mergeFrom
in class com.google.protobuf.AbstractMessage.Builder<MPIndicatorConstraint.Builder>
java.io.IOException
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;
hasVarIndex
in interface MPIndicatorConstraintOrBuilder
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;
getVarIndex
in interface MPIndicatorConstraintOrBuilder
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;
value
- The varIndex to set.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;
public boolean hasVarValue()
Value the above variable should take. Must be 0 or 1.
optional int32 var_value = 2;
hasVarValue
in interface MPIndicatorConstraintOrBuilder
public int getVarValue()
Value the above variable should take. Must be 0 or 1.
optional int32 var_value = 2;
getVarValue
in interface MPIndicatorConstraintOrBuilder
public MPIndicatorConstraint.Builder setVarValue(int value)
Value the above variable should take. Must be 0 or 1.
optional int32 var_value = 2;
value
- The varValue to set.public MPIndicatorConstraint.Builder clearVarValue()
Value the above variable should take. Must be 0 or 1.
optional int32 var_value = 2;
public boolean hasConstraint()
The constraint activated by the indicator variable.
optional .operations_research.MPConstraintProto constraint = 3;
hasConstraint
in interface MPIndicatorConstraintOrBuilder
public MPConstraintProto getConstraint()
The constraint activated by the indicator variable.
optional .operations_research.MPConstraintProto constraint = 3;
getConstraint
in interface MPIndicatorConstraintOrBuilder
public MPIndicatorConstraint.Builder setConstraint(MPConstraintProto value)
The constraint activated by the indicator variable.
optional .operations_research.MPConstraintProto constraint = 3;
public MPIndicatorConstraint.Builder setConstraint(MPConstraintProto.Builder builderForValue)
The constraint activated by the indicator variable.
optional .operations_research.MPConstraintProto constraint = 3;
public MPIndicatorConstraint.Builder mergeConstraint(MPConstraintProto value)
The constraint activated by the indicator variable.
optional .operations_research.MPConstraintProto constraint = 3;
public MPIndicatorConstraint.Builder clearConstraint()
The constraint activated by the indicator variable.
optional .operations_research.MPConstraintProto constraint = 3;
public MPConstraintProto.Builder getConstraintBuilder()
The constraint activated by the indicator variable.
optional .operations_research.MPConstraintProto constraint = 3;
public MPConstraintProtoOrBuilder getConstraintOrBuilder()
The constraint activated by the indicator variable.
optional .operations_research.MPConstraintProto constraint = 3;
getConstraintOrBuilder
in interface MPIndicatorConstraintOrBuilder
Copyright © 2025. All rights reserved.