|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectchoco.AbstractEntity
choco.AbstractConstraint
choco.real.constraint.AbstractBinRealIntConstraint
choco.real.constraint.MixedCstElt
public class MixedCstElt
Let x be an integer variable with n values and v be a real variable. Given n constant values a1 to an, this constraint ensures that:
x = i iff v = ai
a1... an sequence is supposed to be ordered (a1<a2<... an)
Field Summary | |
---|---|
protected double[] |
values
|
Fields inherited from class choco.real.constraint.AbstractBinRealIntConstraint |
---|
cIdx0, cIdx1, v0, v1 |
Fields inherited from class choco.AbstractConstraint |
---|
active, constAwakeEvent, hook, priority |
Fields inherited from class choco.AbstractEntity |
---|
problem |
Constructor Summary | |
---|---|
MixedCstElt(RealVar v0,
IntDomainVar v1,
double[] values)
|
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 |
void |
awake()
Default initial propagation: full constraint re-propagation. |
void |
awakeOnBounds(int idx)
|
void |
awakeOnInf(int idx)
Default propagation on improved lower bound: propagation on domain revision. |
void |
awakeOnInst(int varIdx)
Default propagation on instantiation: full constraint re-propagation. |
void |
awakeOnRem(int varIdx,
int val)
Default propagation on one value removal: propagation on domain revision. |
void |
awakeOnRemovals(int varIdx,
IntIterator deltaDomain)
|
void |
awakeOnSup(int idx)
Default propagation on improved upper bound: propagation on domain revision. |
java.lang.Object |
clone()
returns a copy of the constraint. |
boolean |
isConsistent()
tests if the constraint is consistent with respect to the current state of domains |
boolean |
isSatisfied()
Semantic: Testing if the constraint is satisfied. |
void |
propagate()
Propagation: Propagating the constraint until local consistency is reached. |
void |
updateIInf()
|
void |
updateISup()
|
void |
updateReal()
|
Methods inherited from class choco.real.constraint.AbstractBinRealIntConstraint |
---|
getConstraintIdx, getIntVar, getIntVarNb, getNbVars, getRealVar, getRealVarNb, getVar, isCompletelyInstantiated, setConstraintIndex, setVar |
Methods inherited from class choco.AbstractConstraint |
---|
addListener, awakeOnVar, 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.real.constraint.MixedConstraint |
---|
getIntVar, getIntVarNb, getRealVar, getRealVarNb |
Methods inherited from interface choco.prop.VarEventListener |
---|
addListener, isActive, setActive, setPassive |
Methods inherited from interface choco.real.constraint.RealListener |
---|
getConstraintIdx, setConstraintIndex |
Methods inherited from interface choco.prop.VarEventListener |
---|
addListener, isActive, setActive, setPassive |
Methods inherited from interface choco.prop.VarEventListener |
---|
addListener, isActive, setActive, setPassive |
Methods inherited from interface choco.integer.var.IntVarEventListener |
---|
getConstraintIdx, setConstraintIndex |
Methods inherited from interface choco.prop.VarEventListener |
---|
addListener, isActive, setActive, setPassive |
Field Detail |
---|
protected double[] values
Constructor Detail |
---|
public MixedCstElt(RealVar v0, IntDomainVar v1, double[] values)
Method Detail |
---|
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
Constraint
clone
in interface Constraint
clone
in class AbstractBinRealIntConstraint
java.lang.CloneNotSupportedException
public void awake() throws ContradictionException
AbstractConstraint
awake
in interface Propagator
awake
in class AbstractConstraint
ContradictionException
public void propagate() throws ContradictionException
Propagator
propagate
in interface Propagator
ContradictionException
public void awakeOnInf(int idx) throws ContradictionException
IntVarEventListener
awakeOnInf
in interface IntVarEventListener
awakeOnInf
in interface RealListener
ContradictionException
public void awakeOnSup(int idx) throws ContradictionException
IntVarEventListener
awakeOnSup
in interface IntVarEventListener
awakeOnSup
in interface RealListener
ContradictionException
public void awakeOnBounds(int idx) throws ContradictionException
awakeOnBounds
in interface IntConstraint
ContradictionException
public void awakeOnInst(int varIdx) throws ContradictionException
IntVarEventListener
awakeOnInst
in interface IntVarEventListener
ContradictionException
public void awakeOnRem(int varIdx, int val) throws ContradictionException
IntVarEventListener
awakeOnRem
in interface IntVarEventListener
ContradictionException
public void awakeOnRemovals(int varIdx, IntIterator deltaDomain) throws ContradictionException
awakeOnRemovals
in interface IntConstraint
ContradictionException
public void updateIInf() throws ContradictionException
ContradictionException
public void updateISup() throws ContradictionException
ContradictionException
public void updateReal() throws ContradictionException
ContradictionException
public boolean isConsistent()
Propagator
isConsistent
in interface Propagator
public boolean isSatisfied()
Constraint
isSatisfied
in interface Constraint
public int assignIndices(AbstractCompositeConstraint root, int i, boolean dynamicAddition)
Propagator
assignIndices
in interface 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 All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |