|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.sf.javailp.minisat.MiniSat
public class MiniSat
The MiniSat is the JNI class for the MiniSat+ solver.
The variables are integers starting from 0. A positive literal of the
variable x is x+1, the negative literal is -(x+1).
| Constructor Summary | |
|---|---|
MiniSat()
Construct a MiniSat instance. |
|
| Method Summary | |
|---|---|
boolean |
addConstraint(int[] coeffs,
int[] lits,
String comp,
int rhs)
Adds a linear constraint. |
boolean |
okay()
Returns true if no contradiction appeared so far. |
void |
reset()
Resets the decision heuristic, i.e., the phases and activities of the variables. |
void |
setDecay(double value)
Set the decay value |
void |
setInc(double value)
Set the inc value |
void |
setObjective(int[] coeffs,
int[] lits)
Set the objective of the problem. |
void |
setVar(int var,
boolean phase,
double activity)
Sets the initial phase and activity for a specified variable- |
void |
setVerbose(int level)
Set the verbosity level (0=no output,1,2=most output). |
void |
solve()
Solve the problem. |
boolean |
solveSingle()
Solve the problem without optimizing. |
String |
toString()
|
boolean |
valueOf(int var)
Returns the value of the result of a specified variable. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public MiniSat()
MiniSat instance.
| Method Detail |
|---|
public void setObjective(int[] coeffs,
int[] lits)
coeffs - the coefficientslits - the literals
public boolean addConstraint(int[] coeffs,
int[] lits,
String comp,
int rhs)
coeffs - the coefficientslits - the literalscomp - the comparator ("<=","=",">=")rhs - the right hand side value
true if this constraint did not cause a contradictionpublic void solve()
public boolean solveSingle()
true if a feasible solution is foundpublic boolean valueOf(int var)
MiniSat#solve() or MiniSat#solveSingle().
var - the variable
public void setVar(int var,
boolean phase,
double activity)
var - the variablephase - the phaseactivity - the activitypublic void reset()
public void setInc(double value)
inc value
value - the inc value to be setpublic void setDecay(double value)
decay value
value - the decay value to be setpublic void setVerbose(int level)
level - the level to be setpublic boolean okay()
true if no contradiction appeared so far.
true if no contradiction appeared so farpublic String toString()
toString in class Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||