|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.sat4j.tools.SolverDecorator<ISolver> org.sat4j.tools.OptToSatAdapter
public class OptToSatAdapter
Constructor Summary | |
---|---|
OptToSatAdapter(IOptimizationProblem problem)
|
Method Summary | |
---|---|
boolean |
isOptimal()
Allow to easily check is the solution returned by isSatisfiable is optimal or not. |
boolean |
isSatisfiable()
Check the satisfiability of the set of constraints contained inside the solver. |
boolean |
isSatisfiable(boolean global)
Check the satisfiability of the set of constraints contained inside the solver. |
boolean |
isSatisfiable(IVecInt assumps)
Check the satisfiability of the set of constraints contained inside the solver. |
boolean |
isSatisfiable(IVecInt assumps,
boolean global)
Check the satisfiability of the set of constraints contained inside the solver. |
int[] |
model()
Provide a model (if any) for a satisfiable formula. |
boolean |
model(int var)
Provide the truth value of a specific variable in the model. |
void |
reset()
Clean up the internal state of the solver. |
String |
toString(String prefix)
Display a textual representation of the solver configuration. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public OptToSatAdapter(IOptimizationProblem problem)
Method Detail |
---|
public boolean isSatisfiable() throws TimeoutException
IProblem
isSatisfiable
in interface IProblem
isSatisfiable
in class SolverDecorator<ISolver>
TimeoutException
public void reset()
ISolver
reset
in interface ISolver
reset
in class SolverDecorator<ISolver>
public boolean isSatisfiable(boolean global) throws TimeoutException
IProblem
isSatisfiable
in interface IProblem
isSatisfiable
in class SolverDecorator<ISolver>
global
- whether that call is part of a global process (i.e.
optimization) or not. if (global), the timeout will not be
reset between each call.
TimeoutException
public boolean isSatisfiable(IVecInt assumps, boolean global) throws TimeoutException
IProblem
isSatisfiable
in interface IProblem
isSatisfiable
in class SolverDecorator<ISolver>
assumps
- a set of literals (represented by usual non null integers in
Dimacs format).global
- whether that call is part of a global process (i.e.
optimization) or not. if (global), the timeout will not be
reset between each call.
TimeoutException
public boolean isSatisfiable(IVecInt assumps) throws TimeoutException
IProblem
isSatisfiable
in interface IProblem
isSatisfiable
in class SolverDecorator<ISolver>
assumps
- a set of literals (represented by usual non null integers in
Dimacs format).
TimeoutException
public int[] model()
IProblem
model
in interface IProblem
model
in class SolverDecorator<ISolver>
IProblem.isSatisfiable()
,
IProblem.isSatisfiable(IVecInt)
public boolean model(int var)
IProblem
model
in interface IProblem
model
in class SolverDecorator<ISolver>
var
- the variable id in Dimacs format
IProblem.model()
public String toString(String prefix)
ISolver
toString
in interface ISolver
toString
in class SolverDecorator<ISolver>
prefix
- the prefix to use on each line.
public boolean isOptimal()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |