public class MinCostDecorator extends PBSolverDecorator implements IOptimizationProblem
| Constructor and Description |
|---|
MinCostDecorator(IPBSolver solver) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
admitABetterSolution() |
boolean |
admitABetterSolution(IVecInt assumps) |
Number |
calculateObjective() |
int |
costOf(int var)
to know the cost of a given var.
|
void |
discard() |
void |
discardCurrentSolution() |
void |
forceObjectiveValueTo(Number forcedValue) |
Number |
getObjectiveValue() |
boolean |
hasNoObjectiveFunction() |
boolean |
isOptimal() |
int[] |
model() |
int |
newVar() |
int |
newVar(int howmany)
Setup the number of variables to use inside the solver.
|
boolean |
nonOptimalMeansSatisfiable() |
void |
reset() |
void |
setCost(int var,
int cost)
to set the cost of a given var.
|
void |
setTimeoutForFindingBetterSolution(int seconds) |
addAtLeast, addAtLeast, addAtMost, addAtMost, addExactly, addExactly, addPseudoBoolean, getObjectiveFunction, setObjectiveFunctionaddAllClauses, addAtLeast, addAtMost, addBlockingClause, addClause, addExactly, clearDecorated, clearLearntClauses, decorated, expireTimeout, findModel, findModel, getLogPrefix, getSearchListener, getSolvingEngine, getStat, getTimeout, getTimeoutMs, isDBSimplificationAllowed, isSatisfiable, isSatisfiable, isSatisfiable, isSatisfiable, isSolverKeptHot, isVerbose, model, modelWithInternalVariables, nConstraints, nextFreeVarId, nVars, primeImplicant, primeImplicant, printInfos, printInfos, printStat, printStat, printStat, realNumberOfVariables, registerLiteral, removeConstr, removeSubsumedConstr, setDBSimplificationAllowed, setExpectedNumberOfClauses, setKeepSolverHot, setLogPrefix, setSearchListener, setTimeout, setTimeoutMs, setTimeoutOnConflicts, setUnitClauseProvider, setVerbose, toString, toString, unsatExplanationclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitfindModel, findModel, isSatisfiable, isSatisfiable, isSatisfiable, isSatisfiable, nConstraints, nVars, primeImplicant, primeImplicant, printInfos, printInfosmodeladdAllClauses, addAtLeast, addAtMost, addBlockingClause, addClause, addExactly, clearLearntClauses, expireTimeout, getLogPrefix, getSearchListener, getSolvingEngine, getStat, getTimeout, getTimeoutMs, isDBSimplificationAllowed, isSolverKeptHot, isVerbose, modelWithInternalVariables, nextFreeVarId, printStat, printStat, printStat, realNumberOfVariables, registerLiteral, removeConstr, removeSubsumedConstr, setDBSimplificationAllowed, setExpectedNumberOfClauses, setKeepSolverHot, setLogPrefix, setSearchListener, setTimeout, setTimeoutMs, setTimeoutOnConflicts, setUnitClauseProvider, setVerbose, toString, unsatExplanationpublic MinCostDecorator(IPBSolver solver)
public int newVar()
newVar in interface ISolvernewVar in class SolverDecorator<IPBSolver>public int newVar(int howmany)
newVar in interface IProblemnewVar in class SolverDecorator<IPBSolver>howmany - the maximum number of variables in the solver.public int costOf(int var)
var - a variable in dimacs formatpublic void setCost(int var,
int cost)
var - a variable in dimacs formatcost - the cost of var when assigned to truepublic boolean admitABetterSolution()
throws TimeoutException
admitABetterSolution in interface IOptimizationProblemTimeoutExceptionpublic boolean admitABetterSolution(IVecInt assumps) throws TimeoutException
admitABetterSolution in interface IOptimizationProblemTimeoutExceptionpublic boolean hasNoObjectiveFunction()
hasNoObjectiveFunction in interface IOptimizationProblempublic boolean nonOptimalMeansSatisfiable()
nonOptimalMeansSatisfiable in interface IOptimizationProblempublic Number calculateObjective()
calculateObjective in interface IOptimizationProblempublic void discardCurrentSolution()
throws ContradictionException
discardCurrentSolution in interface IOptimizationProblemContradictionExceptionpublic void reset()
reset in interface ISolverreset in class SolverDecorator<IPBSolver>public int[] model()
model in interface IProblemmodel in class SolverDecorator<IPBSolver>public Number getObjectiveValue()
getObjectiveValue in interface IOptimizationProblempublic void discard()
throws ContradictionException
discard in interface IOptimizationProblemContradictionExceptionpublic void forceObjectiveValueTo(Number forcedValue) throws ContradictionException
forceObjectiveValueTo in interface IOptimizationProblemContradictionExceptionpublic boolean isOptimal()
isOptimal in interface IOptimizationProblempublic void setTimeoutForFindingBetterSolution(int seconds)
setTimeoutForFindingBetterSolution in interface IOptimizationProblemCopyright © 2013 Centre de Recherche en Informatique de Lens (CRIL). All Rights Reserved.