|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.sat4j.tools.SolverDecorator<T> org.sat4j.tools.LexicoDecorator<T>
public class LexicoDecorator<T extends ISolver>
Field Summary | |
---|---|
protected List<IVecInt> |
criteria
|
protected int |
currentCriterion
|
protected boolean[] |
prevboolmodel
|
protected int[] |
prevfullmodel
|
Constructor Summary | |
---|---|
LexicoDecorator(T solver)
|
Method Summary | |
---|---|
void |
addCriterion(IVecInt literals)
|
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. |
protected IConstr |
discardSolutionsForOptimizing()
|
protected Number |
evaluate()
|
protected void |
fixCriterionValue()
|
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. |
boolean |
model(int var)
Provide the truth value of a specific variable in the model. |
boolean |
nonOptimalMeansSatisfiable()
A suboptimal solution has different meaning depending of the optimization problem considered. |
protected int |
numberOfCriteria()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.sat4j.specs.IProblem |
---|
findModel, findModel, isSatisfiable, isSatisfiable, isSatisfiable, isSatisfiable, nConstraints, newVar, nVars, primeImplicant, printInfos |
Field Detail |
---|
protected final List<IVecInt> criteria
protected int currentCriterion
protected int[] prevfullmodel
protected boolean[] prevboolmodel
Constructor Detail |
---|
public LexicoDecorator(T solver)
Method Detail |
---|
public void addCriterion(IVecInt literals)
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)
protected int numberOfCriteria()
protected void fixCriterionValue() throws ContradictionException
ContradictionException
public int[] model()
IProblem
model
in interface IProblem
model
in class SolverDecorator<T extends ISolver>
IProblem.isSatisfiable()
,
IProblem.isSatisfiable(IVecInt)
public boolean model(int var)
IProblem
model
in interface IProblem
model
in class SolverDecorator<T extends ISolver>
var
- the variable id in Dimacs format
IProblem.model()
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 Number getObjectiveValue()
IOptimizationProblem
getObjectiveValue
in interface IOptimizationProblem
public void forceObjectiveValueTo(Number forcedValue) throws ContradictionException
IOptimizationProblem
forceObjectiveValueTo
in interface IOptimizationProblem
ContradictionException
public void discard() throws ContradictionException
IOptimizationProblem
discard
in interface IOptimizationProblem
ContradictionException
- if a trivial inconsistency is detected.IOptimizationProblem.discardCurrentSolution()
public void discardCurrentSolution() throws ContradictionException
IOptimizationProblem
discardCurrentSolution
in interface IOptimizationProblem
ContradictionException
- if a trivial inconsistency is detected.protected IConstr discardSolutionsForOptimizing() throws ContradictionException
ContradictionException
protected Number evaluate()
public boolean isOptimal()
IOptimizationProblem
isOptimal
in interface IOptimizationProblem
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |