FormatTypeInput
public final class MILP extends java.lang.Object implements FormatTypeInput
FormatTypeInput.FormatType
Modifier and Type | Field | Description |
---|---|---|
static double |
NaN |
Constructor | Description |
---|---|
MILP(java.lang.String path) |
Constructor of a MILP object for solving problems formulated in inequality format contained in
an external file.
|
MILP(java.util.ArrayList<java.lang.String> inequality) |
Constructor of a MILP object for solving problems formulated in inequality format contained in
an ArrayList of Strings.
|
MILP(LinearObjectiveFunction fo,
java.util.ArrayList<Constraint> constraints) |
Constructor of a MILP object for solving problems expressed in matrix format.
|
MILP(org.ssclab.ref.Input input) |
Constructor of a MILP object for solving problems expressed in coefficient format.
|
MILP(org.ssclab.ref.Input input,
org.ssclab.context.Session session) |
Constructor of a MILP object for solving problems expressed in coefficient format.
|
MILP(org.ssclab.ref.Input input_sparse,
org.ssclab.context.Session session,
FormatTypeInput.FormatType format) |
Constructor of a MILP object for solving problems expressed in either sparse or coefficient format.
|
MILP(org.ssclab.ref.Input input_sparse,
FormatTypeInput.FormatType format) |
Constructor of a MILP object for solving problems expressed in sparse or coefficient format.
|
Modifier and Type | Method | Description |
---|---|---|
int |
getNumMaxIterationForSingleSimplex() |
|
int |
getNumMaxSimplexs() |
|
Solution |
getRelaxedSolution() |
This method returns the solution of the problem by removing the integer constraints (relaxed solution).
|
Solution |
getSolution() |
This method returns, if it exists, the optimal integer, mixed-integer, or binary solution.
|
MILPThreadsNumber |
getThreadNumber() |
|
double[] |
getValuesSolution() |
If the problem has an optimal solution, this method returns that optimal solution in the form
of an array with the values of the variables.
|
boolean |
isJustTakeFeasibleSolution() |
|
SolutionType |
resolve() |
Executes the Branch and Bound algorithm.
|
void |
setCEpsilon(EPSILON cepsilon) |
This method allows setting the epsilon value relative to the tolerance for
determining if an optimal solution of phase 1 of the simplex is close to or equal to zero and thus gives rise to
feasible solutions for the problem.
|
void |
setEpsilon(EPSILON epsilon) |
This method allows setting the epsilon value relative to the tolerance that intervenes in various aspects of the simplex.
|
void |
setIEpsilon(EPSILON iepsilon) |
This method allows setting the epsilon value relative to the tolerance for
determining if a number should be considered integer or not.
|
void |
setJustTakeFeasibleSolution(boolean isJustTakeFeasibleSolution) |
Setting it to true allows interrupting the Branch and Bound in order to determine
not an optimal solution but only a feasible solution to the problem.
|
void |
setNumMaxIterationForSingleSimplex(int num_max_iteration) |
Method to set the number of iterations for each individual simplex.
|
void |
setNumMaxSimplexs(int num_max_simplex) |
Method to set the maximum number of simplexes.
|
void |
setThreadNumber(MILPThreadsNumber lthreadNumber) |
This method allows setting the number of threads to use for executing the Branch and Bound.
|
public MILP(java.util.ArrayList<java.lang.String> inequality) throws java.lang.Exception
inequality
- The ArrayList with the problemjava.lang.Exception
- if the ArrayList is null or emptypublic MILP(java.lang.String path) throws java.lang.Exception
path
- Path of the file containing the problem in inequality formatjava.lang.Exception
- if the problem is not correctly formulatedpublic MILP(LinearObjectiveFunction fo, java.util.ArrayList<Constraint> constraints) throws java.lang.Exception
fo
- A LinearObjectiveFunction object representing the objective functionconstraints
- The list of constraintsjava.lang.Exception
- An exception is thrown if the problem is not correctly formulatedpublic MILP(org.ssclab.ref.Input input) throws java.lang.Exception
input
- The problem formulated in coefficient formatjava.lang.Exception
- An exception is thrown if the problem is not formulated correctlypublic MILP(org.ssclab.ref.Input input, org.ssclab.context.Session session) throws java.lang.Exception
input
- The problem formulated in coefficient formatsession
- An SSC working sessionjava.lang.Exception
- An exception is thrown if the problem is not formulated correctlypublic MILP(org.ssclab.ref.Input input_sparse, org.ssclab.context.Session session, FormatTypeInput.FormatType format) throws java.lang.Exception
input_sparse
- The problem formulated in sparse or coefficient formatsession
- An SSC working sessionformat
- The type of format used (FormatType.SPARSE or FormatType.COEFF)java.lang.Exception
- An exception is thrown if the problem is not formulated correctlypublic MILP(org.ssclab.ref.Input input_sparse, FormatTypeInput.FormatType format) throws java.lang.Exception
input_sparse
- The problem formulated in sparse formatformat
- The type of format used (FormatType.SPARSE or FormatType.COEFF)java.lang.Exception
- An exception is thrown if the problem is not formulated correctlypublic int getNumMaxIterationForSingleSimplex()
public void setNumMaxIterationForSingleSimplex(int num_max_iteration) throws org.ssclab.pl.milp.simplex.SimplexException
num_max_iteration
- The maximum number of iterations that each simplex can executeorg.ssclab.pl.milp.simplex.SimplexException
- If an error occurs during the processpublic int getNumMaxSimplexs()
public void setNumMaxSimplexs(int num_max_simplex)
num_max_simplex
- the maximum number of simplexes executable in the Branch and Bound procedurepublic void setEpsilon(EPSILON epsilon)
epsilon
- Tolerance used in various phases of the simplex. Default value 1E-10public void setCEpsilon(EPSILON cepsilon)
cepsilon
- Tolerance of phase 1 solution with respect to zero. Default value 1E-8public void setIEpsilon(EPSILON iepsilon)
iepsilon
- Tolerance to consider a number as integer. Default value 1E-10public SolutionType resolve() throws java.lang.Exception
java.lang.Exception
- If the execution process generates an errorpublic Solution getRelaxedSolution()
public Solution getSolution()
public double[] getValuesSolution() throws org.ssclab.pl.milp.simplex.SimplexException
org.ssclab.pl.milp.simplex.SimplexException
- If the optimal solution is not presentpublic MILPThreadsNumber getThreadNumber()
public void setThreadNumber(MILPThreadsNumber lthreadNumber)
lthreadNumber
- Enumeration for setting the number of Threadspublic boolean isJustTakeFeasibleSolution()
public void setJustTakeFeasibleSolution(boolean isJustTakeFeasibleSolution)
isJustTakeFeasibleSolution
- true to interrupt the Branch and Bound and obtain only a feasible solution.