Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
OperationsResearch.MPIndicatorConstraint Class Referencesealed

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. More...

Inheritance diagram for OperationsResearch.MPIndicatorConstraint:

Public Member Functions

 MPIndicatorConstraint ()
 
 MPIndicatorConstraint (MPIndicatorConstraint other)
 
MPIndicatorConstraint Clone ()
 
void ClearVarIndex ()
 Clears the value of the "var_index" field.
 
void ClearVarValue ()
 Clears the value of the "var_value" field.
 
override bool Equals (object other)
 
bool Equals (MPIndicatorConstraint other)
 
override int GetHashCode ()
 
override string ToString ()
 
void WriteTo (pb::CodedOutputStream output)
 
int CalculateSize ()
 
void MergeFrom (MPIndicatorConstraint other)
 
void MergeFrom (pb::CodedInputStream input)
 

Static Public Attributes

const int VarIndexFieldNumber = 1
 Field number for the "var_index" field.
 
const int VarValueFieldNumber = 2
 Field number for the "var_value" field.
 
const int ConstraintFieldNumber = 3
 Field number for the "constraint" field.
 

Properties

static pb::MessageParser< MPIndicatorConstraintParser [get]
 
static pbr::MessageDescriptor Descriptor [get]
 
int VarIndex [get, set]
 Variable index (w.r.t. the "variable" field of MPModelProto) of the Boolean variable used as indicator.
 
bool HasVarIndex [get]
 Gets whether the "var_index" field is set.
 
int VarValue [get, set]
 Value the above variable should take. Must be 0 or 1.
 
bool HasVarValue [get]
 Gets whether the "var_value" field is set.
 
global::OperationsResearch.MPConstraintProto Constraint [get, set]
 The constraint activated by the indicator variable.
 

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.

Definition at line 1923 of file LinearSolver.pb.cs.

Constructor & Destructor Documentation

◆ MPIndicatorConstraint() [1/2]

OperationsResearch.MPIndicatorConstraint.MPIndicatorConstraint ( )
inline

Definition at line 1949 of file LinearSolver.pb.cs.

◆ MPIndicatorConstraint() [2/2]

OperationsResearch.MPIndicatorConstraint.MPIndicatorConstraint ( MPIndicatorConstraint other)
inline

Definition at line 1957 of file LinearSolver.pb.cs.

Member Function Documentation

◆ CalculateSize()

int OperationsResearch.MPIndicatorConstraint.CalculateSize ( )
inline

Definition at line 2135 of file LinearSolver.pb.cs.

◆ ClearVarIndex()

void OperationsResearch.MPIndicatorConstraint.ClearVarIndex ( )
inline

Clears the value of the "var_index" field.

Definition at line 1998 of file LinearSolver.pb.cs.

◆ ClearVarValue()

void OperationsResearch.MPIndicatorConstraint.ClearVarValue ( )
inline

Clears the value of the "var_value" field.

Definition at line 2028 of file LinearSolver.pb.cs.

◆ Clone()

MPIndicatorConstraint OperationsResearch.MPIndicatorConstraint.Clone ( )
inline

Definition at line 1967 of file LinearSolver.pb.cs.

◆ Equals() [1/2]

bool OperationsResearch.MPIndicatorConstraint.Equals ( MPIndicatorConstraint other)
inline

Definition at line 2055 of file LinearSolver.pb.cs.

◆ Equals() [2/2]

override bool OperationsResearch.MPIndicatorConstraint.Equals ( object other)
inline

Definition at line 2049 of file LinearSolver.pb.cs.

◆ GetHashCode()

override int OperationsResearch.MPIndicatorConstraint.GetHashCode ( )
inline

Definition at line 2070 of file LinearSolver.pb.cs.

◆ MergeFrom() [1/2]

void OperationsResearch.MPIndicatorConstraint.MergeFrom ( MPIndicatorConstraint other)
inline

Definition at line 2154 of file LinearSolver.pb.cs.

◆ MergeFrom() [2/2]

void OperationsResearch.MPIndicatorConstraint.MergeFrom ( pb.CodedInputStream input)
inline

Definition at line 2175 of file LinearSolver.pb.cs.

◆ ToString()

override string OperationsResearch.MPIndicatorConstraint.ToString ( )
inline

Definition at line 2083 of file LinearSolver.pb.cs.

◆ WriteTo()

void OperationsResearch.MPIndicatorConstraint.WriteTo ( pb.CodedOutputStream output)
inline

Definition at line 2089 of file LinearSolver.pb.cs.

Member Data Documentation

◆ ConstraintFieldNumber

const int OperationsResearch.MPIndicatorConstraint.ConstraintFieldNumber = 3
static

Field number for the "constraint" field.

Definition at line 2033 of file LinearSolver.pb.cs.

◆ VarIndexFieldNumber

const int OperationsResearch.MPIndicatorConstraint.VarIndexFieldNumber = 1
static

Field number for the "var_index" field.

Definition at line 1972 of file LinearSolver.pb.cs.

◆ VarValueFieldNumber

const int OperationsResearch.MPIndicatorConstraint.VarValueFieldNumber = 2
static

Field number for the "var_value" field.

Definition at line 2003 of file LinearSolver.pb.cs.

Property Documentation

◆ Constraint

global.OperationsResearch.MPConstraintProto OperationsResearch.MPIndicatorConstraint.Constraint
getset

The constraint activated by the indicator variable.

Definition at line 2040 of file LinearSolver.pb.cs.

◆ Descriptor

pbr.MessageDescriptor OperationsResearch.MPIndicatorConstraint.Descriptor
staticget

Definition at line 1937 of file LinearSolver.pb.cs.

◆ HasVarIndex

bool OperationsResearch.MPIndicatorConstraint.HasVarIndex
get

Gets whether the "var_index" field is set.

Definition at line 1992 of file LinearSolver.pb.cs.

◆ HasVarValue

bool OperationsResearch.MPIndicatorConstraint.HasVarValue
get

Gets whether the "var_value" field is set.

Definition at line 2022 of file LinearSolver.pb.cs.

◆ Parser

pb.MessageParser<MPIndicatorConstraint> OperationsResearch.MPIndicatorConstraint.Parser
staticget

Definition at line 1933 of file LinearSolver.pb.cs.

◆ VarIndex

int OperationsResearch.MPIndicatorConstraint.VarIndex
getset

Variable index (w.r.t. the "variable" field of MPModelProto) of the Boolean variable used as indicator.

Definition at line 1982 of file LinearSolver.pb.cs.

◆ VarValue

int OperationsResearch.MPIndicatorConstraint.VarValue
getset

Value the above variable should take. Must be 0 or 1.

Definition at line 2012 of file LinearSolver.pb.cs.


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