Java Reference

Java Reference

MPIndicatorConstraint.Builder

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

operations_research.MPIndicatorConstraint

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()

.lang.Override Builder addRepeatedField ( com.google.protobuf.Descriptors.FieldDescriptor  field,
java.lang.Object  value 
)
inline

Definition at line 539 of file MPIndicatorConstraint.java.

◆ build()

Definition at line 478 of file MPIndicatorConstraint.java.

◆ buildPartial()

.lang.Override com.google.ortools.linearsolver.MPIndicatorConstraint buildPartial ( )
inline

Definition at line 487 of file MPIndicatorConstraint.java.

◆ clear()

.lang.Override Builder clear ( )
inline

Definition at line 451 of file MPIndicatorConstraint.java.

◆ clearConstraint()

Builder clearConstraint ( )
inline
The constraint activated by the indicator variable.

optional .operations_research.MPConstraintProto constraint = 3;

Definition at line 807 of file MPIndicatorConstraint.java.

◆ clearField()

.lang.Override Builder clearField ( com.google.protobuf.Descriptors.FieldDescriptor  field)
inline

Definition at line 523 of file MPIndicatorConstraint.java.

◆ clearOneof()

.lang.Override Builder clearOneof ( com.google.protobuf.Descriptors.OneofDescriptor  oneof)
inline

Definition at line 528 of file MPIndicatorConstraint.java.

◆ clearVarIndex()

Builder 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()

Builder 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()

.lang.Override Builder clone ( )
inline

Definition at line 513 of file MPIndicatorConstraint.java.

◆ getConstraint()

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()

The constraint activated by the indicator variable.

optional .operations_research.MPConstraintProto constraint = 3;

Definition at line 824 of file MPIndicatorConstraint.java.

◆ getConstraintOrBuilder()

The constraint activated by the indicator variable.

optional .operations_research.MPConstraintProto constraint = 3;

Implements MPIndicatorConstraintOrBuilder.

Definition at line 836 of file MPIndicatorConstraint.java.

◆ getDefaultInstanceForType()

.lang.Override com.google.ortools.linearsolver.MPIndicatorConstraint getDefaultInstanceForType ( )
inline

Definition at line 473 of file MPIndicatorConstraint.java.

◆ getDescriptor()

static final com.google.protobuf.Descriptors.Descriptor getDescriptor ( )
inlinestatic

Definition at line 422 of file MPIndicatorConstraint.java.

◆ getDescriptorForType()

.lang.Override com.google.protobuf.Descriptors.Descriptor getDescriptorForType ( )
inline

Definition at line 468 of file MPIndicatorConstraint.java.

◆ getVarIndex()

.lang.Override int 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()

.lang.Override int 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()

boolean 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()

.lang.Override boolean 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()

.lang.Override boolean 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()

.lang.Override com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable ( )
inlineprotected

Definition at line 428 of file MPIndicatorConstraint.java.

◆ isInitialized()

.lang.Override final boolean isInitialized ( )
inline

Definition at line 571 of file MPIndicatorConstraint.java.

◆ mergeConstraint()

The constraint activated by the indicator variable.

optional .operations_research.MPConstraintProto constraint = 3;

Definition at line 783 of file MPIndicatorConstraint.java.

◆ mergeFrom() [1/3]

Definition at line 554 of file MPIndicatorConstraint.java.

◆ mergeFrom() [2/3]

.lang.Override Builder mergeFrom ( com.google.protobuf.CodedInputStream  input,
com.google.protobuf.ExtensionRegistryLite  extensionRegistry 
) throws java.io.IOException
inline

Definition at line 576 of file MPIndicatorConstraint.java.

◆ mergeFrom() [3/3]

.lang.Override Builder mergeFrom ( com.google.protobuf.Message  other)
inline

Definition at line 545 of file MPIndicatorConstraint.java.

◆ mergeUnknownFields()

.lang.Override final Builder mergeUnknownFields ( final com.google.protobuf.UnknownFieldSet  unknownFields)
inline

Definition at line 871 of file MPIndicatorConstraint.java.

◆ setConstraint() [1/2]

The constraint activated by the indicator variable.

optional .operations_research.MPConstraintProto constraint = 3;

Definition at line 745 of file MPIndicatorConstraint.java.

◆ setConstraint() [2/2]

Builder setConstraint ( com.google.ortools.linearsolver.MPConstraintProto.Builder  builderForValue)
inline
The constraint activated by the indicator variable.

optional .operations_research.MPConstraintProto constraint = 3;

Definition at line 765 of file MPIndicatorConstraint.java.

◆ setField()

.lang.Override Builder setField ( com.google.protobuf.Descriptors.FieldDescriptor  field,
java.lang.Object  value 
)
inline

Definition at line 517 of file MPIndicatorConstraint.java.

◆ setRepeatedField()

.lang.Override Builder setRepeatedField ( com.google.protobuf.Descriptors.FieldDescriptor  field,
int  index,
java.lang.Object  value 
)
inline

Definition at line 533 of file MPIndicatorConstraint.java.

◆ setUnknownFields()

.lang.Override final Builder setUnknownFields ( final com.google.protobuf.UnknownFieldSet  unknownFields)
inline

Definition at line 865 of file MPIndicatorConstraint.java.

◆ setVarIndex()

Builder setVarIndex ( int  value)
inline
Variable index (w.r.t. the "variable" field of MPModelProto) of the Boolean
variable used as indicator.

optional int32 var_index = 1;

Parameters
valueThe varIndex to set.
Returns
This builder for chaining.

Definition at line 632 of file MPIndicatorConstraint.java.

◆ setVarValue()

Builder setVarValue ( int  value)
inline
Value the above variable should take. Must be 0 or 1.

optional int32 var_value = 2;

Parameters
valueThe 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: