Java Reference

Java Reference

Detailed Description

Specialized assignment constraint.

This constraint allows adding tuples to the allowed/forbidden assignment constraint incrementally.

Definition at line 25 of file TableConstraint.java.

Public Member Functions

 TableConstraint (CpModelProto.Builder builder)
 
TableConstraint addTuple (int[] tuple)
 Adds a tuple of possible/forbidden values to the constraint. More...
 
TableConstraint addTuple (long[] tuple)
 Adds a tuple of possible/forbidden values to the constraint. More...
 
TableConstraint addTuples (int[][] tuples)
 Adds a list of tuples of possible/forbidden values to the constraint. More...
 
TableConstraint addTuples (long[][] tuples)
 Adds a list of tuples of possible/forbidden values to the constraint. More...
 
void onlyEnforceIf (Literal lit)
 Adds a literal to the constraint. More...
 
void onlyEnforceIf (Literal[] lits)
 Adds a list of literals to the constraint. More...
 
int getIndex ()
 Returns the index of the constraint in the model. More...
 
ConstraintProto.Builder getBuilder ()
 Returns the constraint builder. More...
 

Constructor & Destructor Documentation

◆ TableConstraint()

TableConstraint ( CpModelProto.Builder  builder)

Definition at line 26 of file TableConstraint.java.

Member Function Documentation

◆ addTuple() [1/2]

TableConstraint addTuple ( int[]  tuple)

Adds a tuple of possible/forbidden values to the constraint.

Parameters
tuplethe tuple to add to the constraint.
Exceptions
CpModel.WrongLengthif the tuple does not have the same length as the array of variables of the constraint.

Definition at line 37 of file TableConstraint.java.

◆ addTuple() [2/2]

TableConstraint addTuple ( long[]  tuple)

Adds a tuple of possible/forbidden values to the constraint.

Parameters
tuplethe tuple to add to the constraint.
Exceptions
CpModel.WrongLengthif the tuple does not have the same length as the array of variables of the constraint.

Definition at line 56 of file TableConstraint.java.

◆ addTuples() [1/2]

TableConstraint addTuples ( int  tuples[][])

Adds a list of tuples of possible/forbidden values to the constraint.

Parameters
tuplesthe list of tuples to add to the constraint.
Exceptions
CpModel.WrongLengthif one tuple does not have the same length as the array of variables of the constraint.

Definition at line 75 of file TableConstraint.java.

◆ addTuples() [2/2]

TableConstraint addTuples ( long  tuples[][])

Adds a list of tuples of possible/forbidden values to the constraint.

Parameters
tuplesthe list of tuples to add to the constraint.
Exceptions
CpModel.WrongLengthif one tuple does not have the same length as the array of variables of the constraint.

Definition at line 96 of file TableConstraint.java.

◆ getBuilder()

ConstraintProto.Builder getBuilder ( )
inherited

Returns the constraint builder.

Definition at line 49 of file Constraint.java.

◆ getIndex()

int getIndex ( )
inherited

Returns the index of the constraint in the model.

Definition at line 44 of file Constraint.java.

◆ onlyEnforceIf() [1/2]

void onlyEnforceIf ( Literal  lit)
inherited

Adds a literal to the constraint.

Definition at line 32 of file Constraint.java.

◆ onlyEnforceIf() [2/2]

void onlyEnforceIf ( Literal[]  lits)
inherited

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 file: