Package com.google.ortools.sat
Class TableConstraint
- java.lang.Object
-
- com.google.ortools.sat.Constraint
-
- com.google.ortools.sat.TableConstraint
-
public class TableConstraint extends Constraint
Specialized assignment constraint.This constraint allows adding tuples to the allowed/forbidden assignment constraint incrementally.
-
-
Constructor Summary
Constructors Constructor Description TableConstraint(CpModelProto.Builder builder)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TableConstraintaddTuple(int[] tuple)Adds a tuple of possible/forbidden values to the constraint.TableConstraintaddTuple(long[] tuple)Adds a tuple of possible/forbidden values to the constraint.TableConstraintaddTuples(int[][] tuples)Adds a list of tuples of possible/forbidden values to the constraint.TableConstraintaddTuples(long[][] tuples)Adds a list of tuples of possible/forbidden values to the constraint.-
Methods inherited from class com.google.ortools.sat.Constraint
getBuilder, getIndex, onlyEnforceIf, onlyEnforceIf
-
-
-
-
Constructor Detail
-
TableConstraint
public TableConstraint(CpModelProto.Builder builder)
-
-
Method Detail
-
addTuple
public TableConstraint addTuple(int[] tuple)
Adds a tuple of possible/forbidden values to the constraint.- Parameters:
tuple- the tuple to add to the constraint.- Throws:
CpModel.WrongLength- if the tuple does not have the same length as the array of variables of the constraint.
-
addTuple
public TableConstraint addTuple(long[] tuple)
Adds a tuple of possible/forbidden values to the constraint.- Parameters:
tuple- the tuple to add to the constraint.- Throws:
CpModel.WrongLength- if the tuple does not have the same length as the array of variables of the constraint.
-
addTuples
public 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.- Throws:
CpModel.WrongLength- if one tuple does not have the same length as the array of variables of the constraint.
-
addTuples
public 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.- Throws:
CpModel.WrongLength- if one tuple does not have the same length as the array of variables of the constraint.
-
-