public interface LPEngine
extends java.lang.Cloneable
Modifier and Type | Interface and Description |
---|---|
static class |
LPEngine.EngineType
Engine implemented by implementing class.
|
static class |
LPEngine.ObjectiveTargetType
Possible types of objectives of an LP
|
static class |
LPEngine.Operator
Enumeration of operators to use in objectives function and constraints.
|
static class |
LPEngine.VariableType
Possible variable types within an LP
|
Modifier and Type | Method and Description |
---|---|
void |
accept(LPEngineVisitor visitor) |
int |
addConstraint(double[] constraint,
LPEngine.Operator operator,
double value)
Add a constraints to the LP Engine
|
int |
addConstraint(java.util.Map<java.lang.Integer,java.lang.Double> constraint,
LPEngine.Operator operator,
double value)
Add a constraints to the LP Engine
|
int |
addVariable(double[] column,
LPEngine.VariableType type)
Add a variable.
|
int |
addVariable(java.util.Map<java.lang.Integer,java.lang.Double> nonZeroValues,
LPEngine.VariableType type)
Add a variable.
|
LPEngine |
clone() |
void |
destroy()
destroy the ILP problem and (try to) free the memory;
|
double[] |
emptyConstraint()
Return an empty constraint ([0,0,...0]) with the appropriate length for
addition.
|
double[] |
emptyVariable()
Return an empty objective array ([0,0,...0]) with the appropriate length
for addition.
|
LPEngine.EngineType |
engineType()
Returns what engineType is actually used by the implementing class.
|
double |
getVariableLowerBound(int variableIndex) |
double |
getVariableUpperBound(int variableIndex) |
boolean |
isFeasible()
Assess whether is at least one solution
|
int |
minimalConstraintIndex()
Given a specific engine type (e.g.
|
int |
minimalVariableIndex()
Given a specific engine type (e.g.
|
int |
numConstraints()
Query the total number of constraints (== rows in matrix)
|
int |
numVariables()
Query the total number of variables (== columns in matrix)
|
void |
pop()
pop a constraint out of the engine (that is the constraint with the max.
|
void |
print()
Print the current state of the LP.
|
boolean |
removeConstraint(int row)
Remove the given constraints.
|
boolean |
removeVariable(int column)
Remove a variable from the LP.
|
boolean |
setConstraint(int row,
double[] constraint)
Set the given row with the provided constraints Note: the size of the
array should equal the number of constraints.
|
boolean |
setConstraint(int row,
double[] constraint,
double rhs)
Set the given row with the provided constraint and rhs.
|
boolean |
setConstraint(int row,
double[] constraint,
LPEngine.Operator op,
double rhs)
Set the given row with the provided constraint, operator and rhs
|
boolean |
setConstraint(int row,
java.util.Map<java.lang.Integer,java.lang.Double> constraint)
Renew the given row with the provided constraints.
|
boolean |
setConstraintOperator(int row,
LPEngine.Operator op)
Set the given constraint's operator (e.g.
|
boolean |
setLowerBound(int column,
double lowerBound)
Set a variable's lower-bound.
|
void |
setMat(int rowIndex,
int columnIndex,
double value)
Set a cell within the engine.
|
boolean |
setObjective(double[] objective,
LPEngine.ObjectiveTargetType target)
Set the objectives value of the P
|
boolean |
setObjective(java.util.Map<java.lang.Integer,java.lang.Double> objective,
LPEngine.ObjectiveTargetType target)
Set the objectives value of the LP
|
boolean |
setObjectiveType(LPEngine.ObjectiveTargetType type)
Set the type of the objectives, either minimize or maximize.
|
boolean |
setRightHandSide(int row,
double rhs) |
void |
setTimeOut(long seconds) |
boolean |
setType(int column,
LPEngine.VariableType type)
Set a variable's type to be of type int.
|
boolean |
setUpperBound(int column,
double upperBound)
Set a variable upperbound.
|
java.util.Map<java.lang.Integer,java.lang.Double> |
solve()
Solve the LP and return the best variable assignment
|
org.processmining.framework.util.Pair<double[],java.lang.Double> |
solveAndResetAndValueNative() |
org.processmining.framework.util.Pair<java.util.Map<java.lang.Integer,java.lang.Double>,java.lang.Double> |
solveAndValue()
Solve the LP and return the best variable assignment and the assignment
value.
|
org.processmining.framework.util.Pair<double[],java.lang.Double> |
solveAndValueNative()
Solve the LP and return the best variable assignment and the assignment
value.
|
double[] |
solveNative()
Solve the LP and return the best variable assignment
|
org.processmining.framework.util.Pair<org.processmining.framework.util.Pair<double[],java.lang.Double>,java.lang.Long> |
solveValueNativeSolveTimeNano() |
void |
writeToFile(java.lang.String dest) |
void accept(LPEngineVisitor visitor)
int addConstraint(double[] constraint, LPEngine.Operator operator, double value)
constraint
- to addoperator
- of constraintsvalue
- target value of constraintsint addConstraint(java.util.Map<java.lang.Integer,java.lang.Double> constraint, LPEngine.Operator operator, double value)
constraint
- map of variable to double valueoperator
- of constraintsvalue
- target value of constraintsint addVariable(double[] column, LPEngine.VariableType type)
column
- an array of double's specifying the columntype
- type of the variableint addVariable(java.util.Map<java.lang.Integer,java.lang.Double> nonZeroValues, LPEngine.VariableType type)
nonZeroValues
- mapping of row number to non-zero elementsLPEngine clone() throws java.lang.CloneNotSupportedException
java.lang.CloneNotSupportedException
void destroy()
double[] emptyConstraint()
double[] emptyVariable()
LPEngine.EngineType engineType()
double getVariableLowerBound(int variableIndex)
double getVariableUpperBound(int variableIndex)
boolean isFeasible()
int minimalConstraintIndex()
int minimalVariableIndex()
int numConstraints()
int numVariables()
void pop()
void print()
boolean removeConstraint(int row)
row
- to be removedboolean removeVariable(int column)
column
- to removeboolean setConstraint(int row, double[] constraint)
row
- to setconstraint
- new rowboolean setConstraint(int row, double[] constraint, double rhs)
row
- to setconstraint
- new constraintrhs
- right hand sideboolean setConstraint(int row, double[] constraint, LPEngine.Operator op, double rhs)
row
- to setconstraint
- new constraintop
- operatorrhs
- right hand sideboolean setConstraint(int row, java.util.Map<java.lang.Integer,java.lang.Double> constraint)
row
- number of constraints to renewconstraint
- to updateboolean setConstraintOperator(int row, LPEngine.Operator op)
row
- to setop
- operatorboolean setLowerBound(int column, double lowerBound)
column
- identifier of variablelowerBound
- to assing to variablevoid setMat(int rowIndex, int columnIndex, double value)
rowIndex
- columnIndex
- value
- boolean setObjective(double[] objective, LPEngine.ObjectiveTargetType target)
objective
- of the LPtarget
- type of objectivesboolean setObjective(java.util.Map<java.lang.Integer,java.lang.Double> objective, LPEngine.ObjectiveTargetType target)
objective
- Objective of the ILP in terms of column id'starget
- type of objectivesboolean setObjectiveType(LPEngine.ObjectiveTargetType type)
type
- of objectivesboolean setRightHandSide(int row, double rhs)
void setTimeOut(long seconds)
boolean setType(int column, LPEngine.VariableType type)
column
- index of variableboolean setUpperBound(int column, double upperBound)
column
- identifier of variableupperBound
- to assing to variablejava.util.Map<java.lang.Integer,java.lang.Double> solve()
org.processmining.framework.util.Pair<java.util.Map<java.lang.Integer,java.lang.Double>,java.lang.Double> solveAndValue()
org.processmining.framework.util.Pair<double[],java.lang.Double> solveAndValueNative()
double[] solveNative()
org.processmining.framework.util.Pair<double[],java.lang.Double> solveAndResetAndValueNative()
org.processmining.framework.util.Pair<org.processmining.framework.util.Pair<double[],java.lang.Double>,java.lang.Long> solveValueNativeSolveTimeNano()
void writeToFile(java.lang.String dest)