Google OR-Tools v9.14
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
com.google.ortools.linearsolver.MPIndicatorConstraint Class 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 operations_research.MPIndicatorConstraint

Definition at line 22 of file MPIndicatorConstraint.java.

Inheritance diagram for com.google.ortools.linearsolver.MPIndicatorConstraint:
com.google.ortools.linearsolver.MPIndicatorConstraintOrBuilder

Classes

class  Builder

Public Member Functions

boolean hasVarIndex ()
int getVarIndex ()
boolean hasVarValue ()
int getVarValue ()
boolean hasConstraint ()
com.google.ortools.linearsolver.MPConstraintProto getConstraint ()
com.google.ortools.linearsolver.MPConstraintProtoOrBuilder getConstraintOrBuilder ()
final boolean isInitialized ()
void writeTo (com.google.protobuf.CodedOutputStream output) throws java.io.IOException
int getSerializedSize ()
boolean equals (final java.lang.Object obj)
int hashCode ()
Builder newBuilderForType ()
Builder toBuilder ()
com.google.protobuf.Parser< MPIndicatorConstraintgetParserForType ()
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< MPIndicatorConstraintparser ()

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

Protected Member Functions

com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable ()
Builder newBuilderForType (com.google.protobuf.GeneratedMessage.BuilderParent parent)

Member Function Documentation

◆ equals()

boolean com.google.ortools.linearsolver.MPIndicatorConstraint.equals ( final java.lang.Object obj)

Definition at line 201 of file MPIndicatorConstraint.java.

◆ getConstraint()

com.google.ortools.linearsolver.MPConstraintProto com.google.ortools.linearsolver.MPIndicatorConstraint.getConstraint ( )
The constraint activated by the indicator variable.

optional .operations_research.MPConstraintProto constraint = 3;

Returns
The constraint.

Implements com.google.ortools.linearsolver.MPIndicatorConstraintOrBuilder.

Definition at line 136 of file MPIndicatorConstraint.java.

◆ getConstraintOrBuilder()

com.google.ortools.linearsolver.MPConstraintProtoOrBuilder com.google.ortools.linearsolver.MPIndicatorConstraint.getConstraintOrBuilder ( )
The constraint activated by the indicator variable.

optional .operations_research.MPConstraintProto constraint = 3;

Implements com.google.ortools.linearsolver.MPIndicatorConstraintOrBuilder.

Definition at line 147 of file MPIndicatorConstraint.java.

◆ getDefaultInstance()

com.google.ortools.linearsolver.MPIndicatorConstraint com.google.ortools.linearsolver.MPIndicatorConstraint.getDefaultInstance ( )
static

Definition at line 816 of file MPIndicatorConstraint.java.

◆ getDefaultInstanceForType()

com.google.ortools.linearsolver.MPIndicatorConstraint com.google.ortools.linearsolver.MPIndicatorConstraint.getDefaultInstanceForType ( )

Definition at line 852 of file MPIndicatorConstraint.java.

◆ getDescriptor()

final com.google.protobuf.Descriptors.Descriptor com.google.ortools.linearsolver.MPIndicatorConstraint.getDescriptor ( )
static

Definition at line 44 of file MPIndicatorConstraint.java.

◆ getParserForType()

com.google.protobuf.Parser< MPIndicatorConstraint > com.google.ortools.linearsolver.MPIndicatorConstraint.getParserForType ( )

Definition at line 847 of file MPIndicatorConstraint.java.

◆ getSerializedSize()

int com.google.ortools.linearsolver.MPIndicatorConstraint.getSerializedSize ( )

Definition at line 178 of file MPIndicatorConstraint.java.

◆ getVarIndex()

int com.google.ortools.linearsolver.MPIndicatorConstraint.getVarIndex ( )
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 com.google.ortools.linearsolver.MPIndicatorConstraintOrBuilder.

Definition at line 82 of file MPIndicatorConstraint.java.

◆ getVarValue()

int com.google.ortools.linearsolver.MPIndicatorConstraint.getVarValue ( )
Value the above variable should take. Must be 0 or 1.

optional int32 var_value = 2;

Returns
The varValue.

Implements com.google.ortools.linearsolver.MPIndicatorConstraintOrBuilder.

Definition at line 109 of file MPIndicatorConstraint.java.

◆ hasConstraint()

boolean com.google.ortools.linearsolver.MPIndicatorConstraint.hasConstraint ( )
The constraint activated by the indicator variable.

optional .operations_research.MPConstraintProto constraint = 3;

Returns
Whether the constraint field is set.

Implements com.google.ortools.linearsolver.MPIndicatorConstraintOrBuilder.

Definition at line 124 of file MPIndicatorConstraint.java.

◆ hashCode()

int com.google.ortools.linearsolver.MPIndicatorConstraint.hashCode ( )

Definition at line 230 of file MPIndicatorConstraint.java.

◆ hasVarIndex()

boolean com.google.ortools.linearsolver.MPIndicatorConstraint.hasVarIndex ( )
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 com.google.ortools.linearsolver.MPIndicatorConstraintOrBuilder.

Definition at line 69 of file MPIndicatorConstraint.java.

◆ hasVarValue()

boolean com.google.ortools.linearsolver.MPIndicatorConstraint.hasVarValue ( )
Value the above variable should take. Must be 0 or 1.

optional int32 var_value = 2;

Returns
Whether the varValue field is set.

Implements com.google.ortools.linearsolver.MPIndicatorConstraintOrBuilder.

Definition at line 97 of file MPIndicatorConstraint.java.

◆ internalGetFieldAccessorTable()

com.google.protobuf.GeneratedMessage.FieldAccessorTable com.google.ortools.linearsolver.MPIndicatorConstraint.internalGetFieldAccessorTable ( )
protected

Definition at line 50 of file MPIndicatorConstraint.java.

◆ isInitialized()

final boolean com.google.ortools.linearsolver.MPIndicatorConstraint.isInitialized ( )

Definition at line 153 of file MPIndicatorConstraint.java.

◆ newBuilder() [1/2]

Builder com.google.ortools.linearsolver.MPIndicatorConstraint.newBuilder ( )
static

Definition at line 327 of file MPIndicatorConstraint.java.

◆ newBuilder() [2/2]

Builder com.google.ortools.linearsolver.MPIndicatorConstraint.newBuilder ( com.google.ortools.linearsolver.MPIndicatorConstraint prototype)
static

Definition at line 330 of file MPIndicatorConstraint.java.

◆ newBuilderForType() [1/2]

Builder com.google.ortools.linearsolver.MPIndicatorConstraint.newBuilderForType ( )

Definition at line 326 of file MPIndicatorConstraint.java.

◆ newBuilderForType() [2/2]

Builder com.google.ortools.linearsolver.MPIndicatorConstraint.newBuilderForType ( com.google.protobuf.GeneratedMessage.BuilderParent parent)
protected

Definition at line 340 of file MPIndicatorConstraint.java.

◆ parseDelimitedFrom() [1/2]

com.google.ortools.linearsolver.MPIndicatorConstraint com.google.ortools.linearsolver.MPIndicatorConstraint.parseDelimitedFrom ( java.io.InputStream input) throws java.io.IOException
static

Definition at line 298 of file MPIndicatorConstraint.java.

◆ parseDelimitedFrom() [2/2]

com.google.ortools.linearsolver.MPIndicatorConstraint com.google.ortools.linearsolver.MPIndicatorConstraint.parseDelimitedFrom ( java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry ) throws java.io.IOException
static

Definition at line 304 of file MPIndicatorConstraint.java.

◆ parseFrom() [1/10]

com.google.ortools.linearsolver.MPIndicatorConstraint com.google.ortools.linearsolver.MPIndicatorConstraint.parseFrom ( byte[] data) throws com.google.protobuf.InvalidProtocolBufferException
static

Definition at line 275 of file MPIndicatorConstraint.java.

◆ parseFrom() [2/10]

com.google.ortools.linearsolver.MPIndicatorConstraint com.google.ortools.linearsolver.MPIndicatorConstraint.parseFrom ( byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry ) throws com.google.protobuf.InvalidProtocolBufferException
static

Definition at line 279 of file MPIndicatorConstraint.java.

◆ parseFrom() [3/10]

com.google.ortools.linearsolver.MPIndicatorConstraint com.google.ortools.linearsolver.MPIndicatorConstraint.parseFrom ( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException
static

Definition at line 264 of file MPIndicatorConstraint.java.

◆ parseFrom() [4/10]

com.google.ortools.linearsolver.MPIndicatorConstraint com.google.ortools.linearsolver.MPIndicatorConstraint.parseFrom ( com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry ) throws com.google.protobuf.InvalidProtocolBufferException
static

Definition at line 269 of file MPIndicatorConstraint.java.

◆ parseFrom() [5/10]

com.google.ortools.linearsolver.MPIndicatorConstraint com.google.ortools.linearsolver.MPIndicatorConstraint.parseFrom ( com.google.protobuf.CodedInputStream input) throws java.io.IOException
static

Definition at line 311 of file MPIndicatorConstraint.java.

◆ parseFrom() [6/10]

com.google.ortools.linearsolver.MPIndicatorConstraint com.google.ortools.linearsolver.MPIndicatorConstraint.parseFrom ( com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry ) throws java.io.IOException
static

Definition at line 317 of file MPIndicatorConstraint.java.

◆ parseFrom() [7/10]

com.google.ortools.linearsolver.MPIndicatorConstraint com.google.ortools.linearsolver.MPIndicatorConstraint.parseFrom ( java.io.InputStream input) throws java.io.IOException
static

Definition at line 285 of file MPIndicatorConstraint.java.

◆ parseFrom() [8/10]

com.google.ortools.linearsolver.MPIndicatorConstraint com.google.ortools.linearsolver.MPIndicatorConstraint.parseFrom ( java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry ) throws java.io.IOException
static

Definition at line 290 of file MPIndicatorConstraint.java.

◆ parseFrom() [9/10]

com.google.ortools.linearsolver.MPIndicatorConstraint com.google.ortools.linearsolver.MPIndicatorConstraint.parseFrom ( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException
static

Definition at line 253 of file MPIndicatorConstraint.java.

◆ parseFrom() [10/10]

com.google.ortools.linearsolver.MPIndicatorConstraint com.google.ortools.linearsolver.MPIndicatorConstraint.parseFrom ( java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry ) throws com.google.protobuf.InvalidProtocolBufferException
static

Definition at line 258 of file MPIndicatorConstraint.java.

◆ parser()

com.google.protobuf.Parser< MPIndicatorConstraint > com.google.ortools.linearsolver.MPIndicatorConstraint.parser ( )
static

Definition at line 842 of file MPIndicatorConstraint.java.

◆ toBuilder()

Builder com.google.ortools.linearsolver.MPIndicatorConstraint.toBuilder ( )

Definition at line 334 of file MPIndicatorConstraint.java.

◆ writeTo()

void com.google.ortools.linearsolver.MPIndicatorConstraint.writeTo ( com.google.protobuf.CodedOutputStream output) throws java.io.IOException

Definition at line 163 of file MPIndicatorConstraint.java.

Member Data Documentation

◆ CONSTRAINT_FIELD_NUMBER

final int com.google.ortools.linearsolver.MPIndicatorConstraint.CONSTRAINT_FIELD_NUMBER = 3
static

Definition at line 113 of file MPIndicatorConstraint.java.

◆ VAR_INDEX_FIELD_NUMBER

final int com.google.ortools.linearsolver.MPIndicatorConstraint.VAR_INDEX_FIELD_NUMBER = 1
static

Definition at line 57 of file MPIndicatorConstraint.java.

◆ VAR_VALUE_FIELD_NUMBER

final int com.google.ortools.linearsolver.MPIndicatorConstraint.VAR_VALUE_FIELD_NUMBER = 2
static

Definition at line 86 of file MPIndicatorConstraint.java.


The documentation for this class was generated from the following file: