public final class MinOneDecorator extends SolverDecorator<ISolver> implements IOptimizationProblem
Constructor and Description |
---|
MinOneDecorator(ISolver solver) |
Modifier and Type | Method and Description |
---|---|
boolean |
admitABetterSolution()
Look for a solution of the optimization problem.
|
boolean |
admitABetterSolution(IVecInt assumps)
Look for a solution of the optimization problem when some literals are
satisfied.
|
Number |
calculateObjective()
Compute the value of the objective function for the current solution.
|
void |
discard()
Discard the current solution in the optimization problem.
|
void |
discardCurrentSolution()
Discard the current solution in the optimization problem.
|
void |
forceObjectiveValueTo(Number forcedValue)
Force the value of the objective function.
|
Number |
getObjectiveValue()
Read only access to the value of the objective function for the current
solution.
|
boolean |
hasNoObjectiveFunction()
If the optimization problem has no objective function, then it is a
simple decision problem.
|
boolean |
isOptimal()
Allows to check afterwards if the solution provided by the solver is
optimal or not.
|
int[] |
model()
Provide a model (if any) for a satisfiable formula.
|
int[] |
modelWithInternalVariables()
That method is designed to be used to retrieve the real model of the
current set of constraints, i.e. to provide the truth value of boolean
variables used internally in the solver (for encoding purposes for
instance).
|
boolean |
nonOptimalMeansSatisfiable()
A suboptimal solution has different meaning depending of the optimization
problem considered.
|
void |
reset()
Clean up the internal state of the solver.
|
void |
setTimeoutForFindingBetterSolution(int seconds)
Allow to set a specific timeout when the solver is in optimization mode.
|
addAllClauses, addAtLeast, addAtMost, addBlockingClause, addClause, addExactly, clearDecorated, clearLearntClauses, decorated, expireTimeout, findModel, findModel, getLogPrefix, getSearchListener, getSolvingEngine, getStat, getTimeout, getTimeoutMs, isDBSimplificationAllowed, isSatisfiable, isSatisfiable, isSatisfiable, isSatisfiable, isSolverKeptHot, isVerbose, model, nConstraints, newVar, newVar, nextFreeVarId, nVars, primeImplicant, primeImplicant, printInfos, printInfos, printStat, printStat, printStat, realNumberOfVariables, registerLiteral, removeConstr, removeSubsumedConstr, setDBSimplificationAllowed, setExpectedNumberOfClauses, setKeepSolverHot, setLogPrefix, setSearchListener, setTimeout, setTimeoutMs, setTimeoutOnConflicts, setUnitClauseProvider, setVerbose, toString, toString, unsatExplanation
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
findModel, findModel, isSatisfiable, isSatisfiable, isSatisfiable, isSatisfiable, nConstraints, newVar, nVars, primeImplicant, primeImplicant, printInfos, printInfos
model
public MinOneDecorator(ISolver solver)
public boolean admitABetterSolution() throws TimeoutException
IOptimizationProblem
admitABetterSolution
in interface IOptimizationProblem
TimeoutException
- if the solver cannot answer in reasonable time.ISolver.setTimeout(int)
public boolean admitABetterSolution(IVecInt assumps) throws TimeoutException
IOptimizationProblem
admitABetterSolution
in interface IOptimizationProblem
assumps
- a set of literals in Dimacs format.TimeoutException
- if the solver cannot answer in reasonable time.ISolver.setTimeout(int)
public boolean hasNoObjectiveFunction()
IOptimizationProblem
hasNoObjectiveFunction
in interface IOptimizationProblem
public boolean nonOptimalMeansSatisfiable()
IOptimizationProblem
nonOptimalMeansSatisfiable
in interface IOptimizationProblem
public Number calculateObjective()
IOptimizationProblem
calculateObjective
in interface IOptimizationProblem
IOptimizationProblem.getObjectiveValue()
public void discardCurrentSolution() throws ContradictionException
IOptimizationProblem
discardCurrentSolution
in interface IOptimizationProblem
ContradictionException
- if a trivial inconsistency is detected.public int[] model()
IProblem
model
in interface IProblem
model
in class SolverDecorator<ISolver>
IProblem.isSatisfiable()
,
IProblem.isSatisfiable(IVecInt)
public int[] modelWithInternalVariables()
ISolver
modelWithInternalVariables
in interface ISolver
modelWithInternalVariables
in class SolverDecorator<ISolver>
IProblem.model()
,
ModelIterator
public void reset()
ISolver
reset
in interface ISolver
reset
in class SolverDecorator<ISolver>
public Number getObjectiveValue()
IOptimizationProblem
getObjectiveValue
in interface IOptimizationProblem
public void discard() throws ContradictionException
IOptimizationProblem
discard
in interface IOptimizationProblem
ContradictionException
- if a trivial inconsistency is detected.IOptimizationProblem.discardCurrentSolution()
public void forceObjectiveValueTo(Number forcedValue) throws ContradictionException
IOptimizationProblem
forceObjectiveValueTo
in interface IOptimizationProblem
ContradictionException
public boolean isOptimal()
IOptimizationProblem
isOptimal
in interface IOptimizationProblem
public void setTimeoutForFindingBetterSolution(int seconds)
IOptimizationProblem
setTimeoutForFindingBetterSolution
in interface IOptimizationProblem
Copyright © 2013 Centre de Recherche en Informatique de Lens (CRIL). All Rights Reserved.