public class OptToPBSATAdapter extends PBSolverDecorator
Constructor and Description |
---|
OptToPBSATAdapter(IOptimizationProblem problem) |
Modifier and Type | Method and Description |
---|---|
Number |
getCurrentObjectiveValue()
Return the value of the objective function in the last model found.
|
boolean |
isOptimal() |
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 myAssumps)
Check the satisfiability of the set of constraints contained inside the
solver.
|
boolean |
isSatisfiable(IVecInt myAssumps,
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.
|
int[] |
model(PrintWriter out)
Compute a minimal model according to the objective function of the
IPBProblem decorated.
|
void |
setTimeoutForFindingBetterSolution(int seconds)
Allow to set a specific timeout when the solver is in optimization mode.
|
String |
toString(String prefix)
Display a textual representation of the solver configuration.
|
addAtLeast, addAtLeast, addAtMost, addAtMost, addExactly, addExactly, addPseudoBoolean, getObjectiveFunction, setObjectiveFunction
addAllClauses, addAtLeast, addAtMost, addBlockingClause, addClause, addExactly, clearDecorated, clearLearntClauses, decorated, expireTimeout, findModel, findModel, getLogPrefix, getSearchListener, getSolvingEngine, getStat, getTimeout, getTimeoutMs, isDBSimplificationAllowed, isSolverKeptHot, isVerbose, modelWithInternalVariables, nConstraints, newVar, newVar, nextFreeVarId, nVars, primeImplicant, primeImplicant, printInfos, printInfos, printStat, printStat, printStat, realNumberOfVariables, registerLiteral, removeConstr, removeSubsumedConstr, reset, setDBSimplificationAllowed, setExpectedNumberOfClauses, setKeepSolverHot, setLogPrefix, setSearchListener, setTimeout, setTimeoutMs, setTimeoutOnConflicts, setVerbose, toString, unsatExplanation
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addAllClauses, addAtLeast, addAtMost, addBlockingClause, addClause, addExactly, clearLearntClauses, expireTimeout, getLogPrefix, getSearchListener, getSolvingEngine, getStat, getTimeout, getTimeoutMs, isDBSimplificationAllowed, isSolverKeptHot, isVerbose, modelWithInternalVariables, newVar, nextFreeVarId, printStat, printStat, printStat, realNumberOfVariables, registerLiteral, removeConstr, removeSubsumedConstr, reset, setDBSimplificationAllowed, setExpectedNumberOfClauses, setKeepSolverHot, setLogPrefix, setSearchListener, setTimeout, setTimeoutMs, setTimeoutOnConflicts, setVerbose, unsatExplanation
findModel, findModel, nConstraints, newVar, nVars, primeImplicant, primeImplicant, printInfos, printInfos
public OptToPBSATAdapter(IOptimizationProblem problem)
public boolean isSatisfiable() throws TimeoutException
IProblem
isSatisfiable
in interface IProblem
isSatisfiable
in class SolverDecorator<IPBSolver>
TimeoutException
public boolean isSatisfiable(boolean global) throws TimeoutException
IProblem
isSatisfiable
in interface IProblem
isSatisfiable
in class SolverDecorator<IPBSolver>
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 myAssumps, boolean global) throws TimeoutException
IProblem
isSatisfiable
in interface IProblem
isSatisfiable
in class SolverDecorator<IPBSolver>
myAssumps
- 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 myAssumps) throws TimeoutException
IProblem
isSatisfiable
in interface IProblem
isSatisfiable
in class SolverDecorator<IPBSolver>
myAssumps
- 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<IPBSolver>
IProblem.isSatisfiable()
,
IProblem.isSatisfiable(IVecInt)
public int[] model(PrintWriter out)
out
- a writer to display information in verbose modepublic boolean model(int var)
RandomAccessModel
model
in interface RandomAccessModel
model
in class SolverDecorator<IPBSolver>
var
- the variable id in Dimacs format#model()
public String toString(String prefix)
ISolver
toString
in interface ISolver
toString
in class SolverDecorator<IPBSolver>
prefix
- the prefix to use on each line.public boolean isOptimal()
public Number getCurrentObjectiveValue()
public void setTimeoutForFindingBetterSolution(int seconds)
Copyright © 2013 Centre de Recherche en Informatique de Lens (CRIL). All Rights Reserved.