|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.ObjectLBJ2.infer.Inference
LBJ2.infer.GLPK
GLPKHook object to the
ILPInference constructor.
public class GLPK
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.
The difference between this implementation and NaiveGLPK is
that this implementation attempts to save the generation of a few
constraints by directly translating a broader variety of propositional
logic subexpressions into as few constraints as possible. For example,
negated variables never need to be converted to positive variables with
the addition of a new variable and constraint, like NaiveGLPK
would generate.
This class assumes that the constraint variable inherited
from class Inference is of type
FirstOrderConstraint.
| Field Summary | |
|---|---|
protected boolean |
generateCuts
Deprecated. Whether or not to generate Gomory cuts. |
protected int |
ID
Deprecated. The identification number for this object, used in debug file names. |
protected java.util.HashMap |
indexMap
Deprecated. Used during ILP constraint generation. |
protected static int |
nextID
Deprecated. Keeps the next ID number for objects of this class. |
private boolean |
PRINT_ILP
Deprecated. Debugging variable. |
protected int |
returnIndex
Deprecated. Used during ILP constraint generation. |
protected boolean |
returnNegation
Deprecated. Used during ILP constraint generation. |
protected GLPKHook |
solver
Deprecated. The JNI to the GLPK library. |
protected boolean |
topLevel
Deprecated. Used during ILP constraint generation. |
protected boolean |
writeStatusFiles
Deprecated. Whether or not to write debug files when problems arise. |
| Fields inherited from class LBJ2.infer.Inference |
|---|
constraint, head, variables |
| Constructor Summary | |
|---|---|
GLPK()
Deprecated. Default constructor. |
|
GLPK(boolean g)
Deprecated. Initializing constructor. |
|
GLPK(boolean g,
boolean w)
Deprecated. Initializing constructor. |
|
GLPK(int i)
Deprecated. This constructor is invoked by simply supplying any integer argument; the argument is ignored, and debugging output is enabled. |
|
GLPK(java.lang.Object h)
Deprecated. Initializing constructor. |
|
GLPK(java.lang.Object h,
boolean g)
Deprecated. Initializing constructor. |
|
GLPK(java.lang.Object h,
boolean g,
boolean w)
Deprecated. Initializing constructor. |
|
GLPK(java.lang.Object h,
int i)
Deprecated. This constructor is invoked by simply supplying any integer argument; the argument is ignored, and debugging output is enabled. |
|
| Method Summary | |
|---|---|
void |
addConstraint(FirstOrderConstraint c)
Deprecated. Adds a constraint to the inference. |
protected int |
createNewVariable(java.lang.String d)
Deprecated. Used during ILP constraint generation, this method creates a new temporary propositional variable and adds the corresponding column to the solver. |
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. |
java.lang.String |
valueOf(Learner c,
java.lang.Object o)
Deprecated. Retrieves the value of the specified variable as identified by the classifier and the object that produce that variable. |
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.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 |
|---|
protected static int nextID
protected GLPKHook solver
protected boolean writeStatusFiles
protected int ID
protected boolean generateCuts
private boolean PRINT_ILP
protected int returnIndex
protected boolean returnNegation
returnIndex is negated in its
current context.
protected java.util.HashMap indexMap
PropositionalVariable objects. The keys associated with
indexes of temporary variables created during constraint translation are
strings.
protected boolean topLevel
| Constructor Detail |
|---|
public GLPK(int i)
i - Anything.
public GLPK(java.lang.Object h,
int i)
i - Anything.public GLPK()
public GLPK(boolean g)
g - Whether or not to generate cuts.
public GLPK(boolean g,
boolean w)
g - Whether or not to generate cuts.w - Whether or not to write debug files when problems arise.public GLPK(java.lang.Object h)
h - The head object.
public GLPK(java.lang.Object h,
boolean g)
h - The head object.g - Whether or not to generate cuts.
public GLPK(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 |
|---|
public void addConstraint(FirstOrderConstraint c)
c - The constraint to add.
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 Inferencejava.lang.Exception
public java.lang.String valueOf(Learner c,
java.lang.Object o)
throws java.lang.Exception
valueOf in class Inferencec - The classifier producing the variable.o - The object from which the variable is produced.
Learner's discreteValue(Object)
method applied to the Object is returned.
java.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 java.lang.Objecto - The object to compare to this object.
true iff this object equals the argument object
as defined above.protected int createNewVariable(java.lang.String d)
d - A textual description of the subexpression whose value is
represented by the new variable.
public void visit(PropositionalDoubleImplication c)
visit in class Inferencec - The constraint to process.public void visit(PropositionalImplication c)
visit in class Inferencec - The constraint to process.public void visit(PropositionalConjunction c)
visit in class Inferencec - The constraint to process.public void visit(PropositionalDisjunction c)
visit in class Inferencec - The constraint to process.public void visit(PropositionalAtLeast c)
visit in class Inferencec - The constraint to process.public void visit(PropositionalNegation c)
visit in class Inferencec - The constraint to process.public void visit(PropositionalVariable c)
visit in class Inferencec - The constraint to process.public void visit(PropositionalConstant c)
visit in class Inferencec - The constraint to process.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||