|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.sat4j.tools.SolverDecorator<org.sat4j.pb.IPBSolver>
org.sat4j.pb.PBSolverDecorator
org.sat4j.maxsat.WeightedMaxSatDecorator
public class WeightedMaxSatDecorator
A decorator for solving weighted MAX SAT problems. The first value of the list of literals in the addClause() method contains the weight of the clause.
| Field Summary | |
|---|---|
protected int |
nbnewvar
|
protected int |
nborigvars
|
protected int[] |
prevfullmodel
|
protected int |
top
|
| Constructor Summary | |
|---|---|
WeightedMaxSatDecorator(org.sat4j.pb.IPBSolver solver)
|
|
| Method Summary | |
|---|---|
org.sat4j.specs.IConstr |
addClause(org.sat4j.specs.IVecInt literals)
|
boolean |
admitABetterSolution()
|
java.lang.Number |
calculateObjective()
|
void |
discard()
|
boolean |
hasNoObjectiveFunction()
|
int[] |
model()
|
int |
newVar(int howmany)
|
boolean |
nonOptimalMeansSatisfiable()
|
void |
reset()
|
void |
setExpectedNumberOfClauses(int nb)
|
void |
setTopWeight(int top)
|
| Methods inherited from class org.sat4j.pb.PBSolverDecorator |
|---|
addPseudoBoolean, getExplanation, setListOfVariablesForExplanation, setObjectiveFunction |
| Methods inherited from class org.sat4j.tools.SolverDecorator |
|---|
addAllClauses, addAtLeast, addAtMost, clearDecorated, clearLearntClauses, decorated, expireTimeout, findModel, findModel, getStat, getTimeout, isDBSimplificationAllowed, isSatisfiable, isSatisfiable, isSatisfiable, isSatisfiable, model, nConstraints, newVar, nVars, printInfos, printStat, printStat, removeConstr, setDBSimplificationAllowed, setTimeout, setTimeoutMs, setTimeoutOnConflicts, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.sat4j.specs.IProblem |
|---|
findModel, findModel, isSatisfiable, isSatisfiable, isSatisfiable, isSatisfiable, model, nConstraints, nVars, printInfos |
| Methods inherited from interface org.sat4j.specs.ISolver |
|---|
addAllClauses, addAtLeast, addAtMost, clearLearntClauses, expireTimeout, getStat, getTimeout, isDBSimplificationAllowed, newVar, printStat, printStat, removeConstr, setDBSimplificationAllowed, setTimeout, setTimeoutMs, setTimeoutOnConflicts, toString |
| Field Detail |
|---|
protected int nborigvars
protected int nbnewvar
protected int[] prevfullmodel
protected int top
| Constructor Detail |
|---|
public WeightedMaxSatDecorator(org.sat4j.pb.IPBSolver solver)
| Method Detail |
|---|
public int newVar(int howmany)
newVar in interface org.sat4j.specs.ISolvernewVar in class org.sat4j.tools.SolverDecorator<org.sat4j.pb.IPBSolver>public void setExpectedNumberOfClauses(int nb)
setExpectedNumberOfClauses in interface org.sat4j.specs.ISolversetExpectedNumberOfClauses in class org.sat4j.tools.SolverDecorator<org.sat4j.pb.IPBSolver>public int[] model()
model in interface org.sat4j.specs.IProblemmodel in class org.sat4j.tools.SolverDecorator<org.sat4j.pb.IPBSolver>public void setTopWeight(int top)
public org.sat4j.specs.IConstr addClause(org.sat4j.specs.IVecInt literals)
throws org.sat4j.specs.ContradictionException
addClause in interface org.sat4j.specs.ISolveraddClause in class org.sat4j.tools.SolverDecorator<org.sat4j.pb.IPBSolver>org.sat4j.specs.ContradictionException
public boolean admitABetterSolution()
throws org.sat4j.specs.TimeoutException
admitABetterSolution in interface org.sat4j.specs.IOptimizationProblemorg.sat4j.specs.TimeoutExceptionpublic void reset()
reset in interface org.sat4j.specs.ISolverreset in class org.sat4j.tools.SolverDecorator<org.sat4j.pb.IPBSolver>public boolean hasNoObjectiveFunction()
hasNoObjectiveFunction in interface org.sat4j.specs.IOptimizationProblempublic boolean nonOptimalMeansSatisfiable()
nonOptimalMeansSatisfiable in interface org.sat4j.specs.IOptimizationProblempublic java.lang.Number calculateObjective()
calculateObjective in interface org.sat4j.specs.IOptimizationProblem
public void discard()
throws org.sat4j.specs.ContradictionException
discard in interface org.sat4j.specs.IOptimizationProblemorg.sat4j.specs.ContradictionException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||