public abstract class AbstractSelectorVariablesDecorator extends SolverDecorator<ISolver> implements IOptimizationProblem
Constructor and Description |
---|
AbstractSelectorVariablesDecorator(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.
|
int |
getExpectedNumberOfClauses() |
int |
getNbexpectedclauses() |
boolean[] |
getPrevboolmodel() |
int[] |
getPrevfullmodel() |
int[] |
getPrevmodel() |
boolean |
isOptimal()
Allows to check afterwards if the solution provided by the solver is
optimal or not.
|
boolean |
isSolutionOptimal() |
int[] |
model()
Provide a model (if any) for a satisfiable formula.
|
boolean |
model(int var)
Provide the truth value of a specific variable in the model.
|
void |
setExpectedNumberOfClauses(int nb)
To inform the solver of the expected number of clauses to read.
|
void |
setNbexpectedclauses(int nbexpectedclauses) |
void |
setPrevboolmodel(boolean[] prevboolmodel) |
void |
setPrevfullmodel(int[] prevfullmodel) |
void |
setPrevmodel(int[] prevmodel) |
void |
setSolutionOptimal(boolean isSolutionOptimal) |
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, modelWithInternalVariables, nConstraints, newVar, newVar, nextFreeVarId, nVars, primeImplicant, primeImplicant, printInfos, printInfos, printStat, printStat, printStat, realNumberOfVariables, registerLiteral, removeConstr, removeSubsumedConstr, reset, setDBSimplificationAllowed, setKeepSolverHot, setLogPrefix, setSearchListener, setTimeout, setTimeoutMs, setTimeoutOnConflicts, setVerbose, toString, toString, unsatExplanation
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
calculateObjective, discard, discardCurrentSolution, forceObjectiveValueTo, getObjectiveValue, hasNoObjectiveFunction, nonOptimalMeansSatisfiable, setTimeoutForFindingBetterSolution
findModel, findModel, isSatisfiable, isSatisfiable, isSatisfiable, isSatisfiable, nConstraints, newVar, nVars, primeImplicant, primeImplicant, printInfos, printInfos
public AbstractSelectorVariablesDecorator(ISolver solver)
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.IProblem.newVar(int)
public int getExpectedNumberOfClauses()
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 int[] model()
IProblem
model
in interface IProblem
model
in class SolverDecorator<ISolver>
IProblem.isSatisfiable()
,
IProblem.isSatisfiable(IVecInt)
public boolean model(int var)
RandomAccessModel
model
in interface RandomAccessModel
model
in class SolverDecorator<ISolver>
var
- the variable id in Dimacs format#model()
public boolean isOptimal()
IOptimizationProblem
isOptimal
in interface IOptimizationProblem
public int getNbexpectedclauses()
public void setNbexpectedclauses(int nbexpectedclauses)
public int[] getPrevfullmodel()
public void setPrevfullmodel(int[] prevfullmodel)
public int[] getPrevmodel()
public void setPrevmodel(int[] prevmodel)
public boolean[] getPrevboolmodel()
public void setPrevboolmodel(boolean[] prevboolmodel)
public boolean isSolutionOptimal()
public void setSolutionOptimal(boolean isSolutionOptimal)
Copyright © 2013 Centre de Recherche en Informatique de Lens (CRIL). All Rights Reserved.