|
||||||||||
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.IntLinComb
public final class IntLinComb
Implements a constraint Sigma (ai Xi) <=/>=/= C, with Xi variables, ai and C constants.
Field Summary | |
---|---|
static int |
EQ
Constant, to be assigned to op ,
representing linear equalities. |
static int |
GEQ
Constant, to be assigned to op ,
representing linear inequalities. |
protected IntLinCombOp |
intlincomb
Filter based on the operator |
static int |
LEQ
Constant, to be assigned to op ,
representing linear inequalities. |
protected int |
nbPosVars
Field representing the number of variables with positive coeffficients in the linear combination. |
static int |
NEQ
Constant, to be assigned to op ,
representing linear disequalities. |
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 | |
---|---|
IntLinComb(IntDomainVar[] lvars,
int[] lcoeffs,
int nbPositive,
int c,
int linOperator)
Constructs the constraint with the specified variables and constant. |
Method Summary | |
---|---|
void |
awakeOnInf(int idx)
Propagation whenever the lower bound of a variable is modified. |
void |
awakeOnInst(int idx)
Propagation whenever a variable is instantiated. |
void |
awakeOnRem(int idx,
int x)
Propagation whenever a value is removed from the variable domain. |
void |
awakeOnRemovals(int idx,
DisposableIntIterator deltaDomain)
The default implementation of propagation when a variable has been modified consists in iterating all values that have been removed (the delta domain) and propagate them one after another, incrementally. |
void |
awakeOnSup(int idx)
Propagation whenever the upper bound of a variable is modified. |
int |
getFilteredEventMask(int idx)
|
boolean |
isSatisfied(int[] tuple)
Checks if the constraint is satisfied when all variables are instantiated. |
AbstractSConstraint<IntDomainVar> |
opposite(Solver solver)
Get the opposite constraint |
String |
pretty()
pretty printing of the object. |
void |
propagate()
Launchs the filtering algorithm. |
Methods inherited from class choco.kernel.solver.constraints.integer.AbstractIntSConstraint |
---|
awakeOnBounds, getConstraintType, isConsistent, isSatisfied |
Methods inherited from class choco.kernel.solver.constraints.AbstractSConstraint |
---|
addExtension, addListener, clone, getAbstractSConstraintExtensionNumber, getConstraintIdx, getExtension, getFineDegree, getNbVarNotInst, getNbVars, getVar, getVarQuick, isCompletelyInstantiated, isEntailed, 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 |
---|
public static final int EQ
op
,
representing linear equalities.
public static final int GEQ
op
,
representing linear inequalities.
public static final int NEQ
op
,
representing linear disequalities.
public static final int LEQ
op
,
representing linear inequalities.
Only used vby BoolIntLinComb
protected final int nbPosVars
protected final IntLinCombOp intlincomb
Constructor Detail |
---|
public IntLinComb(IntDomainVar[] lvars, int[] lcoeffs, int nbPositive, int c, int linOperator)
lvars
- the variables of the constraintlcoeffs
- the constant coefficientsnbPositive
- number of positive coefficientsc
- the constant value of the constraint (the value the linear
expression must equal)linOperator
- the operator to use (equality, inequality...)Method Detail |
---|
public int getFilteredEventMask(int idx)
getFilteredEventMask
in class Propagator
public void propagate() throws ContradictionException
propagate
in class Propagator
ContradictionException
- if a domain empties or a contradiction is
inferedpublic void awakeOnInf(int idx) throws ContradictionException
awakeOnInf
in interface IntPropagator
awakeOnInf
in class AbstractIntSConstraint
idx
- the index of the modified variable
ContradictionException
- if a domain empties or a contradiction is
inferedpublic void awakeOnSup(int idx) throws ContradictionException
awakeOnSup
in interface IntPropagator
awakeOnSup
in class AbstractIntSConstraint
idx
- the index of the modified variable
ContradictionException
- if a domain empties or a contradiction is
inferedpublic void awakeOnInst(int idx) throws ContradictionException
awakeOnInst
in interface IntPropagator
awakeOnInst
in class AbstractIntSConstraint
idx
- the index of the modified variable
ContradictionException
- if a domain empties or a contradiction is
inferedpublic void awakeOnRem(int idx, int x) throws ContradictionException
awakeOnRem
in interface IntPropagator
awakeOnRem
in class AbstractIntSConstraint
idx
- the index of the modified variablex
- the removed value
ContradictionException
- if a domain empties or a contradiction is
inferedpublic void awakeOnRemovals(int idx, DisposableIntIterator deltaDomain) throws ContradictionException
AbstractIntSConstraint
awakeOnRemovals
in interface IntPropagator
awakeOnRemovals
in class AbstractIntSConstraint
ContradictionException
public boolean isSatisfied(int[] tuple)
isSatisfied
in interface IntPropagator
isSatisfied
in class AbstractIntSConstraint
public AbstractSConstraint<IntDomainVar> opposite(Solver solver)
opposite
in interface SConstraint<IntDomainVar>
opposite
in class AbstractSConstraint<IntDomainVar>
solver
- the current solver
public String pretty()
IPretty
pretty
in interface IPretty
pretty
in class AbstractSConstraint<IntDomainVar>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |