|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.sf.javailp.Problem
public class Problem
The class Problem represents a linear problem consisting of multiple
constraints and up to one objective function.
| Constructor Summary | |
|---|---|
Problem()
Constructs a Problem. |
|
| Method Summary | |
|---|---|
void |
add(Constraint constraint)
Adds a constraint. |
void |
add(Linear lhs,
Operator operator,
Number rhs)
Adds a constraint. |
void |
add(Linear lhs,
String operator,
Number rhs)
Adds a constraint. |
void |
add(String name,
Linear lhs,
Operator operator,
Number rhs)
Adds a constraint. |
void |
add(String name,
Linear lhs,
String operator,
Number rhs)
Adds a constraint. |
List<Constraint> |
getConstraints()
Returns the constraints. |
int |
getConstraintsCount()
Returns the number of objectives. |
Linear |
getObjective()
Returns the objective function. |
OptType |
getOptType()
Returns the optimization type. |
Collection<Object> |
getVariables()
Returns the variables. |
int |
getVariablesCount()
Returns the number of variables. |
Number |
getVarLowerBound(Object variable)
Returns the lower bound of a variable. |
VarType |
getVarType(Object variable)
Returns the variable type. |
Number |
getVarUpperBound(Object variable)
Returns the upper bound of a variable. |
void |
setObjective(Linear objective)
Sets the objective function. |
void |
setObjective(Linear objective,
OptType optType)
Sets the objective function. |
void |
setObjective(Linear objective,
String optType)
Sets the objective function. |
void |
setOptimizationType(OptType optType)
Sets the optimization type. |
void |
setVarLowerBound(Object variable,
Number value)
Sets the lower bound of a variable. |
void |
setVarType(Object variable,
Class<?> type)
Sets the variable type of one variable. |
void |
setVarType(Object variable,
VarType type)
Sets the variable type of one variable. |
void |
setVarUpperBound(Object variable,
Number value)
Sets the upper bound of a variable. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Problem()
Problem.
| Method Detail |
|---|
public Linear getObjective()
public void setObjective(Linear objective)
objective - the objective function
public void setObjective(Linear objective,
OptType optType)
objective - the objective functionoptType - the optimization type
public void setObjective(Linear objective,
String optType)
objective - the objective functionoptType - the optimization type (min,max)public void setOptimizationType(OptType optType)
optType - the optimization type to be setpublic OptType getOptType()
public List<Constraint> getConstraints()
public int getConstraintsCount()
public Collection<Object> getVariables()
public int getVariablesCount()
public void add(Constraint constraint)
constraint - the constraint to be added
public void add(Linear lhs,
Operator operator,
Number rhs)
lhs - the left-hand-side linear expressionoperator - the operatorrhs - the right-hand-side number
public void add(Linear lhs,
String operator,
Number rhs)
lhs - the left-hand-side linear expressionoperator - the operator (<=,=,>=)rhs - the right-hand-side number
public void add(String name,
Linear lhs,
Operator operator,
Number rhs)
name - the name of the constraintlhs - the left-hand-side linear expressionoperator - the operatorrhs - the right-hand-side number
public void add(String name,
Linear lhs,
String operator,
Number rhs)
name - the name of the constraintlhs - the left-hand-side linear expressionoperator - the operator (<=,=,>=)rhs - the right-hand-side numberpublic VarType getVarType(Object variable)
variable - the variable
public void setVarType(Object variable,
VarType type)
variable - the variabletype - the type
public void setVarType(Object variable,
Class<?> type)
variable - the variabletype - the typepublic Number getVarLowerBound(Object variable)
variable - the lower bound
null if no lower bound existspublic Number getVarUpperBound(Object variable)
variable - the upper bound
null if no upper bound exists
public void setVarLowerBound(Object variable,
Number value)
variable - the variablevalue - the lower bound value
public void setVarUpperBound(Object variable,
Number value)
variable - the variablevalue - the upper bound valuepublic String toString()
toString in class Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||