|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.sat4j.tools.SolverDecorator<ISolver>
org.sat4j.opt.AbstractSelectorVariablesDecorator
public abstract class AbstractSelectorVariablesDecorator
Abstract class which adds a new "selector" variable for each clause entered in the solver. As a consequence, an original problem with n variables and m clauses will end up with n+m variables.
Constructor Summary | |
---|---|
AbstractSelectorVariablesDecorator(ISolver solver)
|
Method Summary | |
---|---|
boolean |
admitABetterSolution()
|
int |
getExpectedNumberOfClauses()
|
int[] |
model()
Provide a model (if any) for a satisfiable formula. |
int |
newVar(int howmany)
Create howmany variables in the solver (and thus in the
vocabulary). |
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.tools.SolverDecorator |
---|
addAllClauses, addAtLeast, addAtMost, addClause, clearDecorated, clearLearntClauses, decorated, expireTimeout, findModel, findModel, getStat, getTimeout, isSatisfiable, isSatisfiable, isSatisfiable, isSatisfiable, model, nConstraints, newVar, nVars, printInfos, printStat, printStat, removeConstr, setTimeout, setTimeoutMs, setTimeoutOnConflicts, toString |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AbstractSelectorVariablesDecorator(ISolver solver)
Method Detail |
---|
public int[] model()
IProblem
model
in interface IProblem
model
in class SolverDecorator<ISolver>
IProblem.isSatisfiable()
,
IProblem.isSatisfiable(IVecInt)
public int newVar(int howmany)
ISolver
howmany
variables in the solver (and thus in the
vocabulary).
newVar
in interface ISolver
newVar
in class SolverDecorator<ISolver>
howmany
- number of variables to create
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 SolverDecorator<ISolver>
nb
- the expected number of clauses.ISolver.newVar(int)
public int getExpectedNumberOfClauses()
public void reset()
ISolver
reset
in interface ISolver
reset
in class SolverDecorator<ISolver>
public boolean admitABetterSolution() throws TimeoutException
TimeoutException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |