public final class MaxSatDecorator extends AbstractSelectorVariablesDecorator
Constructor and Description |
---|
MaxSatDecorator(ISolver solver) |
MaxSatDecorator(ISolver solver,
boolean equivalence) |
Modifier and Type | Method and Description |
---|---|
IConstr |
addClause(IVecInt literals)
Create a clause from a set of literals The literals are represented by
non null integers such that opposite literals a represented by opposite
values.
|
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 |
nonOptimalMeansSatisfiable()
A suboptimal solution has different meaning depending of the optimization
problem considered.
|
void |
reset()
Clean up the internal state of the solver.
|
void |
setExpectedNumberOfClauses(int nb)
To inform the solver of the expected number of clauses to read.
|
void |
setTimeoutForFindingBetterSolution(int seconds)
Allow to set a specific timeout when the solver is in optimization mode.
|
admitABetterSolution, getExpectedNumberOfClauses, getNbexpectedclauses, getPrevboolmodel, getPrevfullmodel, getPrevmodel, isOptimal, isSolutionOptimal, model, model, setNbexpectedclauses, setPrevboolmodel, setPrevfullmodel, setPrevmodel, setSolutionOptimal
addAllClauses, addAtLeast, addAtMost, addBlockingClause, addExactly, clearDecorated, clearLearntClauses, decorated, expireTimeout, findModel, findModel, getLogPrefix, getSearchListener, getSolvingEngine, getStat, getTimeout, getTimeoutMs, isDBSimplificationAllowed, isSatisfiable, isSatisfiable, isSatisfiable, isSatisfiable, isSolverKeptHot, isVerbose, modelWithInternalVariables, nConstraints, newVar, newVar, nextFreeVarId, nVars, primeImplicant, primeImplicant, printInfos, printInfos, printStat, printStat, printStat, realNumberOfVariables, registerLiteral, removeConstr, removeSubsumedConstr, setDBSimplificationAllowed, 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
public MaxSatDecorator(ISolver solver)
public MaxSatDecorator(ISolver solver, boolean equivalence)
public void setExpectedNumberOfClauses(int nb)
ISolver
p cnf
line is
read in dimacs formatted input file.
Note that this method is supposed to be called AFTER a call to
newVar(int)setExpectedNumberOfClauses
in interface ISolver
setExpectedNumberOfClauses
in class AbstractSelectorVariablesDecorator
nb
- the expected number of clauses.IProblem.newVar(int)
public IConstr addClause(IVecInt literals) throws ContradictionException
ISolver
addClause
in interface ISolver
addClause
in class SolverDecorator<ISolver>
literals
- a set of literalsContradictionException
- iff the vector of literals is empty or if it contains only
falsified literals after unit propagationISolver.removeConstr(IConstr)
public void reset()
ISolver
reset
in interface ISolver
reset
in class SolverDecorator<ISolver>
public boolean hasNoObjectiveFunction()
IOptimizationProblem
public boolean nonOptimalMeansSatisfiable()
IOptimizationProblem
public Number calculateObjective()
IOptimizationProblem
IOptimizationProblem.getObjectiveValue()
public void discardCurrentSolution() throws ContradictionException
IOptimizationProblem
ContradictionException
- if a trivial inconsistency is detected.public boolean admitABetterSolution(IVecInt assumps) throws TimeoutException
IOptimizationProblem
admitABetterSolution
in interface IOptimizationProblem
admitABetterSolution
in class AbstractSelectorVariablesDecorator
assumps
- a set of literals in Dimacs format.TimeoutException
- if the solver cannot answer in reasonable time.ISolver.setTimeout(int)
public void discard() throws ContradictionException
IOptimizationProblem
ContradictionException
- if a trivial inconsistency is detected.IOptimizationProblem.discardCurrentSolution()
public Number getObjectiveValue()
IOptimizationProblem
public void forceObjectiveValueTo(Number forcedValue) throws ContradictionException
IOptimizationProblem
ContradictionException
public void setTimeoutForFindingBetterSolution(int seconds)
IOptimizationProblem
Copyright © 2013 Centre de Recherche en Informatique de Lens (CRIL). All Rights Reserved.