|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectchoco.kernel.solver.propagation.Propagator
choco.kernel.solver.constraints.AbstractSConstraint<IntDomainVar>
choco.kernel.solver.constraints.integer.AbstractIntSConstraint
choco.kernel.solver.constraints.integer.AbstractLargeIntSConstraint
choco.cp.solver.constraints.integer.bool.BoolIntLinComb
public final class BoolIntLinComb
A constraint to enforce Sigma_i coef[i]*x_i + k OP y_i where : - OP belongs to >=, <=, = - k is a constant - x_i are boolean variable - t_i is an enum variable It improves the general IntLinComb by storing lower and upper bound of the expression and sorting coefficient for filtering. User: Hadrien Date: 29 oct. 2006
Nested Class Summary | |
---|---|
class |
BoolIntLinComb.RightMemberBounds
|
class |
BoolIntLinComb.SimpleRightMemberBounds
|
Field Summary | |
---|---|
protected int |
addcste
coefficients of the integer variable |
protected IStateInt |
lb
Lower bound of the expression |
protected IStateInt |
maxNegCoeff
index of the maximum coefficient of negative sign |
protected IStateInt |
maxPosCoeff
index of the maximum coefficient of positive sign |
protected int |
nbNegCoef
number of negative coefficients |
protected int |
objCoef
coefficients of the integer variable |
protected int |
op
Field representing the type of linear constraint (equality, inequality, disequality). |
protected BoolIntLinComb.RightMemberBounds |
rmemb
|
protected int[] |
sCoeffs
coefs and vars are sorted in increasing value of the coef |
protected IStateInt |
ub
upper bound of the expression |
Fields inherited from class choco.kernel.solver.constraints.AbstractSConstraint |
---|
cIndices, constraintType, extensions, vars |
Fields inherited from class choco.kernel.solver.propagation.Propagator |
---|
active, constAwakeEvent, priority, propagationEngine |
Fields inherited from interface choco.kernel.solver.constraints.SConstraint |
---|
LOGGER |
Constructor Summary | |
---|---|
BoolIntLinComb(IEnvironment environment,
IntDomainVar[] vs,
int[] coefs,
IntDomainVar c,
int objcoef,
int scste,
int op)
Constructs the constraint with the specified variables and constant. |
Method Summary | |
---|---|
void |
awakeOnInf(int idx)
Default propagation on improved lower bound: propagation on domain revision. |
void |
awakeOnInst(int idx)
******************************************************************** |
void |
awakeOnSup(int idx)
Default propagation on improved upper bound: propagation on domain revision. |
protected int |
computeLbFromScratch()
Computes a lower bound estimate of a linear combination of variables. |
protected int |
computeUbFromScratch()
Computes an upper bound estimate of a linear combination of variables. |
boolean |
filterNegCoeffLb()
enforce variables that would otherwise make the upper bound unreachable |
boolean |
filterNegCoeffUb()
|
boolean |
filterPosCoeffLb()
******************************************************************** |
boolean |
filterPosCoeffUb()
|
void |
fixPointOnEQ()
|
int |
getFilteredEventMask(int idx)
|
protected boolean |
hasConsistentLowerBound()
Tests if the constraint is consistent with respect to the current state of domains. |
protected boolean |
hasConsistentUpperBound()
Tests if the constraint is consistent with respect to the current state of domains. |
void |
initlb()
|
void |
initUb()
|
boolean |
isConsistent()
Tests if the constraint is consistent with respect to the current state of domains. |
Boolean |
isEntailed()
Checks if the constraint is entailed. |
boolean |
isSatisfied(int[] tuple)
TEMPORARY: if not overriden by the constraint, throws an error to avoid bug using reified constraints in constraints that have not been changed to fulfill this api yet ! |
void |
lookForNewMaxNegCoeff()
|
void |
lookForNewMaxPosCoeff()
|
static IntDomainVar[] |
makeTableVar(IntDomainVar[] vs,
IntDomainVar v)
|
AbstractSConstraint<IntDomainVar> |
opposite(Solver solver)
Computes the opposite of this constraint. |
String |
pretty()
pretty printing of the object. |
void |
propagate()
Propagation: Propagating the constraint until local consistency is reached. |
void |
propagateEQ()
|
void |
propagateGEQ()
|
void |
propagateLEQ()
|
boolean |
updateForGEQ()
******************************************************************** |
boolean |
updateForLEQ()
|
void |
updateUbLbOnInst(int idx,
int i)
******************************************************************** |
Methods inherited from class choco.kernel.solver.constraints.integer.AbstractIntSConstraint |
---|
awakeOnBounds, awakeOnRem, awakeOnRemovals, getConstraintType, isSatisfied |
Methods inherited from class choco.kernel.solver.constraints.AbstractSConstraint |
---|
addExtension, addListener, clone, getAbstractSConstraintExtensionNumber, getConstraintIdx, getExtension, getFineDegree, getNbVarNotInst, getNbVars, getVar, getVarQuick, isCompletelyInstantiated, setConstraintIndex, setExtension, setVar, toString |
Methods inherited from class choco.kernel.solver.propagation.Propagator |
---|
activate, awake, constAwake, fail, getEvent, getPriority, isActive, setActive, setActiveSilently, setEntailed, setPassive, setPropagationEngine |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected int op
protected IStateInt lb
protected IStateInt ub
protected IStateInt maxPosCoeff
protected IStateInt maxNegCoeff
protected final int[] sCoeffs
protected int nbNegCoef
protected final int objCoef
protected final int addcste
protected final BoolIntLinComb.RightMemberBounds rmemb
Constructor Detail |
---|
public BoolIntLinComb(IEnvironment environment, IntDomainVar[] vs, int[] coefs, IntDomainVar c, int objcoef, int scste, int op)
Method Detail |
---|
public static IntDomainVar[] makeTableVar(IntDomainVar[] vs, IntDomainVar v)
public int getFilteredEventMask(int idx)
getFilteredEventMask
in class Propagator
public final void updateUbLbOnInst(int idx, int i)
public final void lookForNewMaxPosCoeff()
public final void lookForNewMaxNegCoeff()
public final boolean updateForGEQ() throws ContradictionException
ContradictionException
public final boolean updateForLEQ() throws ContradictionException
ContradictionException
public final void fixPointOnEQ() throws ContradictionException
ContradictionException
public boolean filterNegCoeffUb() throws ContradictionException
ContradictionException
public boolean filterPosCoeffUb() throws ContradictionException
ContradictionException
public final boolean filterPosCoeffLb() throws ContradictionException
ContradictionException
public final boolean filterNegCoeffLb() throws ContradictionException
ContradictionException
public void awakeOnInst(int idx) throws ContradictionException
awakeOnInst
in interface IntPropagator
awakeOnInst
in class AbstractIntSConstraint
ContradictionException
public void awakeOnInf(int idx) throws ContradictionException
AbstractIntSConstraint
awakeOnInf
in interface IntPropagator
awakeOnInf
in class AbstractIntSConstraint
ContradictionException
public void awakeOnSup(int idx) throws ContradictionException
AbstractIntSConstraint
awakeOnSup
in interface IntPropagator
awakeOnSup
in class AbstractIntSConstraint
ContradictionException
public void propagate() throws ContradictionException
Propagator
propagate
in class Propagator
ContradictionException
- contradiction exceptionpublic void propagateEQ() throws ContradictionException
ContradictionException
public void propagateGEQ() throws ContradictionException
ContradictionException
public void propagateLEQ() throws ContradictionException
ContradictionException
public final void initUb()
public final void initlb()
public boolean isConsistent()
isConsistent
in class AbstractIntSConstraint
protected boolean hasConsistentUpperBound()
protected boolean hasConsistentLowerBound()
public Boolean isEntailed()
isEntailed
in class AbstractSConstraint<IntDomainVar>
public boolean isSatisfied(int[] tuple)
AbstractIntSConstraint
isSatisfied
in interface IntPropagator
isSatisfied
in class AbstractIntSConstraint
public String pretty()
IPretty
pretty
in interface IPretty
pretty
in class AbstractSConstraint<IntDomainVar>
public AbstractSConstraint<IntDomainVar> opposite(Solver solver)
opposite
in interface SConstraint<IntDomainVar>
opposite
in class AbstractSConstraint<IntDomainVar>
solver
- the current solver
protected final int computeUbFromScratch()
protected final int computeLbFromScratch()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |