|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectchoco.AbstractEntity
choco.AbstractConstraint
choco.integer.constraints.AbstractIntConstraint
choco.integer.constraints.AbstractBinIntConstraint
public abstract class AbstractBinIntConstraint
An abstract class for all implementations of (binary) constraints over two search variable.
| Field Summary | |
|---|---|
int |
cIdx0
The index of the constraint among all listeners of its first variable. |
int |
cIdx1
The index of the constraint among all listeners of its second variable. |
IntDomainVar |
v0
The first variable of the constraint. |
IntDomainVar |
v1
The second variable of the constraint. |
| Fields inherited from class choco.integer.constraints.AbstractIntConstraint |
|---|
logger |
| Fields inherited from class choco.AbstractConstraint |
|---|
active, constAwakeEvent, hook, priority |
| Fields inherited from class choco.AbstractEntity |
|---|
problem |
| Constructor Summary | |
|---|---|
AbstractBinIntConstraint(IntDomainVar x0,
IntDomainVar x1)
|
|
| Method Summary | |
|---|---|
int |
assignIndices(AbstractCompositeConstraint root,
int i,
boolean dynamicAddition)
performs the global numbering (wrt root) of the variables contained in the subtree this, starting from i |
int |
getConstraintIdx(int idx)
Returns the index of this constraint for the specified variables. |
IntDomainVar |
getIntVar(int i)
Gets the ith search valued variable. |
int |
getNbVars()
Returns the number of varibles. |
Var |
getVar(int i)
Returns the specified variable. |
boolean |
isCompletelyInstantiated()
Checks if all the variables are instantiated. |
void |
propagate()
Propagates on the constraint awake events. |
void |
setConstraintIndex(int i,
int val)
Let v be the i-th var of c, records that c is the n-th constraint involving v. |
void |
setVar(int i,
Var v)
Network management: Setting (or overwriting) the ith variable of a constraint. |
| Methods inherited from class choco.integer.constraints.AbstractIntConstraint |
|---|
awakeOnBounds, awakeOnInf, awakeOnInst, awakeOnRem, awakeOnRemovals, awakeOnSup, getSelfIndex, isConsistent |
| Methods inherited from class choco.AbstractConstraint |
|---|
addListener, awake, awakeOnVar, clone, connectVar, constAwake, delete, fail, getEvent, getPlugIn, getPriority, getProblem, getVarIdxInOpposite, isActive, isEntailed, isEquivalentTo, opposite, setActive, setEntailed, setPassive, setPlugIn, substituteVar |
| Methods inherited from class choco.AbstractEntity |
|---|
pretty |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface choco.Propagator |
|---|
awake, awakeOnVar, constAwake, delete, getEvent, getPlugIn, getPriority, isEntailed |
| Methods inherited from interface choco.prop.VarEventListener |
|---|
addListener, isActive, setActive, setPassive |
| Methods inherited from interface choco.prop.VarEventListener |
|---|
addListener, isActive, setActive, setPassive |
| Field Detail |
|---|
public IntDomainVar v0
public IntDomainVar v1
public int cIdx0
public int cIdx1
| Constructor Detail |
|---|
public AbstractBinIntConstraint(IntDomainVar x0,
IntDomainVar x1)
| Method Detail |
|---|
public void setConstraintIndex(int i,
int val)
i - index of the variable in the constraintval - index of the constraint in the among all listeners linked to that variablepublic int getConstraintIdx(int idx)
idx - index of the variable in the constraintpublic boolean isCompletelyInstantiated()
isCompletelyInstantiated in interface PropagatorisCompletelyInstantiated in class AbstractIntConstraintpublic int getNbVars()
public Var getVar(int i)
i - index of the variable in the constraint
public void setVar(int i,
Var v)
Constraint
i - index of the variable in the constraintv - the variable (may be an IntDomainVar, SetVar, RealVar, ...
public void propagate()
throws ContradictionException
ContradictionExceptionpublic IntDomainVar getIntVar(int i)
ith search valued variable.
i - index of the variable among all search variables in the constraint. Numbering start from 0 on.
public int assignIndices(AbstractCompositeConstraint root,
int i,
boolean dynamicAddition)
Propagator
root - the overall root constraint, for which the variables are numberedi - the index that will assigned to the first variable in the subtree this (originally 0)dynamicAddition - whether the addition is undone automatically on backtracking
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||