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 417 of file MPIndicatorConstraint.java.
Public Member Functions | |
| .lang.Override Builder | clear () |
| .lang.Override com.google.protobuf.Descriptors.Descriptor | getDescriptorForType () |
| .lang.Override com.google.ortools.linearsolver.MPIndicatorConstraint | getDefaultInstanceForType () |
| .lang.Override com.google.ortools.linearsolver.MPIndicatorConstraint | build () |
| .lang.Override com.google.ortools.linearsolver.MPIndicatorConstraint | buildPartial () |
| .lang.Override Builder | clone () |
| .lang.Override Builder | setField (com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) |
| .lang.Override Builder | clearField (com.google.protobuf.Descriptors.FieldDescriptor field) |
| .lang.Override Builder | clearOneof (com.google.protobuf.Descriptors.OneofDescriptor oneof) |
| .lang.Override Builder | setRepeatedField (com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) |
| .lang.Override Builder | addRepeatedField (com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) |
| .lang.Override Builder | mergeFrom (com.google.protobuf.Message other) |
| Builder | mergeFrom (com.google.ortools.linearsolver.MPIndicatorConstraint other) |
| .lang.Override final boolean | isInitialized () |
| .lang.Override Builder | mergeFrom (com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException |
| .lang.Override boolean | hasVarIndex () |
| .lang.Override int | getVarIndex () |
| Builder | setVarIndex (int value) |
| Builder | clearVarIndex () |
| .lang.Override boolean | hasVarValue () |
| .lang.Override int | getVarValue () |
| Builder | setVarValue (int value) |
| Builder | clearVarValue () |
| boolean | hasConstraint () |
| com.google.ortools.linearsolver.MPConstraintProto | getConstraint () |
| Builder | setConstraint (com.google.ortools.linearsolver.MPConstraintProto value) |
| Builder | setConstraint (com.google.ortools.linearsolver.MPConstraintProto.Builder builderForValue) |
| Builder | mergeConstraint (com.google.ortools.linearsolver.MPConstraintProto value) |
| Builder | clearConstraint () |
| com.google.ortools.linearsolver.MPConstraintProto.Builder | getConstraintBuilder () |
| com.google.ortools.linearsolver.MPConstraintProtoOrBuilder | getConstraintOrBuilder () |
| .lang.Override final Builder | setUnknownFields (final com.google.protobuf.UnknownFieldSet unknownFields) |
| .lang.Override final Builder | mergeUnknownFields (final com.google.protobuf.UnknownFieldSet unknownFields) |
Static Public Member Functions | |
| static final com.google.protobuf.Descriptors.Descriptor | getDescriptor () |
Protected Member Functions | |
| .lang.Override com.google.protobuf.GeneratedMessageV3.FieldAccessorTable | internalGetFieldAccessorTable () |
Member Function Documentation
◆ addRepeatedField()
|
inline |
Definition at line 539 of file MPIndicatorConstraint.java.
◆ build()
|
inline |
Definition at line 478 of file MPIndicatorConstraint.java.
◆ buildPartial()
|
inline |
Definition at line 487 of file MPIndicatorConstraint.java.
◆ clear()
|
inline |
Definition at line 451 of file MPIndicatorConstraint.java.
◆ clearConstraint()
|
inline |
The constraint activated by the indicator variable.
optional .operations_research.MPConstraintProto constraint = 3;
Definition at line 807 of file MPIndicatorConstraint.java.
◆ clearField()
|
inline |
Definition at line 523 of file MPIndicatorConstraint.java.
◆ clearOneof()
|
inline |
Definition at line 528 of file MPIndicatorConstraint.java.
◆ clearVarIndex()
|
inline |
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.
Definition at line 647 of file MPIndicatorConstraint.java.
◆ clearVarValue()
|
inline |
Value the above variable should take. Must be 0 or 1.
optional int32 var_value = 2;
- Returns
- This builder for chaining.
Definition at line 702 of file MPIndicatorConstraint.java.
◆ clone()
|
inline |
Definition at line 513 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 731 of file MPIndicatorConstraint.java.
◆ getConstraintBuilder()
|
inline |
The constraint activated by the indicator variable.
optional .operations_research.MPConstraintProto constraint = 3;
Definition at line 824 of file MPIndicatorConstraint.java.
◆ getConstraintOrBuilder()
|
inline |
The constraint activated by the indicator variable.
optional .operations_research.MPConstraintProto constraint = 3;
Implements MPIndicatorConstraintOrBuilder.
Definition at line 836 of file MPIndicatorConstraint.java.
◆ getDefaultInstanceForType()
|
inline |
Definition at line 473 of file MPIndicatorConstraint.java.
◆ getDescriptor()
|
inlinestatic |
Definition at line 422 of file MPIndicatorConstraint.java.
◆ getDescriptorForType()
|
inline |
Definition at line 468 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 619 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 676 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 720 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 606 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 664 of file MPIndicatorConstraint.java.
◆ internalGetFieldAccessorTable()
|
inlineprotected |
Definition at line 428 of file MPIndicatorConstraint.java.
◆ isInitialized()
|
inline |
Definition at line 571 of file MPIndicatorConstraint.java.
◆ mergeConstraint()
|
inline |
The constraint activated by the indicator variable.
optional .operations_research.MPConstraintProto constraint = 3;
Definition at line 783 of file MPIndicatorConstraint.java.
◆ mergeFrom() [1/3]
|
inline |
Definition at line 554 of file MPIndicatorConstraint.java.
◆ mergeFrom() [2/3]
|
inline |
Definition at line 576 of file MPIndicatorConstraint.java.
◆ mergeFrom() [3/3]
|
inline |
Definition at line 545 of file MPIndicatorConstraint.java.
◆ mergeUnknownFields()
|
inline |
Definition at line 871 of file MPIndicatorConstraint.java.
◆ setConstraint() [1/2]
|
inline |
The constraint activated by the indicator variable.
optional .operations_research.MPConstraintProto constraint = 3;
Definition at line 745 of file MPIndicatorConstraint.java.
◆ setConstraint() [2/2]
|
inline |
The constraint activated by the indicator variable.
optional .operations_research.MPConstraintProto constraint = 3;
Definition at line 765 of file MPIndicatorConstraint.java.
◆ setField()
|
inline |
Definition at line 517 of file MPIndicatorConstraint.java.
◆ setRepeatedField()
|
inline |
Definition at line 533 of file MPIndicatorConstraint.java.
◆ setUnknownFields()
|
inline |
Definition at line 865 of file MPIndicatorConstraint.java.
◆ setVarIndex()
|
inline |
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.
Definition at line 632 of file MPIndicatorConstraint.java.
◆ setVarValue()
|
inline |
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.
Definition at line 688 of file MPIndicatorConstraint.java.
The documentation for this class was generated from the following file: