public class PseudoOptDecorator extends PBSolverDecorator implements IOptimizationProblem
Constructor and Description |
---|
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.
|
Modifier and Type | Method and Description |
---|---|
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.
|
void |
setTimeout(int t) |
void |
setTimeoutForFindingBetterSolution(int seconds) |
String |
toString(String prefix) |
addAtLeast, addAtLeast, addAtMost, addAtMost, addExactly, addExactly, addPseudoBoolean, getObjectiveFunction
addAllClauses, addAtLeast, addAtMost, addBlockingClause, addClause, addExactly, clearDecorated, clearLearntClauses, decorated, expireTimeout, findModel, findModel, getLogPrefix, getSearchListener, getSolvingEngine, getStat, getTimeout, getTimeoutMs, isDBSimplificationAllowed, isSolverKeptHot, isVerbose, nConstraints, newVar, newVar, nextFreeVarId, nVars, primeImplicant, primeImplicant, printInfos, printInfos, printStat, printStat, printStat, realNumberOfVariables, registerLiteral, removeConstr, removeSubsumedConstr, setDBSimplificationAllowed, setExpectedNumberOfClauses, setKeepSolverHot, setLogPrefix, setSearchListener, setTimeoutMs, setTimeoutOnConflicts, setVerbose, toString, unsatExplanation
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
findModel, findModel, nConstraints, newVar, nVars, primeImplicant, primeImplicant, printInfos, printInfos
addAllClauses, addAtLeast, addAtMost, addBlockingClause, addClause, addExactly, clearLearntClauses, expireTimeout, getLogPrefix, getSearchListener, getSolvingEngine, getStat, getTimeout, getTimeoutMs, isDBSimplificationAllowed, isSolverKeptHot, isVerbose, newVar, nextFreeVarId, printStat, printStat, printStat, realNumberOfVariables, registerLiteral, removeConstr, removeSubsumedConstr, setDBSimplificationAllowed, setExpectedNumberOfClauses, setKeepSolverHot, setLogPrefix, setSearchListener, setTimeoutMs, setTimeoutOnConflicts, setVerbose, unsatExplanation
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.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 RandomAccessModel
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>
public void setTimeoutForFindingBetterSolution(int seconds)
setTimeoutForFindingBetterSolution
in interface IOptimizationProblem
public void setTimeout(int t)
setTimeout
in interface ISolver
setTimeout
in class SolverDecorator<IPBSolver>
Copyright © 2013 Centre de Recherche en Informatique de Lens (CRIL). All Rights Reserved.