|
||||||||||
| 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.MinCostDecorator
public class MinCostDecorator
A decorator that computes minimal cost models. That problem is also known as binate covering problem. Please make sure that newVar(howmany) is called first to setup the decorator.
| Constructor Summary | |
|---|---|
MinCostDecorator(org.sat4j.pb.IPBSolver solver)
|
|
| Method Summary | |
|---|---|
boolean |
admitABetterSolution()
|
java.lang.Number |
calculateObjective()
|
int |
costOf(int var)
to know the cost of a given var. |
void |
discard()
|
boolean |
hasNoObjectiveFunction()
|
int[] |
model()
|
int |
newVar()
|
int |
newVar(int howmany)
Setup the number of variables to use inside the solver. |
boolean |
nonOptimalMeansSatisfiable()
|
void |
setCost(int var,
int cost)
to set the cost of a given var. |
| Methods inherited from class org.sat4j.pb.PBSolverDecorator |
|---|
addPseudoBoolean, getExplanation, setListOfVariablesForExplanation, setObjectiveFunction |
| Methods inherited from class org.sat4j.tools.SolverDecorator |
|---|
addAllClauses, addAtLeast, addAtMost, addClause, clearDecorated, clearLearntClauses, decorated, expireTimeout, findModel, findModel, getStat, getTimeout, isDBSimplificationAllowed, isSatisfiable, isSatisfiable, isSatisfiable, isSatisfiable, model, nConstraints, nVars, printInfos, printStat, printStat, removeConstr, reset, setDBSimplificationAllowed, setExpectedNumberOfClauses, 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, addClause, clearLearntClauses, expireTimeout, getStat, getTimeout, isDBSimplificationAllowed, printStat, printStat, removeConstr, reset, setDBSimplificationAllowed, setExpectedNumberOfClauses, setTimeout, setTimeoutMs, setTimeoutOnConflicts, toString |
| Constructor Detail |
|---|
public MinCostDecorator(org.sat4j.pb.IPBSolver solver)
| Method Detail |
|---|
public int newVar()
newVar in interface org.sat4j.specs.ISolvernewVar in class org.sat4j.tools.SolverDecorator<org.sat4j.pb.IPBSolver>public int newVar(int howmany)
newVar in interface org.sat4j.specs.ISolvernewVar in class org.sat4j.tools.SolverDecorator<org.sat4j.pb.IPBSolver>howmany - the maximum number of variables in the solver.public int costOf(int var)
var - a variable in dimacs format
public void setCost(int var,
int cost)
var - a variable in dimacs formatcost - the cost of var when assigned to true
public boolean admitABetterSolution()
throws org.sat4j.specs.TimeoutException
admitABetterSolution in interface org.sat4j.specs.IOptimizationProblemorg.sat4j.specs.TimeoutExceptionpublic 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.ContradictionExceptionpublic int[] model()
model in interface org.sat4j.specs.IProblemmodel in class org.sat4j.tools.SolverDecorator<org.sat4j.pb.IPBSolver>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||