Class KAllDifferent


  • public class KAllDifferent
    extends KConstraint
    This class creates a X1 <> X2 <> ... <> Xn constraint

    Example :
    
    KIntVarArray X(...);
    // ...
    // Strong propagation
    problem.post(KAllDifferent("allDiff(X)",X,KAllDifferent::GENERALIZED_ARC_CONSISTENCY));
    // Weak propagation
    problem.post(KAllDifferent("allDiff(X)",X,KAllDifferent::FORWARD_CHECKING));
    

    Since:
    2016.1
    See Also:
    KConstraint

    • Constructor Detail

      • KAllDifferent

        protected KAllDifferent​(long cPtr,
                                boolean cMemoryOwn)
      • KAllDifferent

        public KAllDifferent​(java.lang.String name,
                             KIntVarArray vars,
                             int propagationLevel)
        Primary constructor for the all different constraint

        Parameters:
        name - for pretty printing of the constraint
        vars - array of variables that must take different values
        propagationLevel - FORWARD_CHECKING for forward checking propagation
        propagationLevel - BOUND_CONSISTENCY for bound consistency propagation
        propagationLevel - GENERALIZED_ARC_CONSISTENCY for generalized arc consistency propagation
        propagationLevel - USING_GCC for a similar propagation, internally using a Global Cardinality Constraint
      • KAllDifferent

        public KAllDifferent​(java.lang.String name,
                             KIntVarArray vars)
        Primary constructor for the all different constraint

        Parameters:
        name - for pretty printing of the constraint
        vars - array of variables that must take different values



      • KAllDifferent

        public KAllDifferent​(KAllDifferent toCopy)
        Copy constructor