|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.sat4j.tools.SolverDecorator<ISolver>
org.sat4j.opt.MinOneDecorator
public class MinOneDecorator
Computes a solution with the smallest number of satisfied literals. Please make sure that newVar(howmany) is called first to setup the decorator.
| Constructor Summary | |
|---|---|
MinOneDecorator(ISolver solver)
|
|
| Method Summary | |
|---|---|
boolean |
admitABetterSolution()
Look for a solution of the optimization problem. |
java.lang.Number |
calculateObjective()
Compute the value of the objective function for the current solution. |
void |
discard()
Discard the current solution in the optimization problem. |
boolean |
hasNoObjectiveFunction()
If the optimization problem has no objective function, then it is a simple decision problem. |
int[] |
model()
Provide a model (if any) for a satisfiable formula. |
boolean |
nonOptimalMeansSatisfiable()
A suboptimal solution has different meaning depending of the optimization problem considered. |
void |
reset()
Clean up the internal state of the solver. |
| Methods inherited from class org.sat4j.tools.SolverDecorator |
|---|
addAllClauses, addAtLeast, addAtMost, addClause, clearDecorated, clearLearntClauses, decorated, expireTimeout, findModel, findModel, getStat, getTimeout, getTimeoutMs, isDBSimplificationAllowed, isSatisfiable, isSatisfiable, isSatisfiable, isSatisfiable, model, nConstraints, newVar, newVar, nVars, printInfos, printStat, printStat, removeConstr, 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 |
| Constructor Detail |
|---|
public MinOneDecorator(ISolver solver)
| Method Detail |
|---|
public boolean admitABetterSolution()
throws TimeoutException
IOptimizationProblem
admitABetterSolution in interface IOptimizationProblemTimeoutException - if the solver cannot answer in reasonable time.ISolver.setTimeout(int)public boolean hasNoObjectiveFunction()
IOptimizationProblem
hasNoObjectiveFunction in interface IOptimizationProblempublic boolean nonOptimalMeansSatisfiable()
IOptimizationProblem
nonOptimalMeansSatisfiable in interface IOptimizationProblempublic java.lang.Number calculateObjective()
IOptimizationProblem
calculateObjective in interface IOptimizationProblem
public void discard()
throws ContradictionException
IOptimizationProblem
discard in interface IOptimizationProblemContradictionException - if a trivial inconsistency is detected.public int[] model()
IProblem
model in interface IProblemmodel in class SolverDecorator<ISolver>IProblem.isSatisfiable(),
IProblem.isSatisfiable(IVecInt)public void reset()
ISolver
reset in interface ISolverreset in class SolverDecorator<ISolver>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||