|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.sat4j.tools.SolverDecorator<IPBSolver>
org.sat4j.pb.PBSolverDecorator
org.sat4j.pb.PseudoOptDecorator
public class PseudoOptDecorator
A decorator that computes minimal pseudo boolean models.
| Constructor Summary | |
|---|---|
PseudoOptDecorator(IPBSolver solver)
Create a PB decorator for which a non optimal solution means that the problem is satisfiable. |
|
PseudoOptDecorator(IPBSolver solver,
boolean nonOptimalMeansSatisfiable)
Create a PB decorator with a specific semantic of non optimal solution. |
|
PseudoOptDecorator(IPBSolver solver,
boolean nonOptimalMeansSatisfiable,
boolean useAnImplicantForEvaluation)
Create a PB decorator with a specific semantic of non optimal solution. |
|
| Method Summary | |
|---|---|
boolean |
admitABetterSolution()
|
boolean |
admitABetterSolution(IVecInt assumps)
|
Number |
calculateObjective()
|
void |
discard()
|
void |
discardCurrentSolution()
|
void |
forceObjectiveValueTo(Number forcedValue)
|
Number |
getObjectiveValue()
|
boolean |
hasNoObjectiveFunction()
|
boolean |
isOptimal()
|
boolean |
isSatisfiable()
|
boolean |
isSatisfiable(boolean global)
|
boolean |
isSatisfiable(IVecInt assumps)
|
boolean |
isSatisfiable(IVecInt assumps,
boolean global)
|
int[] |
model()
|
boolean |
model(int var)
|
int[] |
modelWithInternalVariables()
|
boolean |
nonOptimalMeansSatisfiable()
|
void |
reset()
|
void |
setObjectiveFunction(ObjectiveFunction objf)
Provide an objective function to the solver. |
String |
toString(String prefix)
|
| Methods inherited from class org.sat4j.pb.PBSolverDecorator |
|---|
addAtLeast, addAtLeast, addAtMost, addAtMost, addExactly, addExactly, addPseudoBoolean, getObjectiveFunction |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.sat4j.specs.IProblem |
|---|
findModel, findModel, nConstraints, newVar, nVars, primeImplicant, primeImplicant, printInfos |
| Constructor Detail |
|---|
public PseudoOptDecorator(IPBSolver solver)
solver - a PB solver.
public PseudoOptDecorator(IPBSolver solver,
boolean nonOptimalMeansSatisfiable)
solver - a PB solvernonOptimalMeansSatisfiable - true if a suboptimal solution means that the problem is
satisfiable (e.g. as in the PB competition), else false (e.g.
as in the MAXSAT competition).
public PseudoOptDecorator(IPBSolver solver,
boolean nonOptimalMeansSatisfiable,
boolean useAnImplicantForEvaluation)
solver - a PB solvernonOptimalMeansSatisfiable - true if a suboptimal solution means that the problem is
satisfiable (e.g. as in the PB competition), else false (e.g.
as in the MAXSAT competition).useAnImplicantForEvaluation - uses an implicant (a prime implicant computed using
SolverDecorator.primeImplicant()) instead of a plain model to
evaluate the objective function.| Method Detail |
|---|
public boolean isSatisfiable()
throws TimeoutException
isSatisfiable in interface IProblemisSatisfiable in class SolverDecorator<IPBSolver>TimeoutException
public boolean isSatisfiable(boolean global)
throws TimeoutException
isSatisfiable in interface IProblemisSatisfiable in class SolverDecorator<IPBSolver>TimeoutException
public boolean isSatisfiable(IVecInt assumps,
boolean global)
throws TimeoutException
isSatisfiable in interface IProblemisSatisfiable in class SolverDecorator<IPBSolver>TimeoutException
public boolean isSatisfiable(IVecInt assumps)
throws TimeoutException
isSatisfiable in interface IProblemisSatisfiable in class SolverDecorator<IPBSolver>TimeoutExceptionpublic void setObjectiveFunction(ObjectiveFunction objf)
IPBSolver
setObjectiveFunction in interface IPBSolversetObjectiveFunction in class PBSolverDecoratorobjf - the objective function
public boolean admitABetterSolution()
throws TimeoutException
admitABetterSolution in interface IOptimizationProblemTimeoutException
public boolean admitABetterSolution(IVecInt assumps)
throws TimeoutException
admitABetterSolution in interface IOptimizationProblemTimeoutExceptionpublic boolean hasNoObjectiveFunction()
hasNoObjectiveFunction in interface IOptimizationProblempublic boolean nonOptimalMeansSatisfiable()
nonOptimalMeansSatisfiable in interface IOptimizationProblempublic Number calculateObjective()
calculateObjective in interface IOptimizationProblem
public void discardCurrentSolution()
throws ContradictionException
discardCurrentSolution in interface IOptimizationProblemContradictionExceptionpublic void reset()
reset in interface ISolverreset in class SolverDecorator<IPBSolver>public int[] model()
model in interface IProblemmodel in class SolverDecorator<IPBSolver>public boolean model(int var)
model in interface IProblemmodel in class SolverDecorator<IPBSolver>public String toString(String prefix)
toString in interface ISolvertoString in class SolverDecorator<IPBSolver>public Number getObjectiveValue()
getObjectiveValue in interface IOptimizationProblem
public void discard()
throws ContradictionException
discard in interface IOptimizationProblemContradictionException
public void forceObjectiveValueTo(Number forcedValue)
throws ContradictionException
forceObjectiveValueTo in interface IOptimizationProblemContradictionExceptionpublic boolean isOptimal()
isOptimal in interface IOptimizationProblempublic int[] modelWithInternalVariables()
modelWithInternalVariables in interface ISolvermodelWithInternalVariables in class SolverDecorator<IPBSolver>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||