|
||||||||||
| 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
|
| 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. |
|
| 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 |
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. |
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 |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final boolean ATLEAST
public static final boolean ATMOST
| 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| 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()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.public 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 | |||||||||