Package com.artelys.kalis
Class KDisjunction
- java.lang.Object
-
- com.artelys.kalis.KConstraint
-
- com.artelys.kalis.KDisjunction
-
public class KDisjunction extends KConstraint
This class creates a Binary disjunction on two constraints `C1 or C2`
Example :
// C1 C2 C1 \/ C2 // ------------------------ // false false false // false true true // true false true // true true true KIntVar START(...); ... problem.post(START + 10 < 4 || START + 10 >= 4); // or problem.post(KDisjunction(START + 10 < 4,START + 10 >= 4));
- Since:
- 2016.1
- See Also:
KConstraint
-
-
Field Summary
-
Fields inherited from class com.artelys.kalis.KConstraint
swigCMemOwn
-
-
Constructor Summary
Constructors Modifier Constructor Description KDisjunction()
protected
KDisjunction(long cPtr, boolean cMemoryOwn)
KDisjunction(KConstraint c1, KConstraint c2)
Primary constructor
KDisjunction(KDisjunction toCopy)
Copy constructorKDisjunction(KProblem problem)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
delete()
protected void
finalize()
int
getActiveBranch()
protected static long
getCPtr(KDisjunction obj)
java.lang.String
getName()
int
getPrefferedBranch()
int
getRessource()
int
getTypeInfo()
boolean
knownStatus()
Return the known status
Known status is true if status of disjunction is proven at current point
of the branch and bound, false if unknown.void
setConstraint_I_ptr(com.artelys.kalis.SWIGTYPE_p_void ptr)
void
setPrefferedBranch(int branch)
void
setRessource(int ressource)
void
setStatus(int branchNumber, boolean status)
Fix status of one part of the disjunction
-
Methods inherited from class com.artelys.kalis.KConstraint
askIfEntailed, getArity, getCopyPtr, getCPtr, getInstance, getInstanceCopyPtr, getLinearRelaxation, getLinearRelaxation, getPriority, getProblem, getTag, isGetLinearRelaxationImplemented, print, print, setName, setPriority, setTag
-
-
-
-
Constructor Detail
-
KDisjunction
protected KDisjunction(long cPtr, boolean cMemoryOwn)
-
KDisjunction
public KDisjunction()
-
KDisjunction
public KDisjunction(KConstraint c1, KConstraint c2)
Primary constructor
- Parameters:
c1
- the first constraint of the disjunction c1 or c2c2
- the second constraint of the disjunction c1 or c2
-
KDisjunction
public KDisjunction(KDisjunction toCopy)
Copy constructor
-
KDisjunction
public KDisjunction(KProblem problem)
-
-
Method Detail
-
getCPtr
protected static long getCPtr(KDisjunction obj)
-
finalize
protected void finalize()
- Overrides:
finalize
in classKConstraint
-
delete
public void delete()
- Overrides:
delete
in classKConstraint
-
knownStatus
public boolean knownStatus()
Return the known status
Known status is true if status of disjunction is proven at current point
of the branch and bound, false if unknown.
-
setStatus
public void setStatus(int branchNumber, boolean status)
Fix status of one part of the disjunction
- Parameters:
branchNumber
- 0 for c1, 1 for c2status
- true if corresponding constraint must be true
-
setConstraint_I_ptr
public void setConstraint_I_ptr(com.artelys.kalis.SWIGTYPE_p_void ptr)
-
setPrefferedBranch
public void setPrefferedBranch(int branch)
-
getPrefferedBranch
public int getPrefferedBranch()
-
getActiveBranch
public int getActiveBranch()
-
setRessource
public void setRessource(int ressource)
-
getRessource
public int getRessource()
-
getTypeInfo
public int getTypeInfo()
- Overrides:
getTypeInfo
in classKConstraint
-
getName
public java.lang.String getName()
- Overrides:
getName
in classKConstraint
-
-