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, setObjectiveFunction
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, 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, unsatExplanation
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
findModel, findModel, isSatisfiable, isSatisfiable, isSatisfiable, isSatisfiable, nConstraints, nVars, primeImplicant, primeImplicant, printInfos, printInfos
model
addAllClauses, 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, unsatExplanation
public MinCostDecorator(IPBSolver solver)
public int newVar()
newVar
in interface ISolver
newVar
in class SolverDecorator<IPBSolver>
public int newVar(int howmany)
newVar
in interface IProblem
newVar
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 IOptimizationProblem
TimeoutException
public boolean admitABetterSolution(IVecInt assumps) throws TimeoutException
admitABetterSolution
in interface IOptimizationProblem
TimeoutException
public boolean hasNoObjectiveFunction()
hasNoObjectiveFunction
in interface IOptimizationProblem
public boolean nonOptimalMeansSatisfiable()
nonOptimalMeansSatisfiable
in interface IOptimizationProblem
public Number calculateObjective()
calculateObjective
in interface IOptimizationProblem
public void discardCurrentSolution() throws ContradictionException
discardCurrentSolution
in interface IOptimizationProblem
ContradictionException
public void reset()
reset
in interface ISolver
reset
in class SolverDecorator<IPBSolver>
public int[] model()
model
in interface IProblem
model
in class SolverDecorator<IPBSolver>
public Number getObjectiveValue()
getObjectiveValue
in interface IOptimizationProblem
public void discard() throws ContradictionException
discard
in interface IOptimizationProblem
ContradictionException
public void forceObjectiveValueTo(Number forcedValue) throws ContradictionException
forceObjectiveValueTo
in interface IOptimizationProblem
ContradictionException
public boolean isOptimal()
isOptimal
in interface IOptimizationProblem
public void setTimeoutForFindingBetterSolution(int seconds)
setTimeoutForFindingBetterSolution
in interface IOptimizationProblem
Copyright © 2013 Centre de Recherche en Informatique de Lens (CRIL). All Rights Reserved.