|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.sat4j.tools.SolverDecorator<ISolver> org.sat4j.opt.AbstractSelectorVariablesDecorator org.sat4j.opt.MaxSatDecorator
public class MaxSatDecorator
Computes a solution that satisfies the maximum of clauses.
Field Summary |
---|
Fields inherited from class org.sat4j.opt.AbstractSelectorVariablesDecorator |
---|
nbnewvar, nborigvars, prevfullmodel |
Constructor Summary | |
---|---|
MaxSatDecorator(ISolver solver)
|
Method Summary | |
---|---|
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. |
java.lang.Number |
calculateObjective()
Compute the value of the objective function for the current solution. |
void |
discard()
Discard the current solution in the optimization problem. |
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. |
Methods inherited from class org.sat4j.opt.AbstractSelectorVariablesDecorator |
---|
admitABetterSolution, getExpectedNumberOfClauses, model, model, newVar |
Methods inherited from class org.sat4j.tools.SolverDecorator |
---|
addAllClauses, addAtLeast, addAtMost, clearDecorated, clearLearntClauses, decorated, expireTimeout, findModel, findModel, getStat, getTimeout, getTimeoutMs, isDBSimplificationAllowed, isSatisfiable, isSatisfiable, isSatisfiable, isSatisfiable, nConstraints, newVar, nVars, printInfos, printStat, printStat, removeConstr, setDBSimplificationAllowed, setTimeout, setTimeoutMs, setTimeoutOnConflicts, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.sat4j.specs.IOptimizationProblem |
---|
admitABetterSolution |
Methods inherited from interface org.sat4j.specs.IProblem |
---|
findModel, findModel, isSatisfiable, isSatisfiable, isSatisfiable, isSatisfiable, model, model, nConstraints, nVars, printInfos |
Constructor Detail |
---|
public MaxSatDecorator(ISolver solver)
Method Detail |
---|
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.ISolver.newVar(int)
public IConstr addClause(IVecInt literals) throws ContradictionException
ISolver
addClause
in interface ISolver
addClause
in class SolverDecorator<ISolver>
literals
- a set of literals
ContradictionException
- 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 AbstractSelectorVariablesDecorator
public boolean hasNoObjectiveFunction()
IOptimizationProblem
hasNoObjectiveFunction
in interface IOptimizationProblem
public boolean nonOptimalMeansSatisfiable()
IOptimizationProblem
nonOptimalMeansSatisfiable
in interface IOptimizationProblem
public java.lang.Number calculateObjective()
IOptimizationProblem
calculateObjective
in interface IOptimizationProblem
public void discard() throws ContradictionException
IOptimizationProblem
discard
in interface IOptimizationProblem
ContradictionException
- if a trivial inconsistency is detected.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |