Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
com.google.ortools.sat.Constraint Class Reference
Inheritance diagram for com.google.ortools.sat.Constraint:
com.google.ortools.sat.AutomatonConstraint com.google.ortools.sat.AutomatonConstraint com.google.ortools.sat.CircuitConstraint com.google.ortools.sat.CircuitConstraint com.google.ortools.sat.CumulativeConstraint com.google.ortools.sat.CumulativeConstraint com.google.ortools.sat.MultipleCircuitConstraint com.google.ortools.sat.MultipleCircuitConstraint com.google.ortools.sat.NoOverlap2dConstraint com.google.ortools.sat.NoOverlap2dConstraint com.google.ortools.sat.ReservoirConstraint com.google.ortools.sat.ReservoirConstraint com.google.ortools.sat.TableConstraint com.google.ortools.sat.TableConstraint

Public Member Functions

 Constraint (CpModelProto.Builder builder)
 
void onlyEnforceIf (Literal lit)
 
void onlyEnforceIf (Literal[] lits)
 
int getIndex ()
 
ConstraintProto.Builder getBuilder ()
 
 Constraint (CpModelProto.Builder builder)
 
void onlyEnforceIf (Literal lit)
 
void onlyEnforceIf (Literal[] lits)
 
int getIndex ()
 
ConstraintProto.Builder getBuilder ()
 

Detailed Description

Wrapper around a ConstraintProto.

Constraints created by the CpModel class are automatically added to the model. One needs this class to add an enforcement literal to a constraint.

Definition at line 25 of file Constraint.java.

Constructor & Destructor Documentation

◆ Constraint() [1/2]

com.google.ortools.sat.Constraint.Constraint ( CpModelProto.Builder builder)

Definition at line 26 of file Constraint.java.

◆ Constraint() [2/2]

com.google.ortools.sat.Constraint.Constraint ( CpModelProto.Builder builder)

Definition at line 26 of file Constraint.java.

Member Function Documentation

◆ getBuilder() [1/2]

ConstraintProto.Builder com.google.ortools.sat.Constraint.getBuilder ( )

Returns the constraint builder.

Definition at line 49 of file Constraint.java.

◆ getBuilder() [2/2]

ConstraintProto.Builder com.google.ortools.sat.Constraint.getBuilder ( )

Returns the constraint builder.

Definition at line 49 of file Constraint.java.

◆ getIndex() [1/2]

int com.google.ortools.sat.Constraint.getIndex ( )

Returns the index of the constraint in the model.

Definition at line 44 of file Constraint.java.

◆ getIndex() [2/2]

int com.google.ortools.sat.Constraint.getIndex ( )

Returns the index of the constraint in the model.

Definition at line 44 of file Constraint.java.

◆ onlyEnforceIf() [1/4]

void com.google.ortools.sat.Constraint.onlyEnforceIf ( Literal lit)

Adds a literal to the constraint.

Definition at line 32 of file Constraint.java.

◆ onlyEnforceIf() [2/4]

void com.google.ortools.sat.Constraint.onlyEnforceIf ( Literal lit)

Adds a literal to the constraint.

Definition at line 32 of file Constraint.java.

◆ onlyEnforceIf() [3/4]

void com.google.ortools.sat.Constraint.onlyEnforceIf ( Literal[] lits)

Adds a list of literals to the constraint.

Definition at line 37 of file Constraint.java.

◆ onlyEnforceIf() [4/4]

void com.google.ortools.sat.Constraint.onlyEnforceIf ( Literal[] lits)

Adds a list of literals to the constraint.

Definition at line 37 of file Constraint.java.


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