|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.ObjectLBJ2.infer.Inference
LBJ2.infer.GLPK
LBJ2.infer.NaiveGLPK
GLPKHook object to the
ILPInference constructor.
public class NaiveGLPK
Uses the GNU Linear Programming Kit library to perform Integer Linear Programming over the variables, maximizing the sum of all learner-object-value triples selected while respecting the constraints. This code implements the most straight-forward algorithm for translating FOL constraints to linear inequalities. First, the FOL constraints are propositionalized and conjuncted together to arrive at a single propositional expression representing all the constraints. Then, each type of propositional subexpression recursively translates its children, replacing each with an unnegated variable before translating itself into two (or one, in the case of negation) linear inequalities.
This class assumes that the constraint variable inherited
from class Inference is of type
FirstOrderConstraint.
| Field Summary | |
|---|---|
private static boolean |
PRINT_ILP
Deprecated. Debugging variable. |
| Fields inherited from class LBJ2.infer.GLPK |
|---|
generateCuts, ID, indexMap, nextID, returnIndex, returnNegation, solver, topLevel, writeStatusFiles |
| Fields inherited from class LBJ2.infer.Inference |
|---|
constraint, head, variables |
| Constructor Summary | |
|---|---|
NaiveGLPK()
Deprecated. Default constructor. |
|
NaiveGLPK(boolean g)
Deprecated. Initializing constructor. |
|
NaiveGLPK(boolean g,
boolean w)
Deprecated. Initializing constructor. |
|
NaiveGLPK(java.lang.Object h)
Deprecated. Initializing constructor. |
|
NaiveGLPK(java.lang.Object h,
boolean g)
Deprecated. Initializing constructor. |
|
NaiveGLPK(java.lang.Object h,
boolean g,
boolean w)
Deprecated. Initializing constructor. |
|
| Method Summary | |
|---|---|
boolean |
equals(java.lang.Object o)
Deprecated. Two Inference objects are equal when they have the same
run-time type and store the same head object. |
protected void |
infer()
Deprecated. Uses the lpx_intopt(LPX*) C routine from the GLPK library
to solve the ILP proglem if it hasn't already been solved. |
void |
visit(PropositionalAtLeast c)
Deprecated. Derived classes override this method to do some type of processing on constraints of the parameter's type. |
void |
visit(PropositionalConjunction c)
Deprecated. Derived classes override this method to do some type of processing on constraints of the parameter's type. |
void |
visit(PropositionalConstant c)
Deprecated. Derived classes override this method to do some type of processing on constraints of the parameter's type. |
void |
visit(PropositionalDisjunction c)
Deprecated. Derived classes override this method to do some type of processing on constraints of the parameter's type. |
void |
visit(PropositionalDoubleImplication c)
Deprecated. Derived classes override this method to do some type of processing on constraints of the parameter's type. |
void |
visit(PropositionalImplication c)
Deprecated. Derived classes override this method to do some type of processing on constraints of the parameter's type. |
void |
visit(PropositionalNegation c)
Deprecated. Derived classes override this method to do some type of processing on constraints of the parameter's type. |
void |
visit(PropositionalVariable c)
Deprecated. Derived classes override this method to do some type of processing on constraints of the parameter's type. |
| Methods inherited from class LBJ2.infer.GLPK |
|---|
addConstraint, createNewVariable, valueOf |
| Methods inherited from class LBJ2.infer.Inference |
|---|
exampleToString, getHead, getHeadFinderTypes, getHeadType, getNormalizer, getVariable, getVariable, satisfied, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visitAll |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static final boolean PRINT_ILP
| Constructor Detail |
|---|
public NaiveGLPK()
public NaiveGLPK(boolean g)
g - Whether or not to generate cuts.
public NaiveGLPK(boolean g,
boolean w)
g - Whether or not to generate cuts.w - Whether or not to write debug files when problems arise.public NaiveGLPK(java.lang.Object h)
h - The head object.
public NaiveGLPK(java.lang.Object h,
boolean g)
h - The head object.g - Whether or not to generate cuts.
public NaiveGLPK(java.lang.Object h,
boolean g,
boolean w)
h - The head object.g - Whether or not to generate cuts.w - Whether or not to write debug files when problems arise.| Method Detail |
|---|
protected void infer()
throws java.lang.Exception
lpx_intopt(LPX*) C routine from the GLPK library
to solve the ILP proglem if it hasn't already been solved.
infer in class GLPKjava.lang.Exceptionpublic boolean equals(java.lang.Object o)
Inference objects are equal when they have the same
run-time type and store the same head object. I.e., the ==
operator must return true when comparing the two head
objects for this method to return true.
equals in class GLPKo - The object to compare to this object.
true iff this object equals the argument object
as defined above.public void visit(PropositionalDoubleImplication c)
visit in class GLPKc - The constraint to process.public void visit(PropositionalImplication c)
visit in class GLPKc - The constraint to process.public void visit(PropositionalConjunction c)
visit in class GLPKc - The constraint to process.public void visit(PropositionalDisjunction c)
visit in class GLPKc - The constraint to process.public void visit(PropositionalAtLeast c)
visit in class GLPKc - The constraint to process.public void visit(PropositionalNegation c)
visit in class GLPKc - The constraint to process.public void visit(PropositionalVariable c)
visit in class GLPKc - The constraint to process.public void visit(PropositionalConstant c)
visit in class GLPKc - The constraint to process.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||