|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.sat4j.minisat.constraints.card.MinWatchCard
public class MinWatchCard
| Field Summary | |
|---|---|
static boolean |
ATLEAST
|
static boolean |
ATMOST
|
protected int |
degree
degree of the cardinality constraint |
protected int |
watchCumul
contains the sum of the coefficients of the watched literals |
| Constructor Summary | |
|---|---|
|
MinWatchCard(ILits voc,
IVecInt ps,
boolean moreThan,
int degree)
Constructs and normalizes a cardinality constraint. used by minWatchCardNew in the non-normalized case. |
protected |
MinWatchCard(ILits voc,
IVecInt ps,
int degree)
Constructs and normalizes a cardinality constraint. used by MinWatchCardPB.normalizedMinWatchCardNew() in the normalized case. |
| Method Summary | |
|---|---|
void |
assertConstraint(UnitPropagationListener s)
Method called when the constraint is to be asserted. |
void |
calcReason(int p,
IVecInt outReason)
computes the reason for a literal |
protected MinWatchCard |
computePropagation(UnitPropagationListener s)
|
protected void |
computeWatches()
|
boolean |
equals(java.lang.Object card)
|
int |
get(int i)
returns the ith literal in the constraint |
double |
getActivity()
Returns the activity of the constraint |
int[] |
getLits()
|
ILits |
getVocabulary()
|
int |
hashCode()
|
void |
incActivity(double claInc)
Increments activity of the constraint |
boolean |
learnt()
Returns wether the constraint is learnt or not. |
protected static int |
linearisation(ILits voc,
IVecInt ps)
Simplifies the constraint w.r.t. the assignments of the literals |
boolean |
locked()
Returns if the constraint is the reason for a unit propagation. |
static MinWatchCard |
minWatchCardNew(UnitPropagationListener s,
ILits voc,
IVecInt ps,
boolean moreThan,
int degree)
Constructs a cardinality constraint with a minimal set of watched literals Permet la cr? |
void |
normalize()
normalize the constraint (cf. |
boolean |
propagate(UnitPropagationListener s,
int p)
propagates the value of a falsified literal |
void |
register()
Register the constraint to the solver. |
void |
remove()
Removes a constraint from the solver |
void |
rescaleBy(double d)
Rescales the activity value of the constraint |
void |
setLearnt()
Mark a constraint as learnt. |
boolean |
simplify()
simplifies the constraint |
int |
size()
|
java.lang.String |
toString()
Returns a string representation of the constraint. |
void |
undo(int p)
Updates information on the constraint in case of a backtrack |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final boolean ATLEAST
public static final boolean ATMOST
protected int degree
protected int watchCumul
| Constructor Detail |
|---|
public MinWatchCard(ILits voc,
IVecInt ps,
boolean moreThan,
int degree)
voc - vocabulary used by the constraintps - literals involved in the constraintmoreThan - should be ATLEAST or ATMOST;degree - degree of the constraint
protected MinWatchCard(ILits voc,
IVecInt ps,
int degree)
voc - vocabulary used by the constraintps - literals involved in the constraintdegree - degree of the constraint| Method Detail |
|---|
public void calcReason(int p,
IVecInt outReason)
calcReason in interface Constrp - falsified literal (or Lit.UNDEFINED)outReason - the reason to be computed. Vector of literals.Constr.calcReason(int p, IVecInt outReason)public double getActivity()
getActivity in interface ConstrConstr.getActivity()public void incActivity(double claInc)
incActivity in interface ConstrclaInc - value to be added to the activity of the constraintConstr.incActivity(double claInc)public boolean learnt()
learnt in interface IConstrIConstr.learnt()
protected static int linearisation(ILits voc,
IVecInt ps)
voc - vocabulary usedps - literals involved
public boolean locked()
locked in interface ConstrConstr.locked()
public static MinWatchCard minWatchCardNew(UnitPropagationListener s,
ILits voc,
IVecInt ps,
boolean moreThan,
int degree)
throws ContradictionException
s - tool for propagationvoc - vocalulary used by the constraintps - literals involved in the constraintmoreThan - sign of the constraint. Should be ATLEAST or ATMOST.degree - degree of the constraint
ContradictionExceptionpublic final void normalize()
public boolean propagate(UnitPropagationListener s,
int p)
propagate in interface Propagatables - tool for literal propagationp - falsified literal
public void remove()
remove in interface Constrpublic void rescaleBy(double d)
rescaleBy in interface Constrd - rescale factorpublic boolean simplify()
simplify in interface Constrpublic java.lang.String toString()
toString in class java.lang.Objectpublic void undo(int p)
undo in interface Undoablep - unassigned literalpublic void setLearnt()
Constr
setLearnt in interface Constrpublic void register()
Constr
register in interface Constrpublic int size()
size in interface IConstrpublic int get(int i)
IConstr
get in interface IConstri - the index of the literal
public void assertConstraint(UnitPropagationListener s)
Constr
assertConstraint in interface Constrs - a UnitPropagationListener to use for unit propagation.protected void computeWatches()
protected MinWatchCard computePropagation(UnitPropagationListener s)
throws ContradictionException
ContradictionExceptionpublic int[] getLits()
public ILits getVocabulary()
public boolean equals(java.lang.Object card)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||