Class TableConstraint


  • public class TableConstraint
    extends Constraint
    Specialized assignment constraint.

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

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