|
|||||||||
| 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.AbstractLargeIntConstraint
choco.integer.constraints.IntLinComb
public class IntLinComb
Implements a constraint Sigma (ai Xi) <=/>=/= C, with Xi variables, ai and C search constants.
| Field Summary | |
|---|---|
protected int[] |
coeffs
Field representing the type of linear constraint (equality, inequality, disequality) |
protected int |
cste
The search constant of the constraint |
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 int |
nbPosVars
Field representing the number of variables with positive coeffficients in the linear combination (all positive coefficients are given before negative ones) |
static int |
NEQ
Constant, to be assigned to op, representing linear disequalities |
protected int |
op
Field representing the type of linear constraint (equality, inequality, disequality) |
| Fields inherited from class choco.integer.constraints.AbstractLargeIntConstraint |
|---|
cIndices, vars |
| 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 | |
|---|---|
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)
Default propagation on improved lower bound: propagation on domain revision. |
void |
awakeOnInst(int idx)
Default propagation on instantiation: full constraint re-propagation. |
void |
awakeOnRem(int idx,
int x)
Default propagation on one value removal: propagation on domain revision. |
void |
awakeOnSup(int idx)
Default propagation on improved upper bound: propagation on domain revision. |
void |
awakeOnVar(int idx)
Default propagation on variable revision: full constraint re-propagation. |
java.lang.Object |
clone()
returns a copy of the constraint. |
protected int |
computeLowerBound()
computes a lower bound estimate of a linear combination of variables |
protected int |
computeUpperBound()
computes an upper bound estimate of a linear combination of variables |
protected void |
filter(boolean startWithLB,
int minNbRules)
a strategy for chaotic iteration with two rules (LB and UB propagation) the fix point is reached individually for each rule in one function call but this call may break the stability condition for the other rule (in which case the second rule infers new information from the fresh inferences made by the first rule). |
protected boolean |
filterOnImprovedLowerBound()
|
protected boolean |
filterOnImprovedUpperBound()
|
protected boolean |
hasConsistentLowerBound()
tests if the constraint is consistent with respect to the current state of domains |
protected boolean |
hasConsistentUpperBound()
|
void |
init(int[] lcoeffs)
|
boolean |
isConsistent()
tests if the constraint is consistent with respect to the current state of domains |
java.lang.Boolean |
isEntailed()
Checks whether the constraint is definitely satisfied, no matter what further restrictions occur to the domain of its variables. |
boolean |
isEquivalentTo(Constraint compareTo)
tests the equivalence (logical equality of the conditions) between two constraints. |
boolean |
isSatisfied()
Semantic: Testing if the constraint is satisfied. |
AbstractConstraint |
opposite()
computes the constraint modelling the counter-opposite condition of this |
java.lang.String |
pretty()
pretty printing of the object. |
void |
propagate()
Propagates the constraint awake events. |
protected boolean |
propagateNewLowerBound(int mylb)
propagates the constraint sigma(ai Xi) + c <= 0 where mylb = sigma(ai inf(Xi)) + c note: this does not reach saturation (fix point), but returns a boolean indicating whether it infered new information or not. |
protected boolean |
propagateNewUpperBound(int myub)
propagates the constraint sigma(ai Xi) + c <= 0 where myub = sigma(ai sup(Xi)) + c note: this does not reach saturation (fix point), but returns a boolean indicating whether it infered new information or not. |
| Methods inherited from class choco.integer.constraints.AbstractLargeIntConstraint |
|---|
assignIndices, getConstraintIdx, getIntVar, getNbVars, getVar, isCompletelyInstantiated, setConstraintIndex, setVar |
| Methods inherited from class choco.integer.constraints.AbstractIntConstraint |
|---|
awakeOnBounds, awakeOnRemovals, getSelfIndex |
| Methods inherited from class choco.AbstractConstraint |
|---|
addListener, awake, connectVar, constAwake, delete, fail, getEvent, getPlugIn, getPriority, getProblem, getVarIdxInOpposite, isActive, setActive, setEntailed, setPassive, setPlugIn, substituteVar |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface choco.Propagator |
|---|
awake, constAwake, delete, getEvent, getPlugIn, getPriority |
| Methods inherited from interface choco.prop.VarEventListener |
|---|
addListener, isActive, setActive, setPassive |
| Methods inherited from interface choco.prop.VarEventListener |
|---|
addListener, isActive, setActive, setPassive |
| 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
protected final int op
protected int[] coeffs
protected final int nbPosVars
protected final int cste
| Constructor Detail |
|---|
public IntLinComb(IntDomainVar[] lvars,
int[] lcoeffs,
int nbPositive,
int c,
int linOperator)
| Method Detail |
|---|
public java.lang.Object clone()
throws java.lang.CloneNotSupportedException
Constraint
clone in interface Constraintclone in class AbstractLargeIntConstraintjava.lang.CloneNotSupportedExceptionpublic void init(int[] lcoeffs)
public void propagate()
throws ContradictionException
AbstractLargeIntConstraint
propagate in interface Propagatorpropagate in class AbstractLargeIntConstraintContradictionException
public void awakeOnVar(int idx)
throws ContradictionException
AbstractConstraint
awakeOnVar in interface VarEventListenerawakeOnVar in interface PropagatorawakeOnVar in class AbstractConstraintContradictionException
public void awakeOnInf(int idx)
throws ContradictionException
AbstractIntConstraint
awakeOnInf in interface IntVarEventListenerawakeOnInf in class AbstractIntConstraintContradictionException
public void awakeOnSup(int idx)
throws ContradictionException
AbstractIntConstraint
awakeOnSup in interface IntVarEventListenerawakeOnSup in class AbstractIntConstraintContradictionException
public void awakeOnInst(int idx)
throws ContradictionException
AbstractIntConstraint
awakeOnInst in interface IntVarEventListenerawakeOnInst in class AbstractIntConstraintContradictionException
public void awakeOnRem(int idx,
int x)
throws ContradictionException
AbstractIntConstraint
awakeOnRem in interface IntVarEventListenerawakeOnRem in class AbstractIntConstraintContradictionExceptionpublic java.lang.Boolean isEntailed()
Propagator
isEntailed in interface PropagatorisEntailed in class AbstractConstraintpublic boolean isSatisfied()
Constraint
protected int computeUpperBound()
protected int computeLowerBound()
protected void filter(boolean startWithLB,
int minNbRules)
throws ContradictionException
startWithLB - whether LB must be the first rule appliedminNbRules - minimum number of rules required to reach fiux point.
ContradictionException
protected boolean filterOnImprovedLowerBound()
throws ContradictionException
ContradictionException
protected boolean filterOnImprovedUpperBound()
throws ContradictionException
ContradictionException
protected boolean propagateNewLowerBound(int mylb)
throws ContradictionException
ContradictionException
protected boolean propagateNewUpperBound(int myub)
throws ContradictionException
ContradictionExceptionpublic boolean isConsistent()
isConsistent in interface PropagatorisConsistent in class AbstractIntConstraintprotected boolean hasConsistentLowerBound()
protected boolean hasConsistentUpperBound()
public AbstractConstraint opposite()
Constraint
opposite in interface Constraintopposite in class AbstractConstraintpublic boolean isEquivalentTo(Constraint compareTo)
Constraint
isEquivalentTo in interface ConstraintisEquivalentTo in class AbstractConstraintcompareTo - the constraint to be compared to
public java.lang.String pretty()
Entity
pretty in interface Entitypretty in class AbstractEntity
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||