Java Reference
Java Reference
Detailed Description
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
Definition at line 19 of file MPIndicatorConstraint.java.
Classes | |
| class | Builder |
Public Member Functions | |
| .lang.Override final com.google.protobuf.UnknownFieldSet | getUnknownFields () |
| .lang.Override boolean | hasVarIndex () |
| .lang.Override int | getVarIndex () |
| .lang.Override boolean | hasVarValue () |
| .lang.Override int | getVarValue () |
| .lang.Override boolean | hasConstraint () |
| .lang.Override com.google.ortools.linearsolver.MPConstraintProto | getConstraint () |
| .lang.Override com.google.ortools.linearsolver.MPConstraintProtoOrBuilder | getConstraintOrBuilder () |
| .lang.Override final boolean | isInitialized () |
| .lang.Override void | writeTo (com.google.protobuf.CodedOutputStream output) throws java.io.IOException |
| .lang.Override int | getSerializedSize () |
| .lang.Override boolean | equals (final java.lang.Object obj) |
| .lang.Override int | hashCode () |
| .lang.Override Builder | newBuilderForType () |
| .lang.Override Builder | toBuilder () |
| .lang.Override com.google.protobuf.Parser< MPIndicatorConstraint > | getParserForType () |
| .lang.Override com.google.ortools.linearsolver.MPIndicatorConstraint | getDefaultInstanceForType () |
Static Public Member Functions | |
| static final com.google.protobuf.Descriptors.Descriptor | getDescriptor () |
| static com.google.ortools.linearsolver.MPIndicatorConstraint | parseFrom (java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException |
| static com.google.ortools.linearsolver.MPIndicatorConstraint | parseFrom (java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException |
| static com.google.ortools.linearsolver.MPIndicatorConstraint | parseFrom (com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException |
| static com.google.ortools.linearsolver.MPIndicatorConstraint | parseFrom (com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException |
| static com.google.ortools.linearsolver.MPIndicatorConstraint | parseFrom (byte[] data) throws com.google.protobuf.InvalidProtocolBufferException |
| static com.google.ortools.linearsolver.MPIndicatorConstraint | parseFrom (byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException |
| static com.google.ortools.linearsolver.MPIndicatorConstraint | parseFrom (java.io.InputStream input) throws java.io.IOException |
| static com.google.ortools.linearsolver.MPIndicatorConstraint | parseFrom (java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException |
| static com.google.ortools.linearsolver.MPIndicatorConstraint | parseDelimitedFrom (java.io.InputStream input) throws java.io.IOException |
| static com.google.ortools.linearsolver.MPIndicatorConstraint | parseDelimitedFrom (java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException |
| static com.google.ortools.linearsolver.MPIndicatorConstraint | parseFrom (com.google.protobuf.CodedInputStream input) throws java.io.IOException |
| static com.google.ortools.linearsolver.MPIndicatorConstraint | parseFrom (com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException |
| static Builder | newBuilder () |
| static Builder | newBuilder (com.google.ortools.linearsolver.MPIndicatorConstraint prototype) |
| static com.google.ortools.linearsolver.MPIndicatorConstraint | getDefaultInstance () |
| static com.google.protobuf.Parser< MPIndicatorConstraint > | parser () |
Static Public Attributes | |
| static final int | VAR_INDEX_FIELD_NUMBER = 1 |
| static final int | VAR_VALUE_FIELD_NUMBER = 2 |
| static final int | CONSTRAINT_FIELD_NUMBER = 3 |
| .lang.Deprecated static final com.google.protobuf.Parser< MPIndicatorConstraint > | PARSER |
Protected Member Functions | |
| .lang.Override java.lang.Object | newInstance (UnusedPrivateParameter unused) |
| .lang.Override com.google.protobuf.GeneratedMessageV3.FieldAccessorTable | internalGetFieldAccessorTable () |
| .lang.Override Builder | newBuilderForType (com.google.protobuf.GeneratedMessageV3.BuilderParent parent) |
Member Function Documentation
◆ equals()
|
inline |
Definition at line 262 of file MPIndicatorConstraint.java.
◆ getConstraint()
|
inline |
The constraint activated by the indicator variable.
optional .operations_research.MPConstraintProto constraint = 3;
- Returns
- The constraint.
Implements MPIndicatorConstraintOrBuilder.
Definition at line 197 of file MPIndicatorConstraint.java.
◆ getConstraintOrBuilder()
|
inline |
The constraint activated by the indicator variable.
optional .operations_research.MPConstraintProto constraint = 3;
Implements MPIndicatorConstraintOrBuilder.
Definition at line 208 of file MPIndicatorConstraint.java.
◆ getDefaultInstance()
|
inlinestatic |
Definition at line 886 of file MPIndicatorConstraint.java.
◆ getDefaultInstanceForType()
|
inline |
Definition at line 911 of file MPIndicatorConstraint.java.
◆ getDescriptor()
|
inlinestatic |
Definition at line 105 of file MPIndicatorConstraint.java.
◆ getParserForType()
|
inline |
Definition at line 906 of file MPIndicatorConstraint.java.
◆ getSerializedSize()
|
inline |
Definition at line 239 of file MPIndicatorConstraint.java.
◆ getUnknownFields()
|
inline |
Definition at line 40 of file MPIndicatorConstraint.java.
◆ getVarIndex()
|
inline |
Variable index (w.r.t. the "variable" field of MPModelProto) of the Boolean variable used as indicator.
optional int32 var_index = 1;
- Returns
- The varIndex.
Implements MPIndicatorConstraintOrBuilder.
Definition at line 143 of file MPIndicatorConstraint.java.
◆ getVarValue()
|
inline |
Value the above variable should take. Must be 0 or 1.
optional int32 var_value = 2;
- Returns
- The varValue.
Implements MPIndicatorConstraintOrBuilder.
Definition at line 170 of file MPIndicatorConstraint.java.
◆ hasConstraint()
|
inline |
The constraint activated by the indicator variable.
optional .operations_research.MPConstraintProto constraint = 3;
- Returns
- Whether the constraint field is set.
Implements MPIndicatorConstraintOrBuilder.
Definition at line 185 of file MPIndicatorConstraint.java.
◆ hashCode()
|
inline |
Definition at line 291 of file MPIndicatorConstraint.java.
◆ hasVarIndex()
|
inline |
Variable index (w.r.t. the "variable" field of MPModelProto) of the Boolean variable used as indicator.
optional int32 var_index = 1;
- Returns
- Whether the varIndex field is set.
Implements MPIndicatorConstraintOrBuilder.
Definition at line 130 of file MPIndicatorConstraint.java.
◆ hasVarValue()
|
inline |
Value the above variable should take. Must be 0 or 1.
optional int32 var_value = 2;
- Returns
- Whether the varValue field is set.
Implements MPIndicatorConstraintOrBuilder.
Definition at line 158 of file MPIndicatorConstraint.java.
◆ internalGetFieldAccessorTable()
|
inlineprotected |
Definition at line 111 of file MPIndicatorConstraint.java.
◆ isInitialized()
|
inline |
Definition at line 214 of file MPIndicatorConstraint.java.
◆ newBuilder() [1/2]
|
inlinestatic |
Definition at line 386 of file MPIndicatorConstraint.java.
◆ newBuilder() [2/2]
|
inlinestatic |
Definition at line 389 of file MPIndicatorConstraint.java.
◆ newBuilderForType() [1/2]
|
inline |
Definition at line 385 of file MPIndicatorConstraint.java.
◆ newBuilderForType() [2/2]
|
inlineprotected |
Definition at line 399 of file MPIndicatorConstraint.java.
◆ newInstance()
|
inlineprotected |
Definition at line 33 of file MPIndicatorConstraint.java.
◆ parseDelimitedFrom() [1/2]
|
inlinestatic |
Definition at line 358 of file MPIndicatorConstraint.java.
◆ parseDelimitedFrom() [2/2]
|
inlinestatic |
Definition at line 363 of file MPIndicatorConstraint.java.
◆ parseFrom() [1/10]
|
inlinestatic |
Definition at line 336 of file MPIndicatorConstraint.java.
◆ parseFrom() [2/10]
|
inlinestatic |
Definition at line 340 of file MPIndicatorConstraint.java.
◆ parseFrom() [3/10]
|
inlinestatic |
Definition at line 325 of file MPIndicatorConstraint.java.
◆ parseFrom() [4/10]
|
inlinestatic |
Definition at line 330 of file MPIndicatorConstraint.java.
◆ parseFrom() [5/10]
|
inlinestatic |
Definition at line 370 of file MPIndicatorConstraint.java.
◆ parseFrom() [6/10]
|
inlinestatic |
Definition at line 376 of file MPIndicatorConstraint.java.
◆ parseFrom() [7/10]
|
inlinestatic |
Definition at line 346 of file MPIndicatorConstraint.java.
◆ parseFrom() [8/10]
|
inlinestatic |
Definition at line 351 of file MPIndicatorConstraint.java.
◆ parseFrom() [9/10]
|
inlinestatic |
Definition at line 314 of file MPIndicatorConstraint.java.
◆ parseFrom() [10/10]
|
inlinestatic |
Definition at line 319 of file MPIndicatorConstraint.java.
◆ parser()
|
inlinestatic |
Definition at line 901 of file MPIndicatorConstraint.java.
◆ toBuilder()
|
inline |
Definition at line 393 of file MPIndicatorConstraint.java.
◆ writeTo()
|
inline |
Definition at line 224 of file MPIndicatorConstraint.java.
Member Data Documentation
◆ CONSTRAINT_FIELD_NUMBER
|
static |
Definition at line 174 of file MPIndicatorConstraint.java.
◆ PARSER
|
static |
Definition at line 891 of file MPIndicatorConstraint.java.
◆ VAR_INDEX_FIELD_NUMBER
|
static |
Definition at line 118 of file MPIndicatorConstraint.java.
◆ VAR_VALUE_FIELD_NUMBER
|
static |
Definition at line 147 of file MPIndicatorConstraint.java.
The documentation for this class was generated from the following file: