|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectchoco.AbstractEntity
choco.AbstractConstraint
choco.bool.AbstractCompositeConstraint
choco.bool.AbstractBinCompositeConstraint
public abstract class AbstractBinCompositeConstraint
Field Summary | |
---|---|
protected AbstractConstraint |
const0
the first sub-constraint of the composition |
protected AbstractConstraint |
const1
the second sub-constraint of the composition |
protected int |
offset
the number of variables in the first sub-constraint (therefore the offset in the numbering of the variables from the second sub-constraint) |
Fields inherited from class choco.AbstractConstraint |
---|
active, constAwakeEvent, hook, priority |
Fields inherited from class choco.AbstractEntity |
---|
problem |
Constructor Summary | |
---|---|
AbstractBinCompositeConstraint(AbstractConstraint c1,
AbstractConstraint c2)
|
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 |
java.lang.Object |
clone()
returns a copy of the constraint. |
int |
getConstraintIdx(int i)
Network management: Among all listeners linked to the idx-th variable of c, find the index of constraint c. |
IntDomainVar |
getIntVar(int varIdx)
Network management: Accessing the i-th search variable of a constraint. |
int |
getNbSubConstraints()
returns the number of sub-constraints that the composite constraint is made of |
int |
getNbVars()
Network management: Get the number of variables involved in the constraint. |
Constraint |
getSubConstraint(int constIdx)
accessor to the sub-constraints from which the composite constraint is made of |
int |
getSubConstraintIdx(int varIdx)
return the index of the subconstraint where the i-th variable is referenced |
Var |
getVar(int i)
Network management: Accessing the ith variable of a constraint. |
int |
getVarIdxInOpposite(int i)
computes the index of the i-th variable in the counter-opposite of the constraint |
boolean |
isCompletelyInstantiated()
Utility: Testing if all variables involved in the constraint are instantiated. |
void |
setConstraintIndex(int i,
int idx)
Network management: Storing that among all listeners linked to the i-th variable of c, this (the current constraint) is found at index idx. |
void |
setVar(int i,
Var v)
Network management: Setting (or overwriting) the ith variable of a constraint. |
Methods inherited from class choco.bool.AbstractCompositeConstraint |
---|
addListener, awakeOnBounds, awakeOnRemovals, getGlobalVarIndex |
Methods inherited from class choco.AbstractConstraint |
---|
awake, awakeOnVar, connectVar, constAwake, delete, fail, getEvent, getPlugIn, getPriority, getProblem, 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.Constraint |
---|
isEquivalentTo, isSatisfied, opposite |
Methods inherited from interface choco.Entity |
---|
getProblem, pretty |
Methods inherited from interface choco.integer.var.IntVarEventListener |
---|
awakeOnInf, awakeOnInst, awakeOnRem, awakeOnSup |
Methods inherited from interface choco.prop.VarEventListener |
---|
awakeOnVar, isActive, setActive, setPassive |
Methods inherited from interface choco.Propagator |
---|
isConsistent, propagate |
Field Detail |
---|
protected AbstractConstraint const0
protected AbstractConstraint const1
protected int offset
Constructor Detail |
---|
public AbstractBinCompositeConstraint(AbstractConstraint c1, AbstractConstraint c2)
Method Detail |
---|
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
Constraint
clone
in interface Constraint
clone
in class AbstractConstraint
java.lang.CloneNotSupportedException
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
public IntDomainVar getIntVar(int varIdx)
varIdx
- index of the variable among all search variables in the constraint. Numbering start from 0 on.
public int getSubConstraintIdx(int varIdx)
CompositeConstraint
varIdx
- the overall index of the variable (among all variables of the combination
public int getVarIdxInOpposite(int i)
Constraint
getVarIdxInOpposite
in interface Constraint
getVarIdxInOpposite
in class AbstractConstraint
i
- the index of the variable in the current constraint (this)
public int getNbVars()
Constraint
public Var getVar(int i)
Constraint
i
- index of the variable in the constraintpublic void setVar(int i, Var v)
Constraint
i
- index of the variable in the constraintv
- the variable (may be an IntDomainVar, SetVar, RealVar, ...public boolean isCompletelyInstantiated()
Propagator
public int getConstraintIdx(int i)
Constraint
i
- index of the variable in the constraintpublic void setConstraintIndex(int i, int idx)
Constraint
i
- index of the variable in the constraintidx
- index of the constraint in the among all listeners linked to that variablepublic Constraint getSubConstraint(int constIdx)
CompositeConstraint
constIdx
- the index of the constraint
public int getNbSubConstraints()
CompositeConstraint
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |