|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.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 IProblem
isSatisfiable
in class SolverDecorator<IPBSolver>
TimeoutException
public boolean isSatisfiable(boolean global) throws TimeoutException
isSatisfiable
in interface IProblem
isSatisfiable
in class SolverDecorator<IPBSolver>
TimeoutException
public boolean isSatisfiable(IVecInt assumps, boolean global) throws TimeoutException
isSatisfiable
in interface IProblem
isSatisfiable
in class SolverDecorator<IPBSolver>
TimeoutException
public boolean isSatisfiable(IVecInt assumps) throws TimeoutException
isSatisfiable
in interface IProblem
isSatisfiable
in class SolverDecorator<IPBSolver>
TimeoutException
public void setObjectiveFunction(ObjectiveFunction objf)
IPBSolver
setObjectiveFunction
in interface IPBSolver
setObjectiveFunction
in class PBSolverDecorator
objf
- the objective functionpublic boolean admitABetterSolution() throws TimeoutException
admitABetterSolution
in interface IOptimizationProblem
TimeoutException
public boolean admitABetterSolution(IVecInt assumps) throws TimeoutException
admitABetterSolution
in interface IOptimizationProblem
TimeoutException
public boolean hasNoObjectiveFunction()
hasNoObjectiveFunction
in interface IOptimizationProblem
public boolean nonOptimalMeansSatisfiable()
nonOptimalMeansSatisfiable
in interface IOptimizationProblem
public Number calculateObjective()
calculateObjective
in interface IOptimizationProblem
public void discardCurrentSolution() throws ContradictionException
discardCurrentSolution
in interface IOptimizationProblem
ContradictionException
public void reset()
reset
in interface ISolver
reset
in class SolverDecorator<IPBSolver>
public int[] model()
model
in interface IProblem
model
in class SolverDecorator<IPBSolver>
public boolean model(int var)
model
in interface IProblem
model
in class SolverDecorator<IPBSolver>
public String toString(String prefix)
toString
in interface ISolver
toString
in class SolverDecorator<IPBSolver>
public Number getObjectiveValue()
getObjectiveValue
in interface IOptimizationProblem
public void discard() throws ContradictionException
discard
in interface IOptimizationProblem
ContradictionException
public void forceObjectiveValueTo(Number forcedValue) throws ContradictionException
forceObjectiveValueTo
in interface IOptimizationProblem
ContradictionException
public boolean isOptimal()
isOptimal
in interface IOptimizationProblem
public int[] modelWithInternalVariables()
modelWithInternalVariables
in interface ISolver
modelWithInternalVariables
in class SolverDecorator<IPBSolver>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |