Package com.artelys.kalis
Class KAllDifferent
- java.lang.Object
-
- com.artelys.kalis.KConstraint
-
- com.artelys.kalis.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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
KAllDifferent.PropagationLevel
Differents level of propagation for the constraints
-
Field Summary
-
Fields inherited from class com.artelys.kalis.KConstraint
swigCMemOwn
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
KAllDifferent(long cPtr, boolean cMemoryOwn)
KAllDifferent(KAllDifferent toCopy)
Copy constructorKAllDifferent(java.lang.String name, KIntVarArray vars)
Primary constructor for the all different constraint
KAllDifferent(java.lang.String name, KIntVarArray vars, int propagationLevel)
Primary constructor for the all different constraint
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
delete()
protected void
finalize()
protected static long
getCPtr(KAllDifferent obj)
-
Methods inherited from class com.artelys.kalis.KConstraint
askIfEntailed, getArity, getCopyPtr, getCPtr, getInstance, getInstanceCopyPtr, getLinearRelaxation, getLinearRelaxation, getName, getPriority, getProblem, getTag, getTypeInfo, isGetLinearRelaxationImplemented, print, print, setName, setPriority, setTag
-
-
-
-
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 constraintvars
- array of variables that must take different valuespropagationLevel
- FORWARD_CHECKING for forward checking propagationpropagationLevel
- BOUND_CONSISTENCY for bound consistency propagationpropagationLevel
- GENERALIZED_ARC_CONSISTENCY for generalized arc consistency propagationpropagationLevel
- 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 constraintvars
- array of variables that must take different values
-
KAllDifferent
public KAllDifferent(KAllDifferent toCopy)
Copy constructor
-
-
Method Detail
-
getCPtr
protected static long getCPtr(KAllDifferent obj)
-
finalize
protected void finalize()
- Overrides:
finalize
in classKConstraint
-
delete
public void delete()
- Overrides:
delete
in classKConstraint
-
-