edu.harvard.econcs.jopt.solver.mip
Class MIPWrapper

java.lang.Object
  extended by edu.harvard.econcs.jopt.solver.mip.MIP
      extended by edu.harvard.econcs.jopt.solver.mip.MIPWrapper
All Implemented Interfaces:
IMIP, java.io.Serializable, java.lang.Cloneable

public class MIPWrapper
extends MIP

This wrapper goes even further in simplicity than the other MIP classes and might help you get started with your MIP programming. See ExampleSimpleWrapper.java for an example.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class edu.harvard.econcs.jopt.solver.mip.MIP
MAX_VALUE
 
Constructor Summary
MIPWrapper()
           
 
Method Summary
 Constraint beginNewEQConstraint(double constant)
          Creates a new Less Equals constraint
 Constraint beginNewGEQConstraint(double constant)
          Creates a new Less Than or Equals constraint
 Constraint beginNewLEQConstraint(double constant)
          Creates a new Less Than or Equals constraint This example makes a constraint "-2y <= 3"
(assumes earlier call like:MIPWrapper mip = makeNewMaxMIP(), and a Variable y)

Constraint c = beginNewLEQConstraint(3);
c.addTerm(y, -2);
mip.endConstraint(c); * @param constant is the value that is on the right hand side of the equation.
 void endConstraint(Constraint constraint)
          Call this when you are done building up a constraint.
 Variable makeNewBooleanVar(java.lang.String name)
          Makes a new indicator (boolean) variable that can range from 0 to 1
 Variable makeNewDoubleVar(java.lang.String name)
          Makes a new double variable that can range from -inf to inf
 Variable makeNewIntegerVar(java.lang.String name)
          Makes a new Integer variable that can range from -inf to inf
static MIPWrapper makeNewMaxMIP()
          Create a new MIP that is has a MAXimization as it's objective function.
static MIPWrapper makeNewMinMIP()
          Create a new MIP that is has a MINimization as it's objective function.
 
Methods inherited from class edu.harvard.econcs.jopt.solver.mip.MIP
add, add, addObjectiveTerm, addObjectiveTerm, clearProposedValues, clearSolveParams, getBooleanSolveParam, getBooleanSolveParam, getConstraint, getConstraints, getDoubleSolveParam, getDoubleSolveParam, getIntSolveParam, getIntSolveParam, getNumConstraints, getNumVars, getObjectiveTerms, getProposedBooleanValue, getProposedDoubleValue, getProposedIntValue, getSolveParam, getSpecefiedSolveParams, getStringSolveParam, getStringSolveParam, getVar, getVars, getVarsWithProposedValues, isObjectiveMax, isObjectiveMin, proposeValue, proposeValue, proposeValue, remove, remove, removeObjectiveTerm, removeProposedValue, resetDefaultSolveParams, setObjectiveMax, setSolveParam, setSolveParam, setSolveParam, setSolveParam, toString, typedClone
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MIPWrapper

public MIPWrapper()
Method Detail

makeNewMaxMIP

public static MIPWrapper makeNewMaxMIP()
Create a new MIP that is has a MAXimization as it's objective function. You would then add some objective terms. The following code makes a new MIP with "MAX 3X" as the objective.

MIPWrapper mip = makeNewMaxMIP();
Variable x = makeNewDoubleVar("x");
mip.addObjectiveTerm(x, 3);

Returns:
a mip object.

makeNewMinMIP

public static MIPWrapper makeNewMinMIP()
Create a new MIP that is has a MINimization as it's objective function. You would then add some objective terms. The following code makes a new MIP with "MIN 3X" as the objective.

MIPWrapper mip = makeNewMinMIP();
Variable x = makeNewDoubleVar("x");
mip.addObjectiveTerm(x, 3);


makeNewDoubleVar

public Variable makeNewDoubleVar(java.lang.String name)
Makes a new double variable that can range from -inf to inf


makeNewIntegerVar

public Variable makeNewIntegerVar(java.lang.String name)
Makes a new Integer variable that can range from -inf to inf


makeNewBooleanVar

public Variable makeNewBooleanVar(java.lang.String name)
Makes a new indicator (boolean) variable that can range from 0 to 1


endConstraint

public void endConstraint(Constraint constraint)
Call this when you are done building up a constraint.


beginNewLEQConstraint

public Constraint beginNewLEQConstraint(double constant)
Creates a new Less Than or Equals constraint This example makes a constraint "-2y <= 3"
(assumes earlier call like:MIPWrapper mip = makeNewMaxMIP(), and a Variable y)

Constraint c = beginNewLEQConstraint(3);
c.addTerm(y, -2);
mip.endConstraint(c); * @param constant is the value that is on the right hand side of the equation.

Returns:
the new constraint. You will want to add terms to the constraint.

beginNewGEQConstraint

public Constraint beginNewGEQConstraint(double constant)
Creates a new Less Than or Equals constraint

See Also:
beginNewLEQConstraint

beginNewEQConstraint

public Constraint beginNewEQConstraint(double constant)
Creates a new Less Equals constraint

See Also:
beginNewLEQConstraint