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
-
tuple the tuple to add to the constraint.
- Exceptions
-
CpModel.WrongLength if 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
-
tuple the tuple to add to the constraint.
- Exceptions
-
CpModel.WrongLength if 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
-
tuples the list of tuples to add to the constraint.
- Exceptions
-
CpModel.WrongLength if 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
-
tuples the list of tuples to add to the constraint.
- Exceptions
-
CpModel.WrongLength if 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()
|
inherited |
Returns the constraint builder.
Definition at line 49 of file Constraint.java.
◆ getIndex()
|
inherited |
Returns the index of the constraint in the model.
Definition at line 44 of file Constraint.java.
◆ onlyEnforceIf() [1/2]
|
inherited |
Adds a literal to the constraint.
Definition at line 32 of file Constraint.java.
◆ onlyEnforceIf() [2/2]
|
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: