LBJ2.infer
Class NaiveGLPK

java.lang.Object
  extended by LBJ2.infer.Inference
      extended by LBJ2.infer.GLPK
          extended by LBJ2.infer.NaiveGLPK

Deprecated. As of LBJ release 2.0.12, it is preferrable to pass a GLPKHook object to the ILPInference constructor.

public class NaiveGLPK
extends 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. 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

PRINT_ILP

private static final boolean PRINT_ILP
Deprecated. 
Debugging variable.

See Also:
Constant Field Values
Constructor Detail

NaiveGLPK

public NaiveGLPK()
Deprecated. 
Default constructor.


NaiveGLPK

public NaiveGLPK(boolean g)
Deprecated. 
Initializing constructor.

Parameters:
g - Whether or not to generate cuts.

NaiveGLPK

public NaiveGLPK(boolean g,
                 boolean w)
Deprecated. 
Initializing constructor.

Parameters:
g - Whether or not to generate cuts.
w - Whether or not to write debug files when problems arise.

NaiveGLPK

public NaiveGLPK(java.lang.Object h)
Deprecated. 
Initializing constructor.

Parameters:
h - The head object.

NaiveGLPK

public NaiveGLPK(java.lang.Object h,
                 boolean g)
Deprecated. 
Initializing constructor.

Parameters:
h - The head object.
g - Whether or not to generate cuts.

NaiveGLPK

public NaiveGLPK(java.lang.Object h,
                 boolean g,
                 boolean w)
Deprecated. 
Initializing constructor.

Parameters:
h - The head object.
g - Whether or not to generate cuts.
w - Whether or not to write debug files when problems arise.
Method Detail

infer

protected void infer()
              throws java.lang.Exception
Deprecated. 
Uses the lpx_intopt(LPX*) C routine from the GLPK library to solve the ILP proglem if it hasn't already been solved.

Overrides:
infer in class GLPK
Throws:
java.lang.Exception

equals

public 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. I.e., the == operator must return true when comparing the two head objects for this method to return true.

Overrides:
equals in class GLPK
Parameters:
o - The object to compare to this object.
Returns:
true iff this object equals the argument object as defined above.

visit

public void visit(PropositionalDoubleImplication c)
Deprecated. 
Derived classes override this method to do some type of processing on constraints of the parameter's type.

Overrides:
visit in class GLPK
Parameters:
c - The constraint to process.

visit

public void visit(PropositionalImplication c)
Deprecated. 
Derived classes override this method to do some type of processing on constraints of the parameter's type.

Overrides:
visit in class GLPK
Parameters:
c - The constraint to process.

visit

public void visit(PropositionalConjunction c)
Deprecated. 
Derived classes override this method to do some type of processing on constraints of the parameter's type.

Overrides:
visit in class GLPK
Parameters:
c - The constraint to process.

visit

public void visit(PropositionalDisjunction c)
Deprecated. 
Derived classes override this method to do some type of processing on constraints of the parameter's type.

Overrides:
visit in class GLPK
Parameters:
c - The constraint to process.

visit

public void visit(PropositionalAtLeast c)
Deprecated. 
Derived classes override this method to do some type of processing on constraints of the parameter's type.

Overrides:
visit in class GLPK
Parameters:
c - The constraint to process.

visit

public void visit(PropositionalNegation c)
Deprecated. 
Derived classes override this method to do some type of processing on constraints of the parameter's type.

Overrides:
visit in class GLPK
Parameters:
c - The constraint to process.

visit

public void visit(PropositionalVariable c)
Deprecated. 
Derived classes override this method to do some type of processing on constraints of the parameter's type.

Overrides:
visit in class GLPK
Parameters:
c - The constraint to process.

visit

public void visit(PropositionalConstant c)
Deprecated. 
Derived classes override this method to do some type of processing on constraints of the parameter's type.

Overrides:
visit in class GLPK
Parameters:
c - The constraint to process.