|
|||||||||
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.AbstractTernIntConstraint
public abstract class AbstractTernIntConstraint
An abstract class for all implementations of (unary) listeners over one search variable.
Field Summary | |
---|---|
protected int |
cIdx0
The index of the constraint among all listeners of its first variable. |
protected int |
cIdx1
The index of the constraint among all listeners of its second variable. |
protected int |
cIdx2
The index of the constraint among all listeners of its third variable. |
protected IntDomainVar |
v0
The first variable of the constraint. |
protected IntDomainVar |
v1
The second variable of the constraint. |
protected IntDomainVar |
v2
The third 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 | |
---|---|
AbstractTernIntConstraint(IntDomainVar x0,
IntDomainVar x1,
IntDomainVar x2)
Builds a ternary constraint with the specified variables. |
Method Summary | |
---|---|
int |
assignIndices(AbstractCompositeConstraint root,
int i,
boolean dynamicAddition)
Assign indices to variables for this constraint but also for global constraint if this constraint is included in a global boolean meta-constraint. |
int |
getConstraintIdx(int idx)
Returns the index of the constraint in the specified variable. |
IntDomainVar |
getIntVar(int i)
Gets the i th search valued variable. |
int |
getNbVars()
Returns the number of variables. |
Var |
getVar(int i)
Gets the specified variable. |
boolean |
isCompletelyInstantiated()
Checks if all the variables are instantiated. |
void |
propagate()
Propagation for the constraint awake var. |
void |
setConstraintIndex(int i,
int val)
Let v be the i-th var of c, records that c is the constraint n according to v. |
void |
setVar(int i,
Var v)
Sets the association between variable and index of this variable. |
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 |
---|
protected IntDomainVar v0
protected IntDomainVar v1
protected IntDomainVar v2
protected int cIdx0
protected int cIdx1
protected int cIdx2
Constructor Detail |
---|
public AbstractTernIntConstraint(IntDomainVar x0, IntDomainVar x1, IntDomainVar x2)
x0
- the first variablex1
- the second variablex2
- the third variableMethod Detail |
---|
public void setConstraintIndex(int i, int val)
i
- the variable indexval
- the constraint index according to the variablepublic int getConstraintIdx(int idx)
idx
- the variable index
public boolean isCompletelyInstantiated()
isCompletelyInstantiated
in interface Propagator
isCompletelyInstantiated
in class AbstractIntConstraint
public int getNbVars()
public Var getVar(int i)
i
- the variable index
public void setVar(int i, Var v)
i
- the variable indexv
- the variablepublic void propagate() throws ContradictionException
ContradictionException
- if a domain becomes empty or the
filtering algorithm infers a contradictionpublic IntDomainVar getIntVar(int i)
i
th search valued variable.
i
- the variable index
public int assignIndices(AbstractCompositeConstraint root, int i, boolean dynamicAddition)
root
- the global constrainti
- the current available index for the global constraintdynamicAddition
- states if the constraint is definitive
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |