|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface ILPSolver
Classes that implement this interface contain implementations of algorithms that solve Integer Linear Programming problems.
| Method Summary | |
|---|---|
int |
addBooleanVariable(double c)
Adds a new Boolean variable (an integer variable constrained to take either the value 0 or the value 1) with the specified coefficient in the objective function to the problem. |
int[] |
addDiscreteVariable(double[] c)
Adds a general, multi-valued discrete variable, which is implemented as a set of Boolean variables, one per value of the discrete variable, with exactly one of those variables set true at any given time. |
int[] |
addDiscreteVariable(Score[] c)
Adds a general, multi-valued discrete variable, which is implemented as a set of Boolean variables, one per value of the discrete variable, with exactly one of those variables set true at any given time. |
void |
addEqualityConstraint(int[] i,
double[] a,
double b)
Adds a new fixed constraint to the problem. |
void |
addGreaterThanConstraint(int[] i,
double[] a,
double b)
Adds a new lower bounded constraint to the problem. |
void |
addLessThanConstraint(int[] i,
double[] a,
double b)
Adds a new upper bounded constraint to the problem. |
boolean |
getBooleanValue(int index)
When the problem has been solved, use this method to retrieve the value of any Boolean inference variable. |
boolean |
isSolved()
Tests whether the problem represented by this ILPSolver
instance has been solved already. |
void |
reset()
This method clears the all constraints and variables out of the ILP solver's problem representation, bringing the ILPSolver
instance back to the state it was in when first constructed. |
void |
setMaximize(boolean d)
Sets the direction of the objective function. |
boolean |
solve()
Solves the ILP problem, saving the solution internally. |
void |
write(java.lang.StringBuffer buffer)
Creates a textual representation of the ILP problem in an algebraic notation. |
| Method Detail |
|---|
void setMaximize(boolean d)
d - true if the objective function is to be
maximized.int addBooleanVariable(double c)
c - The objective function coefficient for the new Boolean
variable.
int[] addDiscreteVariable(double[] c)
true at any given time.
c - The objective function coefficients for the new Boolean
variables.
int[] addDiscreteVariable(Score[] c)
true at any given time.
c - An array of Scores containing the
objective function coefficients for the new Boolean variables.
void addEqualityConstraint(int[] i,
double[] a,
double b)
addBooleanVariable(double) or
addDiscreteVariable(double[]). The resulting constraint has
the form:
xi * a = b
where xi represents the inference variables
whose indexes are contained in the array i and
* represents dot product.
i - The indexes of the variables with non-zero coefficients.a - The coefficients of the variables with the given indexes.b - The new constraint will enforce equality with this constant.
void addGreaterThanConstraint(int[] i,
double[] a,
double b)
addBooleanVariable(double) or
addDiscreteVariable(double[]). The resulting constraint has
the form:
xi * a >= b
where xi represents the inference variables
whose indexes are contained in the array i and
* represents dot product.
i - The indexes of the variables with non-zero coefficients.a - The coefficients of the variables with the given indexes.b - The lower bound for the new constraint.
void addLessThanConstraint(int[] i,
double[] a,
double b)
addBooleanVariable(double) or
addDiscreteVariable(double[]). The resulting constraint has
the form:
xi * a <= b
where xi represents the inference variables
whose indexes are contained in the array i and
* represents dot product.
i - The indexes of the variables with non-zero coefficients.a - The coefficients of the variables with the given indexes.b - The upper bound for the new constraint.
boolean solve()
throws java.lang.Exception
java.lang.Exceptionboolean isSolved()
ILPSolver
instance has been solved already.
boolean getBooleanValue(int index)
index - The index of the variable whose value is requested.
void reset()
ILPSolver
instance back to the state it was in when first constructed.
void write(java.lang.StringBuffer buffer)
buffer - The created textual representation will be appended here.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||